1da2e3ebdSchin 2da2e3ebdSchin /* : : generated by proto : : */ 3da2e3ebdSchin /*********************************************************************** 4da2e3ebdSchin * * 5da2e3ebdSchin * This software is part of the ast package * 6*3e14f97fSRoger A. Faulkner * Copyright (c) 1985-2010 AT&T Intellectual Property * 7da2e3ebdSchin * and is licensed under the * 8da2e3ebdSchin * Common Public License, Version 1.0 * 97c2fbfb3SApril Chin * by AT&T Intellectual Property * 10da2e3ebdSchin * * 11da2e3ebdSchin * A copy of the License is available at * 12da2e3ebdSchin * http://www.opensource.org/licenses/cpl1.0.txt * 13da2e3ebdSchin * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * 14da2e3ebdSchin * * 15da2e3ebdSchin * Information and Software Systems Research * 16da2e3ebdSchin * AT&T Research * 17da2e3ebdSchin * Florham Park NJ * 18da2e3ebdSchin * * 19da2e3ebdSchin * Glenn Fowler <gsf@research.att.com> * 20da2e3ebdSchin * David Korn <dgk@research.att.com> * 21da2e3ebdSchin * Phong Vo <kpv@research.att.com> * 22da2e3ebdSchin * * 23da2e3ebdSchin ***********************************************************************/ 24da2e3ebdSchin 25da2e3ebdSchin /* 26da2e3ebdSchin * Standard Archive Format 27da2e3ebdSchin * USTAR - Uniform Standard Tape ARchive 28da2e3ebdSchin */ 29da2e3ebdSchin 30da2e3ebdSchin #ifndef _TAR_H 31da2e3ebdSchin #if !defined(__PROTO__) 32da2e3ebdSchin #include <prototyped.h> 33da2e3ebdSchin #endif 34da2e3ebdSchin #if !defined(__LINKAGE__) 35da2e3ebdSchin #define __LINKAGE__ /* 2004-08-11 transition */ 36da2e3ebdSchin #endif 37da2e3ebdSchin 38da2e3ebdSchin #define _TAR_H 39da2e3ebdSchin 40da2e3ebdSchin #define TBLOCK 512 41da2e3ebdSchin #define NAMSIZ 100 42da2e3ebdSchin #define PFXSIZ 155 43da2e3ebdSchin 44da2e3ebdSchin #define TMODLEN 8 45da2e3ebdSchin #define TUIDLEN 8 46da2e3ebdSchin #define TGIDLEN 8 47da2e3ebdSchin #define TSIZLEN 12 48da2e3ebdSchin #define TMTMLEN 12 49da2e3ebdSchin #define TCKSLEN 8 50da2e3ebdSchin 51da2e3ebdSchin #define TMAGIC "ustar" /* ustar and a null */ 52da2e3ebdSchin #define TMAGLEN 6 53da2e3ebdSchin #define TVERSION "00" /* 00 and no null */ 54da2e3ebdSchin #define TVERSLEN 2 55da2e3ebdSchin #define TUNMLEN 32 56da2e3ebdSchin #define TGNMLEN 32 57da2e3ebdSchin #define TDEVLEN 8 58da2e3ebdSchin 59da2e3ebdSchin /* 60da2e3ebdSchin * values used in typeflag field 61da2e3ebdSchin */ 62da2e3ebdSchin 63da2e3ebdSchin #define REGTYPE '0' /* regular file */ 64da2e3ebdSchin #define AREGTYPE 0 /* alternate REGTYPE */ 65da2e3ebdSchin #define LNKTYPE '1' /* hard link */ 66da2e3ebdSchin #define SYMTYPE '2' /* soft link */ 67da2e3ebdSchin #define CHRTYPE '3' /* character special */ 68da2e3ebdSchin #define BLKTYPE '4' /* block special */ 69da2e3ebdSchin #define DIRTYPE '5' /* directory */ 70da2e3ebdSchin #define FIFOTYPE '6' /* FIFO special */ 71da2e3ebdSchin #define CONTTYPE '7' /* reserved */ 72da2e3ebdSchin #define SOKTYPE '8' /* socket */ 73da2e3ebdSchin #define EXTTYPE 'x' /* extended header */ 74da2e3ebdSchin #define GLBTYPE 'g' /* global extended header */ 75da2e3ebdSchin #define LLNKTYPE 'K' /* long link path */ 76da2e3ebdSchin #define LREGTYPE 'L' /* long file path */ 77da2e3ebdSchin #define VERTYPE 'V' /* version */ 78da2e3ebdSchin 79da2e3ebdSchin /* 80da2e3ebdSchin * bits used in mode field 81da2e3ebdSchin */ 82da2e3ebdSchin 83da2e3ebdSchin #define TSUID 04000 /* set uid on exec */ 84da2e3ebdSchin #define TSGID 02000 /* set gid on exec */ 85da2e3ebdSchin #define TSVTX 01000 /* sticky bit -- reserved */ 86da2e3ebdSchin 87da2e3ebdSchin /* 88da2e3ebdSchin * file permissions 89da2e3ebdSchin */ 90da2e3ebdSchin 91da2e3ebdSchin #define TUREAD 00400 /* read by owner */ 92da2e3ebdSchin #define TUWRITE 00200 /* write by owner */ 93da2e3ebdSchin #define TUEXEC 00100 /* execute by owner */ 94da2e3ebdSchin #define TGREAD 00040 /* read by group */ 95da2e3ebdSchin #define TGWRITE 00020 /* execute by group */ 96da2e3ebdSchin #define TGEXEC 00010 /* write by group */ 97da2e3ebdSchin #define TOREAD 00004 /* read by other */ 98da2e3ebdSchin #define TOWRITE 00002 /* write by other */ 99da2e3ebdSchin #define TOEXEC 00001 /* execute by other */ 100da2e3ebdSchin 101da2e3ebdSchin struct header 102da2e3ebdSchin { 103da2e3ebdSchin char name[NAMSIZ]; 104da2e3ebdSchin char mode[TMODLEN]; 105da2e3ebdSchin char uid[TUIDLEN]; 106da2e3ebdSchin char gid[TGIDLEN]; 107da2e3ebdSchin char size[TSIZLEN]; 108da2e3ebdSchin char mtime[TMTMLEN]; 109da2e3ebdSchin char chksum[TCKSLEN]; 110da2e3ebdSchin char typeflag; 111da2e3ebdSchin char linkname[NAMSIZ]; 112da2e3ebdSchin char magic[TMAGLEN]; 113da2e3ebdSchin char version[TVERSLEN]; 114da2e3ebdSchin char uname[TUNMLEN]; 115da2e3ebdSchin char gname[TGNMLEN]; 116da2e3ebdSchin char devmajor[TDEVLEN]; 117da2e3ebdSchin char devminor[TDEVLEN]; 118da2e3ebdSchin char prefix[PFXSIZ]; 119da2e3ebdSchin }; 120da2e3ebdSchin 121da2e3ebdSchin union hblock 122da2e3ebdSchin { 123da2e3ebdSchin char dummy[TBLOCK]; 124da2e3ebdSchin struct header dbuf; 125da2e3ebdSchin }; 126da2e3ebdSchin 127da2e3ebdSchin #endif 128