-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpod.h
More file actions
45 lines (39 loc) · 895 Bytes
/
pod.h
File metadata and controls
45 lines (39 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* MAGIC (5 chars)
* REVISION (short)
* BLOCKSIZE (long)
* FILE COUNT (long)
* TYPE (short)
* FILENAME (NULL terminated)
* OFFSET (long)
* LENGTH (long)
* DATA
*/
#ifndef _POD_H_
#define _POD_H_
#define PODMAGIC "PODar"
#define REV 5
#define DEFAULT_BLOCKSIZE 4096
#ifndef __KERNEL__
#include <arpa/inet.h>
#include <stdint.h>
#include <sys/types.h>
#endif
#define HEADER_SIZE 20
typedef struct _Pod_header {
char magic[6];
u_int16_t rev;
u_int32_t blocksize;
u_int32_t file_count;
u_int32_t filehdr_size;
} __attribute__ ((packed)) Pod_header;
#define FILEHDR_SIZE 16 /* not including name itself, but including name length*/
typedef struct _Ar_file {
u_int16_t type;
u_int32_t offset;
u_int32_t length;
u_int32_t blocks;
u_int16_t namelen;
char *filename; /* NOT NUL-terminated on disk, but it is in RAM */
} __attribute__ ((packed)) Ar_file;
#endif /* _POD_H_ */