rock.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. * These structs are used by the system-use-sharing protocol, in which the
  3. * Rock Ridge extensions are embedded. It is quite possible that other
  4. * extensions are present on the disk, and this is fine as long as they
  5. * all use SUSP
  6. */
  7. struct SU_SP_s {
  8. unsigned char magic[2];
  9. unsigned char skip;
  10. } __attribute__ ((packed));
  11. struct SU_CE_s {
  12. char extent[8];
  13. char offset[8];
  14. char size[8];
  15. };
  16. struct SU_ER_s {
  17. unsigned char len_id;
  18. unsigned char len_des;
  19. unsigned char len_src;
  20. unsigned char ext_ver;
  21. char data[0];
  22. } __attribute__ ((packed));
  23. struct RR_RR_s {
  24. char flags[1];
  25. } __attribute__ ((packed));
  26. struct RR_PX_s {
  27. char mode[8];
  28. char n_links[8];
  29. char uid[8];
  30. char gid[8];
  31. };
  32. struct RR_PN_s {
  33. char dev_high[8];
  34. char dev_low[8];
  35. };
  36. struct SL_component {
  37. unsigned char flags;
  38. unsigned char len;
  39. char text[0];
  40. } __attribute__ ((packed));
  41. struct RR_SL_s {
  42. unsigned char flags;
  43. struct SL_component link;
  44. } __attribute__ ((packed));
  45. struct RR_NM_s {
  46. unsigned char flags;
  47. char name[0];
  48. } __attribute__ ((packed));
  49. struct RR_CL_s {
  50. char location[8];
  51. };
  52. struct RR_PL_s {
  53. char location[8];
  54. };
  55. struct stamp {
  56. __u8 time[7]; /* actually 6 unsigned, 1 signed */
  57. } __attribute__ ((packed));
  58. struct RR_TF_s {
  59. char flags;
  60. struct stamp times[0]; /* Variable number of these beasts */
  61. } __attribute__ ((packed));
  62. /* Linux-specific extension for transparent decompression */
  63. struct RR_ZF_s {
  64. char algorithm[2];
  65. char parms[2];
  66. char real_size[8];
  67. };
  68. /*
  69. * These are the bits and their meanings for flags in the TF structure.
  70. */
  71. #define TF_CREATE 1
  72. #define TF_MODIFY 2
  73. #define TF_ACCESS 4
  74. #define TF_ATTRIBUTES 8
  75. #define TF_BACKUP 16
  76. #define TF_EXPIRATION 32
  77. #define TF_EFFECTIVE 64
  78. #define TF_LONG_FORM 128
  79. struct rock_ridge {
  80. char signature[2];
  81. unsigned char len;
  82. unsigned char version;
  83. union {
  84. struct SU_SP_s SP;
  85. struct SU_CE_s CE;
  86. struct SU_ER_s ER;
  87. struct RR_RR_s RR;
  88. struct RR_PX_s PX;
  89. struct RR_PN_s PN;
  90. struct RR_SL_s SL;
  91. struct RR_NM_s NM;
  92. struct RR_CL_s CL;
  93. struct RR_PL_s PL;
  94. struct RR_TF_s TF;
  95. struct RR_ZF_s ZF;
  96. } u;
  97. };
  98. #define RR_PX 1 /* POSIX attributes */
  99. #define RR_PN 2 /* POSIX devices */
  100. #define RR_SL 4 /* Symbolic link */
  101. #define RR_NM 8 /* Alternate Name */
  102. #define RR_CL 16 /* Child link */
  103. #define RR_PL 32 /* Parent link */
  104. #define RR_RE 64 /* Relocation directory */
  105. #define RR_TF 128 /* Timestamps */