Home | History | Annotate | Download | only in gpxe
      1 #ifndef _GPXE_CPIO_H
      2 #define _GPXE_CPIO_H
      3 
      4 /** @file
      5  *
      6  * CPIO archives
      7  *
      8  */
      9 
     10 FILE_LICENCE ( GPL2_OR_LATER );
     11 
     12 /** A CPIO archive header
     13  *
     14  * All field are hexadecimal ASCII numbers padded with '0' on the
     15  * left to the full width of the field.
     16  */
     17 struct cpio_header {
     18 	/** The string "070701" or "070702" */
     19 	char c_magic[6];
     20 	/** File inode number */
     21 	char c_ino[8];
     22 	/** File mode and permissions */
     23 	char c_mode[8];
     24 	/** File uid */
     25 	char c_uid[8];
     26 	/** File gid */
     27 	char c_gid[8];
     28 	/** Number of links */
     29 	char c_nlink[8];
     30 	/** Modification time */
     31 	char c_mtime[8];
     32 	/** Size of data field */
     33 	char c_filesize[8];
     34 	/** Major part of file device number */
     35 	char c_maj[8];
     36 	/** Minor part of file device number */
     37 	char c_min[8];
     38 	/** Major part of device node reference */
     39 	char c_rmaj[8];
     40 	/** Minor part of device node reference */
     41 	char c_rmin[8];
     42 	/** Length of filename, including final NUL */
     43 	char c_namesize[8];
     44 	/** Checksum of data field if c_magic is 070702, othersize zero */
     45 	char c_chksum[8];
     46 } __attribute__ (( packed ));
     47 
     48 /** CPIO magic */
     49 #define CPIO_MAGIC "070701"
     50 
     51 extern void cpio_set_field ( char *field, unsigned long value );
     52 
     53 #endif /* _GPXE_CPIO_H */
     54