


NSR_DATA(5)                                           NSR_DATA(5)


NNAAMMEE
       nsr_data - Data formats for NetWorker Save and Recover

DDEESSCCRRIIPPTTIIOONN
       All  data  in  the  NetWorker  system is encoded using the
       _e_X_t_e_r_n_a_l _D_a_t_a _R_e_p_r_e_s_e_n_t_a_t_i_o_n (XDR) standard.   When  files
       are passed between client (see ssaavvee(8) and rreeccoovveerr(8)) and
       server (see nnssrrdd(8)) and media (see nnssrrmmmmdd(8)),  they  are
       represented  as a _s_a_v_e_s_t_r_e_a_m, which is encoded as a linked
       list of _s_a_v_e_f_i_l_e_s.  There are currently 2 different  _s_a_v_e_-
       _f_i_l_e  formats.   A  magic number at the start of each file
       indicates the particular type of  the  following  _s_a_v_e_f_i_l_e
       thus  allowing for self identifying _s_a_v_e_s_t_r_e_a_m_s containing
       more than one _s_a_v_e_f_i_l_e type.  Logically each _s_a_v_e_f_i_l_e con-
       sists  of  some  header information followed by file data.
       The original _s_a_v_e_f_i_l_e_1 format uses a doubly wrapped set of
       client  attributes  describing the file attributes and the
       file data is encoded as a _b_u_c_k_e_t_l_i_s_t.  The newer _s_a_v_e_f_i_l_e_2
       format   uses   an  alternate  singularly  wrapped  client
       attributes with the file data  encoded  as  a  bucket-less
       succession  of  self describing sections each containing a
       type, a length, and bytes of data.  The file data  section
       of  a  file is terminated by an ending section with a type
       of 0 (NSR_ASDF_END).

       The XDR language description of the OS independent portion
       of the _s_a_v_e_s_t_r_e_a_m data structures is shown below.


       const NSR_IDLEN = 1024;            /* length of file id */
       const NSR_MAXNAMELEN = 1024;       /* max length of file system name */
       const NSR_MAXCATTRSIZE = 8192;     /* max size of client specific attributes */
       const NSR_MAXBUCKETDATA = 8192;    /* max size of file bucket's data (w/o slop) */
       const NSR_MAXBUCKETSIZE = 9000;    /* max total size of file bucket (w/ slop) */
       const NSR_MAXCLNTSIZE = 16384;     /* max size of a clntrec */

       typedef opaque fileid<NSR_IDLEN>;            /* file identifier */
       typedef string nsrname<NSR_MAXNAMELEN>;      /* file name type */
       typedef opaque clientattr<NSR_MAXCATTRSIZE>; /* client attributes */
       typedef opaque wraposaverec<NSR_MAXCLNTSIZE>;/* wrapped osaverec */
       typedef nulong_t checksum;                   /* 4 bytes for checksum */
       typedef u_long sfid_t;                       /* savefile id (offset) */

       struct id {
             string id_str<>;             /* id string */
             id *id_next;                 /* next such structure */
       };

       struct asmrec {
             id *ar_info;                 /* name and args to ASM */
             nsrname *ar_path;            /* not currently used */
             asmrec *ar_next;             /* next such structure */
       };




NetWorker rt_1998_4Q.Build.MMaJrFcehra0l8_,0021000                        1





NSR_DATA(5)                                           NSR_DATA(5)


       const NSR_MAGIC1 = 0x09265900;     /* older format using buckets & ssaverec's */

       struct osaverec {
             nsrname sr_filename;         /* name of this file */
             fileid sr_fid;               /* client specific file id */
             asmrec *sr_ar;               /* ASM list for this file */
             u_long sr_catype;            /* client specific attribute type */
             clientattr sr_cattr;         /* client specific file attributes */
       };

       struct ssaverec {
             sfid_t sr_id;                /* savefile id in the savestream */
             u_long sr_size;              /* size of encoded savefile */
             nulong_t sr_savetime;        /* savetime of this saveset */
             wraposaverec sr_wcr;         /* a wrapped osaverec */
       };

       /*
        * File data for older style savestream is logically
        * expressed as a linked list of file buckets.
        */
       struct bucketlist {
             bucket bl_bucket;
             bucketlist *bl_next;
       };

       /*
        * XDR description of the original savefile1 format.
        */
       struct savefile1 {
             u_long sf_magic;             /* magic number (must be NSR_MAGIC1) */
             u_long sf_chksumtype;        /* file checksum type */
             ssaverec sf_saverec;         /* wrapped file attributes */
             bucketlist *sf_data;         /* file data in buckets */
             checksum sf_checksum;        /* checksum value */
       };

       /*
        * New savestream defines and structures.
        */
       const NSR_MAGIC2 = 0x03175800;     /* newer bucketless format */

       const NSRAPP_BACKUP = 1;           /* backup application name space */
       const NSRAPP_HSM = 2;              /* HSM application name space */
       const NSRAPP_ARCHIVE = 3;          /* Archive application name space */

       struct saverec {
             sfid_t sr_id;                /* savefile id in the savestream */
             u_long sr_size;              /* size of encoded savefile */
             nulong_t sr_savetime;        /* savetime of this saveset */
             nulong_t sr_appid;           /* application id */
             nsrname sr_filename;         /* name of encoded file */
             fileid sr_fid;               /* client specific file id */
             asmrec *sr_ar;               /* ASM list for this file */



NetWorker rt_1998_4Q.Build.MMaJrFcehra0l8_,0021000                        2





NSR_DATA(5)                                           NSR_DATA(5)


             u_long sr_catype;            /* client specific attribute type */
             clientattr sr_cattr;         /* client specific file attributes */
       };

       /*
        * Defines for self describing data sections.
        * The NSR_ASDF_END type defines the end of the file data.
        * The NSR_ASDF_FILE_DATA_TYPE type has the file data preceded by an
        * nulong_t that is the relative offset from the last block into the file.
        */
       const NSR_ASDF_END = 0x0;                    /* end of ASDF data */
       const NSR_ASDF_FILE_DATA_TYPE = 0x100;       /* normal file data */

       /*
        * Describes a section of NetWorker "file data" when
        * using ASM Structured Data Format (ASDF) sections.
        */
       struct asdf_hdr {
             nulong_t typevers;           /* type of file data */
             nulong_t length;             /* section length */
       };

       /*
        * Pseudo XDR description of the newer savefile2 format.
        * The new savefile2 format uses the unwrapped saverec structure
        * and a "bucketless" file data format that is based on ASDF.
        * The data portion ends with a 0 sized section of type NSR_ASDF_END.
        */
       struct savefile2 {
             u_long sf_magic;             /* magic number (must be SF_MAGIC2) */
             u_long sf_chksumtype;        /* file checksum type */
             saverec sf_saverec;          /* new saverec structure */
             <asdf_hdr & data>            /* ASDF section sans buckets */
                 ...
             <asdf_hdr & data>            /* ASDF section sans buckets */
             <asdf_hdr.typevers = 0>      /* final ASDF section type = NSR_ASDF_END */
             <asdf_hdr.length = 0>        /* final ASDF section len = 0 */
             checksum sf_checksum;        /* checksum value */
       };




SSEEEE AALLSSOO
       mmmm__ddaattaa(5), nnssrr(8), nnssrrmmmmdd(8), nnssrrdd(8), rreeccoovveerr(8),
       ssaavvee(8), xxddrr(3n).
       RRFFCC 11001144 XXDDRR PPrroottooccooll SSppeecc..










NetWorker rt_1998_4Q.Build.MMaJrFcehra0l8_,0021000                        3


