1 #ifndef _LINUX_LOOP_H
2 #define _LINUX_LOOP_H
3
4
5
6
7
8
9
10
11
12
13 #define LO_NAME_SIZE 64
14 #define LO_KEY_SIZE 32
15
16 struct loop_device {
17 int lo_number;
18 struct inode *lo_inode;
19 int lo_refcnt;
20 kdev_t lo_device;
21 int lo_offset;
22 int lo_encrypt_type;
23 int lo_encrypt_key_size;
24 int lo_flags;
25 int (*transfer)(struct loop_device *, int cmd,
26 char *raw_buf, char *loop_buf, int size);
27 char lo_name[LO_NAME_SIZE];
28 char lo_encrypt_key[LO_KEY_SIZE];
29 #ifdef DES_AVAILABLE
30 des_key_schedule lo_des_key;
31 unsigned long lo_des_init[2];
32 #endif
33 };
34
35 typedef int (* transfer_proc_t)(struct loop_device *, int cmd,
36 char *raw_buf, char *loop_buf, int size);
37
38
39
40
41 #define LO_FLAGS_DO_BMAP 0x00000001
42
43 struct loop_info {
44 int lo_number;
45 dev_t lo_device;
46 unsigned long lo_inode;
47 dev_t lo_rdevice;
48 int lo_offset;
49 int lo_encrypt_type;
50 int lo_encrypt_key_size;
51 int lo_flags;
52 char lo_name[LO_NAME_SIZE];
53 unsigned char lo_encrypt_key[LO_KEY_SIZE];
54 unsigned long lo_init[2];
55 char reserved[4];
56 };
57
58
59
60
61
62 #define LO_CRYPT_NONE 0
63 #define LO_CRYPT_XOR 1
64 #define LO_CRYPT_DES 2
65 #define LO_CRYPT_IDEA 3
66 #define MAX_LO_CRYPT 4
67
68
69
70
71
72 #define LOOP_SET_FD 0x4C00
73 #define LOOP_CLR_FD 0x4C01
74 #define LOOP_SET_STATUS 0x4C02
75 #define LOOP_GET_STATUS 0x4C03
76
77 #endif