Annotation of ntddk/inc/mtf.h, revision 1.1

1.1     ! root        1: /**
        !             2: Copyright(c) Maynard Electronics, Inc. 1984-92
        !             3: 
        !             4: 
        !             5:      Name:          mtf.h
        !             6: 
        !             7:      Description:   Microsoft Tape Format v1.0 tape structure definitions
        !             8:                     and attribute bit definitions.
        !             9: 
        !            10: 
        !            11:      $Log:   T:/LOGFILES/MTF.H_V  $
        !            12: 
        !            13:    Rev 1.6   20 Jun 1993 16:19:56   GREGG
        !            14: Changed data encrypt bit def and replaced compr algor with vendor id in SSET.
        !            15: 
        !            16:    Rev 1.5   26 Apr 1993 11:45:48   GREGG
        !            17: Seventh in a series of incremental changes to bring the translator in line
        !            18: with the MTF spec:
        !            19: 
        !            20:      - Changed handling of EOM processing during non-OTC EOS processing.
        !            21: 
        !            22: Matches CHANNEL.H 1.17, MAYN40RD.C 1.60, TFWRITE.C 1.63, MTF.H 1.5,
        !            23:         TFLUTILS.C 1.44, MTF10WDB.C 1.10, MTF10WT.C 1.9
        !            24: 
        !            25:    Rev 1.4   22 Apr 1993 03:31:38   GREGG
        !            26: Third in a series of incremental changes to bring the translator in line
        !            27: with the MTF spec:
        !            28: 
        !            29:      - Removed all references to the DBLK element 'string_storage_offset',
        !            30:        which no longer exists.
        !            31:      - Check for incompatable versions of the Tape Format and OTC and deals
        !            32:        with them the best it can, or reports tape as foreign if they're too
        !            33:        far out.  Includes ignoring the OTC and not allowing append if the
        !            34:        OTC on tape is a future rev, different type, or on an alternate
        !            35:        partition.
        !            36:      - Updated OTC "location" attribute bits, and changed definition of
        !            37:        CFIL to store stream number instead of stream ID.
        !            38: 
        !            39: Matches: TFL_ERR.H 1.9, MTF10WDB.C 1.7, TRANSLAT.C 1.39, FMTINF.H 1.11,
        !            40:          OTC40RD.C 1.24, MAYN40RD.C 1.56, MTF10WT.C 1.7, OTC40MSC.C 1.20
        !            41:          DETFMT.C 1.13, MTF.H 1.4
        !            42: 
        !            43:    Rev 1.3   19 Apr 1993 18:02:30   GREGG
        !            44: Second in a series of incremental changes to bring the translator in line
        !            45: with the MTF spec:
        !            46: 
        !            47:      Changes to write version 2 of OTC, and to read both versions.
        !            48: 
        !            49: Matches: mayn40rd.c 1.55, otc40msc.c 1.19, otc40rd.c 1.23, otc40wt.c 1.23,
        !            50:          makevcb.c 1.15, fsys.h 1.32, fsys_str.h 1.46, tpos.h 1.16,
        !            51:          mayn40.h 1.32, mtf.h 1.3.
        !            52: 
        !            53: NOTE: There are additional changes to the catalogs needed to save the OTC
        !            54:       version and put it in the tpos structure before loading the OTC
        !            55:       File/Directory Detail.  These changes are NOT listed above!
        !            56: 
        !            57:    Rev 1.2   07 Dec 1992 10:20:26   GREGG
        !            58: Changes for tf ver moved to SSET, otc ver added to SSET and links added to FDD.
        !            59: 
        !            60:    Rev 1.1   24 Nov 1992 18:18:50   GREGG
        !            61: Updates to match MTF document.
        !            62: 
        !            63:    Rev 1.0   23 Nov 1992 14:25:14   GREGG
        !            64: Initial revision.
        !            65: 
        !            66: **/
        !            67: 
        !            68: #ifndef _MTF_H_
        !            69: #define _MTF_H_
        !            70: 
        !            71: /**/
        !            72: /*
        !            73:      MTF Constants
        !            74: */
        !            75: 
        !            76: #define FORMAT_VER_MAJOR      1
        !            77: #define FORMAT_VER_MINOR      0
        !            78: 
        !            79: #define TAPE_CATALOG_VER      2
        !            80: 
        !            81: #define PW_ENCRYPT_NONE       0
        !            82: #define DATA_ENCRYPT_NONE     0
        !            83: #define COMPRESS_NONE         0
        !            84: #define ECC_NONE              0
        !            85: 
        !            86: #define MTF10_OTC             1
        !            87: 
        !            88: #define LOCAL_TZ              127
        !            89: 
        !            90: 
        !            91: /*
        !            92:      MTF Block Types
        !            93: */
        !            94: 
        !            95: #define  MTF_TAPE_N     "TAPE"    /* Tape Header ID */
        !            96: #define  MTF_VOLB_N     "VOLB"    /* Volume Control Block ID */
        !            97: #define  MTF_SSET_N     "SSET"    /* Start of Backup Set Description Block ID */
        !            98: #define  MTF_ESET_N     "ESET"    /* End of Backup Set Description Block ID */
        !            99: #define  MTF_EOTM_N     "EOTM"    /* End of tape, continuation Block ID */
        !           100: #define  MTF_DIRB_N     "DIRB"    /* Directory Descriptor Block ID */
        !           101: #define  MTF_FILE_N     "FILE"    /* File Descriptor Block ID */
        !           102: #define  MTF_CFIL_N     "CFIL"    /* Corrupt File Descriptor Block ID */
        !           103: #define  MTF_ESPB_N     "ESPB"    /* End of Set Pad Block */
        !           104: #define  MTF_SSES_N     "SSES"
        !           105: #define  MTF_ESES_N     "ESES"
        !           106: 
        !           107: 
        !           108: /*
        !           109:      DBLK Block Attributes
        !           110: 
        !           111:      The lower 16 bits are reserved for general attribute bits (those
        !           112:      which may appear in more than one type of DBLK), the upper 16 are
        !           113:      for attributes which are specific to one type of DBLK.
        !           114: 
        !           115:      Note that the block specific bit definitions overlap, and the block
        !           116:      type is used to determine the meaning of a given bit.
        !           117: */
        !           118: 
        !           119: /* General : */
        !           120: #define MTF_DB_CONT_BIT                 0x00000001UL
        !           121: #define MTF_DB_COMPRESS_BIT             0x00000004UL
        !           122: #define MTF_DB_EOS_AT_EOM_BIT           0x00000008UL
        !           123: #define MTF_DB_VAR_BLKS_BIT             0x00000010UL
        !           124: #define MTF_DB_SESSION_BIT              0x00000020UL
        !           125: 
        !           126: /* THDR : */
        !           127: #define MTF_DB_SM_EXISTS                0x00010000UL
        !           128: #define MTF_DB_FDD_ALLOWED              0x00020000UL
        !           129: #define MTF_DB_SM_ALT_OVERWRITE         0x00040000UL
        !           130: #define MTF_DB_FDD_ALT_PART             0x00080000UL
        !           131: #define MTF_DB_SM_ALT_APPEND            0x00200000UL
        !           132: 
        !           133: /* SSET : */
        !           134: #define MTF_DB_FDD_EXISTS               0x00010000UL
        !           135: #define MTF_DB_ENCRYPT_BIT              0x00020000UL
        !           136: 
        !           137: /* ESET : */
        !           138: #define MTF_DB_FDD_ABORTED_BIT          0x00010000UL
        !           139: #define MTF_DB_END_OF_FAMILY_BIT        0x00020000UL
        !           140: #define MTF_DB_ABORTED_SET_BIT          0x00040000UL
        !           141: #define MTF_DB_SET_VERIFIED_BIT         0x00080000UL
        !           142: 
        !           143: /* EOTM : */
        !           144: #define MTF_DB_NO_ESET_PBA              0x00010000UL
        !           145: #define MTF_DB_INVALID_ESET_PBA         0x00020000UL
        !           146: 
        !           147: 
        !           148: /* Turn on packing here.  Need to be sure that date is packed. */
        !           149: #pragma pack(1)
        !           150: 
        !           151: /**/
        !           152: /*
        !           153:      Compressed date structure for storing dates in minimal space on tape:
        !           154: 
        !           155:      BYTE 0    BYTE 1    BYTE 2    BYTE 3    BYTE 4
        !           156:     76543210  76543210  76543210  76543210  76543210
        !           157:     yyyyyyyy  yyyyyymm  mmdddddh  hhhhmmmm  mmssssss
        !           158: */
        !           159: typedef struct {
        !           160:      UINT8     dt_field[5] ;
        !           161: } MTF_DATE_TIME, * MTF_DATE_TIME_PTR ;
        !           162: 
        !           163: 
        !           164: /**/
        !           165: /*
        !           166:      Tape Address
        !           167: */
        !           168: typedef struct {
        !           169:      UINT16 data_size;        /* Size of the data */
        !           170:      UINT16 data_offset;      /* Offset to the data */
        !           171: } MTF_TAPE_ADDRESS, * MTF_TAPE_ADDRESS_PTR;
        !           172: 
        !           173: 
        !           174: /**/
        !           175: /*
        !           176:      Stream Header
        !           177: */
        !           178: typedef struct {
        !           179:    UINT32 id ;           /* Identifier for stream      */
        !           180:    UINT16 fs_attribs ;   /* FileSystem Attribute       */
        !           181:    UINT16 tf_attribs ;   /* TapeFormat Attributes      */
        !           182:    UINT64 data_length ;  /* Offset to stream           */
        !           183:    UINT16 encr_algor ;   /* Data encryption algorithm  */
        !           184:    UINT16 comp_algor ;   /* Data compression algorithm */
        !           185:    UINT16 chksum ;       /* Checksum                   */
        !           186: } MTF_STREAM, * MTF_STREAM_PTR ;
        !           187: 
        !           188: 
        !           189: /**/
        !           190: /*
        !           191:      Common DBLK Header
        !           192: */
        !           193: typedef struct {
        !           194:      UINT8  block_type[4] ;         /* Unique identifier, see above */
        !           195:      UINT32 block_attribs ;         /* Common attributes for this block */
        !           196:      UINT16 offset_to_data ;        /* Offset to data associated with this
        !           197:                                        DBLK, or offset to next DBLK or
        !           198:                                        filemark if there is no associated
        !           199:                                        data.
        !           200:                                     */
        !           201:      UINT8  machine_os_id    ;      /* Machine/OS id where written, low byte */
        !           202:      UINT8  machine_os_version ;    /* Machine/OS id where written, high byte */
        !           203:      UINT64 displayable_size ;      /* Displayable data size */
        !           204:      UINT64 logical_block_address ; /* Logical blk address relative to SSET */
        !           205:      UINT64 session_id ;            /* For interleaved streams */
        !           206:      UINT32 control_block_id ;      /* Used for error recovery */
        !           207: 
        !           208:      UINT8  reserved[4] ;           /* Was offset to string storage */
        !           209:      MTF_TAPE_ADDRESS os_specific_data ;      /* Size and offset of OS specific stuff */
        !           210:      UINT8  string_type ;           /* ASCII, Unicode, etc. */
        !           211:      UINT8  pad ;                   /* For alignment purposes */
        !           212:      UINT16 hdr_chksm ;             /* Checksum of the block header.  The
        !           213:                                        algorithm is: XOR each word preceeding
        !           214:                                        this one and store the result here.
        !           215:                                        (When the checksum is verified the
        !           216:                                        'block_type' is also checked for a
        !           217:                                        non-zero value.
        !           218:                                     */
        !           219: } MTF_DB_HDR, * MTF_DB_HDR_PTR ;
        !           220: 
        !           221: 
        !           222: /**/
        !           223: /*
        !           224:      Tape Header DBLK (TAPE)
        !           225: */
        !           226: typedef struct {
        !           227:      MTF_DB_HDR          block_header;
        !           228:      UINT32              tape_id_number ;
        !           229:      UINT32              tape_attributes ;
        !           230:      UINT16              tape_seq_number ;
        !           231:      UINT16              password_encryption_algor;
        !           232:      UINT16              ecc_algorithm ;
        !           233:      UINT16              tape_catalog_type ;
        !           234:      MTF_TAPE_ADDRESS    tape_name ;
        !           235:      MTF_TAPE_ADDRESS    tape_description ;
        !           236:      MTF_TAPE_ADDRESS    tape_password ;
        !           237:      MTF_TAPE_ADDRESS    software_name ;
        !           238:      UINT16              logical_block_size ;
        !           239:      UINT16              software_vendor_id ;
        !           240:      MTF_DATE_TIME       tape_date ;
        !           241:      UINT8               tf_major_ver ;
        !           242: } MTF_TAPE, * MTF_TAPE_PTR;
        !           243: 
        !           244: 
        !           245: /**/
        !           246: /*
        !           247:      Start of Set DBLK (SSET)
        !           248: */
        !           249: typedef struct {
        !           250:      MTF_DB_HDR          block_hdr ;
        !           251:      UINT32              sset_attribs ;
        !           252:      UINT16              password_encryption_algor ;
        !           253:      UINT16              data_encryption_algor ;
        !           254:      UINT16              software_vendor_id ;
        !           255:      UINT16              backup_set_number ;
        !           256:      MTF_TAPE_ADDRESS    backup_set_name ;
        !           257:      MTF_TAPE_ADDRESS    backup_set_description ;
        !           258:      MTF_TAPE_ADDRESS    backup_set_password ;
        !           259:      MTF_TAPE_ADDRESS    user_name ;
        !           260:      UINT64              physical_block_address ;
        !           261:      MTF_DATE_TIME       backup_date ;
        !           262:      UINT8               software_ver_mjr ;
        !           263:      UINT8               software_ver_mnr ;
        !           264:      INT8                time_zone ;
        !           265:      UINT8               tf_minor_ver ;
        !           266:      UINT8               tape_cat_ver ;
        !           267: } MTF_SSET, * MTF_SSET_PTR ;
        !           268: 
        !           269: 
        !           270: /**/
        !           271: /*
        !           272:      Volume DBLK (VOLB)
        !           273: */
        !           274: typedef struct {
        !           275:      MTF_DB_HDR          block_hdr ;
        !           276:      UINT32              volume_attribs ;
        !           277:      MTF_TAPE_ADDRESS    device_name ;
        !           278:      MTF_TAPE_ADDRESS    volume_name ;
        !           279:      MTF_TAPE_ADDRESS    machine_name ;
        !           280:      MTF_DATE_TIME       backup_date ;
        !           281: } MTF_VOL, * MTF_VOL_PTR ;
        !           282: 
        !           283: 
        !           284: /**/
        !           285: /*
        !           286:      Directory DBLK (DIRB)
        !           287: */
        !           288: typedef struct {
        !           289:      MTF_DB_HDR          block_hdr ;
        !           290:      UINT32              directory_attribs ;
        !           291:      MTF_DATE_TIME       last_mod_date ;
        !           292:      MTF_DATE_TIME       create_date ;
        !           293:      MTF_DATE_TIME       backup_date ;
        !           294:      MTF_DATE_TIME       last_access_date ;
        !           295:      UINT32              directory_id ;
        !           296:      MTF_TAPE_ADDRESS    directory_name ;
        !           297: } MTF_DIR, * MTF_DIR_PTR ;
        !           298: 
        !           299: 
        !           300: /**/
        !           301: /*
        !           302:      File DBLK (FILE)
        !           303: */
        !           304: typedef struct {
        !           305:      MTF_DB_HDR          block_hdr ;
        !           306:      UINT32              file_attributes ;
        !           307:      MTF_DATE_TIME       last_mod_date ;
        !           308:      MTF_DATE_TIME       create_date ;
        !           309:      MTF_DATE_TIME       backup_date ;
        !           310:      MTF_DATE_TIME       last_access_date ;
        !           311:      UINT32              directory_id ;
        !           312:      UINT32              file_id ;
        !           313:      MTF_TAPE_ADDRESS    file_name ;
        !           314: } MTF_FILE, * MTF_FILE_PTR ;
        !           315: 
        !           316: 
        !           317: /**/
        !           318: /*
        !           319:      Corrupt File DBLK (CFIL)
        !           320: */
        !           321: typedef struct {
        !           322:      MTF_DB_HDR     block_hdr ;
        !           323:      UINT32         corrupt_file_attribs ;
        !           324:      UINT32         file_id ;
        !           325:      UINT32         directory_id ;
        !           326:      UINT64         stream_offset ;
        !           327:      UINT16         corrupt_stream_number ;
        !           328: } MTF_CFIL, * MTF_CFIL_PTR ;
        !           329: 
        !           330: 
        !           331: /**/
        !           332: /*
        !           333:      Start of Set DBLK (ESET)
        !           334: */
        !           335: typedef struct {
        !           336:      MTF_DB_HDR     block_hdr ;
        !           337:      UINT32         eset_attribs ;
        !           338:      UINT32         corrupt_file_count ;
        !           339:      UINT64         set_map_phys_blk_adr ;
        !           340:      UINT64         fdd_phys_blk_adr ;
        !           341:      UINT16         fdd_tape_seq_number ;
        !           342:      UINT16         backup_set_number ;
        !           343:      MTF_DATE_TIME  backup_date ;
        !           344: } MTF_ESET, * MTF_ESET_PTR ;
        !           345: 
        !           346: 
        !           347: /**/
        !           348: /*
        !           349:      End of Tape DBLK (EOTM)
        !           350: */
        !           351: typedef struct {
        !           352:      MTF_DB_HDR     block_hdr;
        !           353:      UINT64         eset_phys_blk_adr ;
        !           354: } MTF_EOTM, * MTF_EOTM_PTR;
        !           355: 
        !           356: 
        !           357: /**/
        !           358: /*
        !           359:      End of Set Pad DBLK (ESPB)
        !           360: */
        !           361: typedef struct {
        !           362:      MTF_DB_HDR    block_hdr ;
        !           363: } MTF_ESPB, * MTF_ESPB_PTR ;
        !           364: 
        !           365: 
        !           366: 
        !           367: /***************************************************************************\
        !           368: 
        !           369:                     MTF On Tape Catalog Structures
        !           370: 
        !           371: \***************************************************************************/
        !           372: 
        !           373: /**/
        !           374: /*
        !           375:      Set Map Header
        !           376: */
        !           377: typedef struct {
        !           378:      UINT32    family_id ;
        !           379:      UINT16    num_set_recs ;
        !           380:      UINT8     pad[2] ;
        !           381: } MTF_SM_HDR, * MTF_SM_HDR_PTR ;
        !           382: 
        !           383: 
        !           384: /**/
        !           385: /*
        !           386:      Set Map Entry
        !           387: */
        !           388: typedef struct {
        !           389:      UINT16              length ;
        !           390:      UINT16              seq_num ;
        !           391:      UINT32              blk_attribs ;
        !           392:      UINT32              set_attribs ;
        !           393:      UINT64              sset_pba ;
        !           394:      UINT64              fdd_pba ;
        !           395:      UINT16              fdd_seq_num ;
        !           396:      UINT16              set_num ;
        !           397:      UINT64              lba ;
        !           398:      UINT32              num_dirs ;
        !           399:      UINT32              num_files ;
        !           400:      UINT32              num_corrupt_files ;
        !           401:      UINT64              disp_size ;
        !           402:      UINT16              num_volumes ;
        !           403:      UINT16              pswd_encr_algor ;
        !           404:      MTF_TAPE_ADDRESS    set_name ;
        !           405:      MTF_TAPE_ADDRESS    password ;
        !           406:      MTF_TAPE_ADDRESS    set_descr ;
        !           407:      MTF_TAPE_ADDRESS    user_name ;
        !           408:      MTF_DATE_TIME       backup_date ;
        !           409:      INT8                time_zone ;
        !           410:      UINT8               os_id ;
        !           411:      UINT8               os_ver ;
        !           412:      UINT8               string_type ;
        !           413:      UINT8               tf_minor_ver ;
        !           414:      UINT8               tape_cat_ver ;
        !           415: } MTF_SM_ENTRY, * MTF_SM_ENTRY_PTR ;
        !           416: 
        !           417: 
        !           418: /**/
        !           419: /*
        !           420:      File / Directory Detail Common Header
        !           421: */
        !           422: typedef struct {
        !           423:      UINT16    length ;
        !           424:      UINT8     type[4] ;
        !           425:      UINT16    seq_num ;
        !           426:      UINT32    blk_attribs ;
        !           427:      UINT64    lba ;
        !           428:      UINT64    disp_size ;
        !           429:      INT32     link ;
        !           430:      UINT8     os_id ;
        !           431:      UINT8     os_ver ;
        !           432:      UINT8     string_type ;
        !           433:      UINT8     pad ;
        !           434: } MTF_FDD_HDR, * MTF_FDD_HDR_PTR ;
        !           435: 
        !           436: 
        !           437: /**/
        !           438: /*
        !           439:      File / Directory Detail and Set Map Volume Entry
        !           440: */
        !           441: typedef struct {
        !           442:      UINT32              vol_attribs ;
        !           443:      MTF_TAPE_ADDRESS    device_name ;
        !           444:      MTF_TAPE_ADDRESS    vol_name ;
        !           445:      MTF_TAPE_ADDRESS    machine_name ;
        !           446:      MTF_DATE_TIME       backup_date ;
        !           447: } MTF_FDD_VOL_V1, * MTF_FDD_VOL_V1_PTR ;
        !           448: 
        !           449: typedef struct {
        !           450:      UINT32              vol_attribs ;
        !           451:      MTF_TAPE_ADDRESS    device_name ;
        !           452:      MTF_TAPE_ADDRESS    vol_name ;
        !           453:      MTF_TAPE_ADDRESS    machine_name ;
        !           454:      MTF_TAPE_ADDRESS    os_info ;
        !           455:      MTF_DATE_TIME       backup_date ;
        !           456: } MTF_FDD_VOL_V2, * MTF_FDD_VOL_V2_PTR ;
        !           457: 
        !           458: 
        !           459: /**/
        !           460: /*
        !           461:      File / Directory Detail Directory Entry
        !           462: */
        !           463: typedef struct {
        !           464:      MTF_DATE_TIME       last_mod_date ;
        !           465:      MTF_DATE_TIME       create_date ;
        !           466:      MTF_DATE_TIME       backup_date ;
        !           467:      MTF_DATE_TIME       last_access_date ;
        !           468:      UINT32              dir_attribs ;
        !           469:      MTF_TAPE_ADDRESS    dir_name ;
        !           470: } MTF_FDD_DIR_V1, * MTF_FDD_DIR_V1_PTR ;
        !           471: 
        !           472: typedef struct {
        !           473:      MTF_DATE_TIME       last_mod_date ;
        !           474:      MTF_DATE_TIME       create_date ;
        !           475:      MTF_DATE_TIME       backup_date ;
        !           476:      MTF_DATE_TIME       last_access_date ;
        !           477:      UINT32              dir_attribs ;
        !           478:      MTF_TAPE_ADDRESS    dir_name ;
        !           479:      MTF_TAPE_ADDRESS    os_info ;
        !           480: } MTF_FDD_DIR_V2, * MTF_FDD_DIR_V2_PTR ;
        !           481: 
        !           482: 
        !           483: /**/
        !           484: /*
        !           485:      File / Directory Detail File Entry
        !           486: */
        !           487: typedef struct {
        !           488:      MTF_DATE_TIME       last_mod_date ;
        !           489:      MTF_DATE_TIME       create_date ;
        !           490:      MTF_DATE_TIME       backup_date ;
        !           491:      MTF_DATE_TIME       last_access_date ;
        !           492:      UINT32              file_attribs ;
        !           493:      MTF_TAPE_ADDRESS    file_name ;
        !           494: } MTF_FDD_FILE_V1, * MTF_FDD_FILE_V1_PTR ;
        !           495: 
        !           496: typedef struct {
        !           497:      MTF_DATE_TIME       last_mod_date ;
        !           498:      MTF_DATE_TIME       create_date ;
        !           499:      MTF_DATE_TIME       backup_date ;
        !           500:      MTF_DATE_TIME       last_access_date ;
        !           501:      UINT32              file_attribs ;
        !           502:      MTF_TAPE_ADDRESS    file_name ;
        !           503:      MTF_TAPE_ADDRESS    os_info ;
        !           504: } MTF_FDD_FILE_V2, * MTF_FDD_FILE_V2_PTR ;
        !           505: 
        !           506: 
        !           507: /* Turn packing back to what was specified on command line, or default
        !           508:    packing.
        !           509: */
        !           510: #pragma pack()
        !           511: 
        !           512: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.