xref: /illumos-gate/usr/src/head/tar.h (revision b4203d757c7c247e39c94c09a94021a3a8121062)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
545916cd2Sjpk  * Common Development and Distribution License (the "License").
645916cd2Sjpk  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
2145916cd2Sjpk /*
2245916cd2Sjpk  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
2345916cd2Sjpk  * Use is subject to license terms.
2445916cd2Sjpk  */
257c478bd9Sstevel@tonic-gate /*	Copyright (c) 1988 AT&T	*/
267c478bd9Sstevel@tonic-gate /*	  All Rights Reserved	*/
277c478bd9Sstevel@tonic-gate 
287c478bd9Sstevel@tonic-gate #ifndef _TAR_H
297c478bd9Sstevel@tonic-gate #define	_TAR_H
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
327c478bd9Sstevel@tonic-gate extern "C" {
337c478bd9Sstevel@tonic-gate #endif
347c478bd9Sstevel@tonic-gate 
35*4d7b462cSaj #include <sys/feature_tests.h>
36*4d7b462cSaj 
377c478bd9Sstevel@tonic-gate #define	TMAGIC		"ustar"
387c478bd9Sstevel@tonic-gate #define	TMAGLEN		6
397c478bd9Sstevel@tonic-gate #define	TVERSION	"00"
407c478bd9Sstevel@tonic-gate #define	TVERSLEN	2
417c478bd9Sstevel@tonic-gate 
427c478bd9Sstevel@tonic-gate /*
437c478bd9Sstevel@tonic-gate  * Typeflag field definitions.
447c478bd9Sstevel@tonic-gate  */
457c478bd9Sstevel@tonic-gate 
467c478bd9Sstevel@tonic-gate #define	REGTYPE		'0'
477c478bd9Sstevel@tonic-gate #define	AREGTYPE	'\0'
487c478bd9Sstevel@tonic-gate #define	LNKTYPE		'1'
497c478bd9Sstevel@tonic-gate #define	SYMTYPE		'2'
507c478bd9Sstevel@tonic-gate #define	CHRTYPE		'3'
517c478bd9Sstevel@tonic-gate #define	BLKTYPE		'4'
527c478bd9Sstevel@tonic-gate #define	DIRTYPE		'5'
537c478bd9Sstevel@tonic-gate #define	FIFOTYPE	'6'
547c478bd9Sstevel@tonic-gate #define	CONTTYPE	'7'
557c478bd9Sstevel@tonic-gate 
567c478bd9Sstevel@tonic-gate /*
577c478bd9Sstevel@tonic-gate  * Mode fild bit definitions.
587c478bd9Sstevel@tonic-gate  */
597c478bd9Sstevel@tonic-gate 
607c478bd9Sstevel@tonic-gate #define	TSUID		04000
617c478bd9Sstevel@tonic-gate #define	TSGID		02000
627c478bd9Sstevel@tonic-gate #define	TSVTX		01000
637c478bd9Sstevel@tonic-gate #define	TUREAD		00400
647c478bd9Sstevel@tonic-gate #define	TUWRITE		00200
657c478bd9Sstevel@tonic-gate #define	TUEXEC		00100
667c478bd9Sstevel@tonic-gate #define	TGREAD		00040
677c478bd9Sstevel@tonic-gate #define	TGWRITE		00020
687c478bd9Sstevel@tonic-gate #define	TGEXEC		00010
697c478bd9Sstevel@tonic-gate #define	TOREAD		00004
707c478bd9Sstevel@tonic-gate #define	TOWRITE		00002
717c478bd9Sstevel@tonic-gate #define	TOEXEC		00001
727c478bd9Sstevel@tonic-gate 
73*4d7b462cSaj #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
7445916cd2Sjpk /*
7545916cd2Sjpk  *      Types used in ancillary files
7645916cd2Sjpk  */
7745916cd2Sjpk #define	ACL_HDR		'A'	/* Access Control List */
7845916cd2Sjpk #define	LBL_TYPE	'L'	/* Trusted Extensions file label */
7945916cd2Sjpk #define	DIR_TYPE	'D'	/* Trusted Extensions directory label */
8045916cd2Sjpk /*
8145916cd2Sjpk  * Attribute types used in Trusted Solaris ancillary files
8245916cd2Sjpk  * that are interpreted for backward compatibility
8345916cd2Sjpk  */
8445916cd2Sjpk #define	SLD_TYPE	'S'	/* single-level directory component */
8545916cd2Sjpk #define	PATH_TYPE	'P'	/* Path component */
8645916cd2Sjpk #define	MLD_TYPE	'M'	/* multi-level directory component */
8745916cd2Sjpk #define	FILE_TYPE	'F'	/* Have to handle files differently */
8845916cd2Sjpk #define	APRIV_TYPE	'P'	/* allowed privileges data type in file */
8945916cd2Sjpk #define	FPRIV_TYPE	'p'	/* forced privileges data type in file */
9045916cd2Sjpk #define	COMP_TYPE	'C'	/* path components, use for MLD */
9145916cd2Sjpk #define	ATTR_FLAG_TYPE	'F'	/* file attribute flag bytes data type */
9245916cd2Sjpk #define	LK_COMP_TYPE	'K'	/* link data path component */
93*4d7b462cSaj #endif
94*4d7b462cSaj 
957c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
967c478bd9Sstevel@tonic-gate }
977c478bd9Sstevel@tonic-gate #endif
987c478bd9Sstevel@tonic-gate 
997c478bd9Sstevel@tonic-gate #endif	/* _TAR_H */
100