loop.h
01: #ifndef _LINUX_LOOP_H
02: #define _LINUX_LOOP_H
03:
04:
05:
06:
07:
08:
09:
10:
11:
12:
13: #define LO_NAME_SIZE 64
14: #define LO_KEY_SIZE 32
15:
16:
17:
18:
19:
20: enum {
21: LO_FLAGS_READ_ONLY = 1,
22: LO_FLAGS_AUTOCLEAR = 4,
23: LO_FLAGS_PARTSCAN = 8,
24: };
25:
26: #include <asm/posix_types.h>
27: #include <linux/types.h>
28:
29:
30: struct loop_info {
31: int lo_number;
32: __kernel_old_dev_t lo_device;
33: unsigned long lo_inode;
34: __kernel_old_dev_t lo_rdevice;
35: int lo_offset;
36: int lo_encrypt_type;
37: int lo_encrypt_key_size;
38: int lo_flags;
39: char lo_name[LO_NAME_SIZE];
40: unsigned char lo_encrypt_key[LO_KEY_SIZE];
41: unsigned long lo_init[2];
42: char reserved[4];
43: };
44:
45: struct loop_info64 {
46: __u64 lo_device;
47: __u64 lo_inode;
48: __u64 lo_rdevice;
49: __u64 lo_offset;
50: __u64 lo_sizelimit;
51: __u32 lo_number;
52: __u32 lo_encrypt_type;
53: __u32 lo_encrypt_key_size;
54: __u32 lo_flags;
55: __u8 lo_file_name[LO_NAME_SIZE];
56: __u8 lo_crypt_name[LO_NAME_SIZE];
57: __u8 lo_encrypt_key[LO_KEY_SIZE];
58: __u64 lo_init[2];
59: };
60:
61:
62:
63:
64:
65: #define LO_CRYPT_NONE 0
66: #define LO_CRYPT_XOR 1
67: #define LO_CRYPT_DES 2
68: #define LO_CRYPT_FISH2 3
69: #define LO_CRYPT_BLOW 4
70: #define LO_CRYPT_CAST128 5
71: #define LO_CRYPT_IDEA 6
72: #define LO_CRYPT_DUMMY 9
73: #define LO_CRYPT_SKIPJACK 10
74: #define LO_CRYPT_CRYPTOAPI 18
75: #define MAX_LO_CRYPT 20
76:
77:
78:
79:
80:
81: #define LOOP_SET_FD 0x4C00
82: #define LOOP_CLR_FD 0x4C01
83: #define LOOP_SET_STATUS 0x4C02
84: #define LOOP_GET_STATUS 0x4C03
85: #define LOOP_SET_STATUS64 0x4C04
86: #define LOOP_GET_STATUS64 0x4C05
87: #define LOOP_CHANGE_FD 0x4C06
88: #define LOOP_SET_CAPACITY 0x4C07
89:
90:
91: #define LOOP_CTL_ADD 0x4C80
92: #define LOOP_CTL_REMOVE 0x4C81
93: #define LOOP_CTL_GET_FREE 0x4C82
94: #endif
95:
© Andrew Scott 2006 -
2025,
All Rights Reserved