• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This file is auto-generated. Modifications will be lost.
3  *
4  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5  * for more information.
6  */
7 #ifndef __LINUX_JFFS2_H__
8 #define __LINUX_JFFS2_H__
9 #include <linux/types.h>
10 #include <linux/magic.h>
11 #define JFFS2_OLD_MAGIC_BITMASK 0x1984
12 #define JFFS2_MAGIC_BITMASK 0x1985
13 #define KSAMTIB_CIGAM_2SFFJ 0x8519
14 #define JFFS2_EMPTY_BITMASK 0xffff
15 #define JFFS2_DIRTY_BITMASK 0x0000
16 #define JFFS2_SUM_MAGIC 0x02851885
17 #define JFFS2_MAX_NAME_LEN 254
18 #define JFFS2_MIN_DATA_LEN 128
19 #define JFFS2_COMPR_NONE 0x00
20 #define JFFS2_COMPR_ZERO 0x01
21 #define JFFS2_COMPR_RTIME 0x02
22 #define JFFS2_COMPR_RUBINMIPS 0x03
23 #define JFFS2_COMPR_COPY 0x04
24 #define JFFS2_COMPR_DYNRUBIN 0x05
25 #define JFFS2_COMPR_ZLIB 0x06
26 #define JFFS2_COMPR_LZO 0x07
27 #define JFFS2_COMPAT_MASK 0xc000
28 #define JFFS2_NODE_ACCURATE 0x2000
29 #define JFFS2_FEATURE_INCOMPAT 0xc000
30 #define JFFS2_FEATURE_ROCOMPAT 0x8000
31 #define JFFS2_FEATURE_RWCOMPAT_COPY 0x4000
32 #define JFFS2_FEATURE_RWCOMPAT_DELETE 0x0000
33 #define JFFS2_NODETYPE_DIRENT (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 1)
34 #define JFFS2_NODETYPE_INODE (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 2)
35 #define JFFS2_NODETYPE_CLEANMARKER (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
36 #define JFFS2_NODETYPE_PADDING (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 4)
37 #define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6)
38 #define JFFS2_NODETYPE_XATTR (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 8)
39 #define JFFS2_NODETYPE_XREF (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 9)
40 #define JFFS2_XPREFIX_USER 1
41 #define JFFS2_XPREFIX_SECURITY 2
42 #define JFFS2_XPREFIX_ACL_ACCESS 3
43 #define JFFS2_XPREFIX_ACL_DEFAULT 4
44 #define JFFS2_XPREFIX_TRUSTED 5
45 #define JFFS2_ACL_VERSION 0x0001
46 #define JFFS2_INO_FLAG_PREREAD 1
47 #define JFFS2_INO_FLAG_USERCOMPR 2
48 typedef struct {
49   __u32 v32;
50 } __attribute__((packed)) jint32_t;
51 typedef struct {
52   __u32 m;
53 } __attribute__((packed)) jmode_t;
54 typedef struct {
55   __u16 v16;
56 } __attribute__((packed)) jint16_t;
57 struct jffs2_unknown_node {
58   jint16_t magic;
59   jint16_t nodetype;
60   jint32_t totlen;
61   jint32_t hdr_crc;
62 };
63 struct jffs2_raw_dirent {
64   jint16_t magic;
65   jint16_t nodetype;
66   jint32_t totlen;
67   jint32_t hdr_crc;
68   jint32_t pino;
69   jint32_t version;
70   jint32_t ino;
71   jint32_t mctime;
72   __u8 nsize;
73   __u8 type;
74   __u8 unused[2];
75   jint32_t node_crc;
76   jint32_t name_crc;
77   __u8 name[];
78 };
79 struct jffs2_raw_inode {
80   jint16_t magic;
81   jint16_t nodetype;
82   jint32_t totlen;
83   jint32_t hdr_crc;
84   jint32_t ino;
85   jint32_t version;
86   jmode_t mode;
87   jint16_t uid;
88   jint16_t gid;
89   jint32_t isize;
90   jint32_t atime;
91   jint32_t mtime;
92   jint32_t ctime;
93   jint32_t offset;
94   jint32_t csize;
95   jint32_t dsize;
96   __u8 compr;
97   __u8 usercompr;
98   jint16_t flags;
99   jint32_t data_crc;
100   jint32_t node_crc;
101   __u8 data[];
102 };
103 struct jffs2_raw_xattr {
104   jint16_t magic;
105   jint16_t nodetype;
106   jint32_t totlen;
107   jint32_t hdr_crc;
108   jint32_t xid;
109   jint32_t version;
110   __u8 xprefix;
111   __u8 name_len;
112   jint16_t value_len;
113   jint32_t data_crc;
114   jint32_t node_crc;
115   __u8 data[];
116 } __attribute__((packed));
117 struct jffs2_raw_xref {
118   jint16_t magic;
119   jint16_t nodetype;
120   jint32_t totlen;
121   jint32_t hdr_crc;
122   jint32_t ino;
123   jint32_t xid;
124   jint32_t xseqno;
125   jint32_t node_crc;
126 } __attribute__((packed));
127 struct jffs2_raw_summary {
128   jint16_t magic;
129   jint16_t nodetype;
130   jint32_t totlen;
131   jint32_t hdr_crc;
132   jint32_t sum_num;
133   jint32_t cln_mkr;
134   jint32_t padded;
135   jint32_t sum_crc;
136   jint32_t node_crc;
137   jint32_t sum[];
138 };
139 union jffs2_node_union {
140   struct jffs2_raw_inode i;
141   struct jffs2_raw_dirent d;
142   struct jffs2_raw_xattr x;
143   struct jffs2_raw_xref r;
144   struct jffs2_raw_summary s;
145   struct jffs2_unknown_node u;
146 };
147 union jffs2_device_node {
148   jint16_t old_id;
149   jint32_t new_id;
150 };
151 #endif
152