root / linux-user / linux_loop.h @ 0fead125
History | View | Annotate | Download (2.3 kB)
1 | d7e4036e | pbrook | /* Copied from 2.6.25 kernel headers to avoid problems on older hosts. */
|
---|---|---|---|
2 | d7e4036e | pbrook | #ifndef _LINUX_LOOP_H
|
3 | d7e4036e | pbrook | #define _LINUX_LOOP_H
|
4 | d7e4036e | pbrook | |
5 | d7e4036e | pbrook | /*
|
6 | d7e4036e | pbrook | * include/linux/loop.h
|
7 | d7e4036e | pbrook | *
|
8 | d7e4036e | pbrook | * Written by Theodore Ts'o, 3/29/93.
|
9 | d7e4036e | pbrook | *
|
10 | d7e4036e | pbrook | * Copyright 1993 by Theodore Ts'o. Redistribution of this file is
|
11 | d7e4036e | pbrook | * permitted under the GNU General Public License.
|
12 | d7e4036e | pbrook | */
|
13 | d7e4036e | pbrook | |
14 | d7e4036e | pbrook | #define LO_NAME_SIZE 64 |
15 | d7e4036e | pbrook | #define LO_KEY_SIZE 32 |
16 | d7e4036e | pbrook | |
17 | d7e4036e | pbrook | |
18 | d7e4036e | pbrook | /*
|
19 | d7e4036e | pbrook | * Loop flags
|
20 | d7e4036e | pbrook | */
|
21 | d7e4036e | pbrook | enum {
|
22 | d7e4036e | pbrook | LO_FLAGS_READ_ONLY = 1,
|
23 | d7e4036e | pbrook | LO_FLAGS_USE_AOPS = 2,
|
24 | d7e4036e | pbrook | LO_FLAGS_AUTOCLEAR = 4,
|
25 | d7e4036e | pbrook | }; |
26 | d7e4036e | pbrook | |
27 | d7e4036e | pbrook | #include <linux/version.h> |
28 | d7e4036e | pbrook | #include <asm/posix_types.h> /* for __kernel_old_dev_t */ |
29 | d7e4036e | pbrook | #include <asm/types.h> /* for __u64 */ |
30 | d7e4036e | pbrook | |
31 | d7e4036e | pbrook | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) /* This is a guess. */ |
32 | d7e4036e | pbrook | #define __kernel_old_dev_t __kernel_dev_t
|
33 | d7e4036e | pbrook | #endif
|
34 | d7e4036e | pbrook | |
35 | d7e4036e | pbrook | /* Backwards compatibility version */
|
36 | d7e4036e | pbrook | struct loop_info {
|
37 | d7e4036e | pbrook | int lo_number; /* ioctl r/o */ |
38 | d7e4036e | pbrook | __kernel_old_dev_t lo_device; /* ioctl r/o */
|
39 | d7e4036e | pbrook | unsigned long lo_inode; /* ioctl r/o */ |
40 | d7e4036e | pbrook | __kernel_old_dev_t lo_rdevice; /* ioctl r/o */
|
41 | d7e4036e | pbrook | int lo_offset;
|
42 | d7e4036e | pbrook | int lo_encrypt_type;
|
43 | d7e4036e | pbrook | int lo_encrypt_key_size; /* ioctl w/o */ |
44 | d7e4036e | pbrook | int lo_flags; /* ioctl r/o */ |
45 | d7e4036e | pbrook | char lo_name[LO_NAME_SIZE];
|
46 | d7e4036e | pbrook | unsigned char lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */ |
47 | d7e4036e | pbrook | unsigned long lo_init[2]; |
48 | d7e4036e | pbrook | char reserved[4]; |
49 | d7e4036e | pbrook | }; |
50 | d7e4036e | pbrook | |
51 | d7e4036e | pbrook | struct loop_info64 {
|
52 | d7e4036e | pbrook | __u64 lo_device; /* ioctl r/o */
|
53 | d7e4036e | pbrook | __u64 lo_inode; /* ioctl r/o */
|
54 | d7e4036e | pbrook | __u64 lo_rdevice; /* ioctl r/o */
|
55 | d7e4036e | pbrook | __u64 lo_offset; |
56 | d7e4036e | pbrook | __u64 lo_sizelimit;/* bytes, 0 == max available */
|
57 | d7e4036e | pbrook | __u32 lo_number; /* ioctl r/o */
|
58 | d7e4036e | pbrook | __u32 lo_encrypt_type; |
59 | d7e4036e | pbrook | __u32 lo_encrypt_key_size; /* ioctl w/o */
|
60 | d7e4036e | pbrook | __u32 lo_flags; /* ioctl r/o */
|
61 | d7e4036e | pbrook | __u8 lo_file_name[LO_NAME_SIZE]; |
62 | d7e4036e | pbrook | __u8 lo_crypt_name[LO_NAME_SIZE]; |
63 | d7e4036e | pbrook | __u8 lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
|
64 | d7e4036e | pbrook | __u64 lo_init[2];
|
65 | d7e4036e | pbrook | }; |
66 | d7e4036e | pbrook | |
67 | d7e4036e | pbrook | /*
|
68 | d7e4036e | pbrook | * Loop filter types
|
69 | d7e4036e | pbrook | */
|
70 | d7e4036e | pbrook | |
71 | d7e4036e | pbrook | #define LO_CRYPT_NONE 0 |
72 | d7e4036e | pbrook | #define LO_CRYPT_XOR 1 |
73 | d7e4036e | pbrook | #define LO_CRYPT_DES 2 |
74 | d7e4036e | pbrook | #define LO_CRYPT_FISH2 3 /* Twofish encryption */ |
75 | d7e4036e | pbrook | #define LO_CRYPT_BLOW 4 |
76 | d7e4036e | pbrook | #define LO_CRYPT_CAST128 5 |
77 | d7e4036e | pbrook | #define LO_CRYPT_IDEA 6 |
78 | d7e4036e | pbrook | #define LO_CRYPT_DUMMY 9 |
79 | d7e4036e | pbrook | #define LO_CRYPT_SKIPJACK 10 |
80 | d7e4036e | pbrook | #define LO_CRYPT_CRYPTOAPI 18 |
81 | d7e4036e | pbrook | #define MAX_LO_CRYPT 20 |
82 | d7e4036e | pbrook | |
83 | d7e4036e | pbrook | /*
|
84 | d7e4036e | pbrook | * IOCTL commands --- we will commandeer 0x4C ('L')
|
85 | d7e4036e | pbrook | */
|
86 | d7e4036e | pbrook | |
87 | d7e4036e | pbrook | #define LOOP_SET_FD 0x4C00 |
88 | d7e4036e | pbrook | #define LOOP_CLR_FD 0x4C01 |
89 | d7e4036e | pbrook | #define LOOP_SET_STATUS 0x4C02 |
90 | d7e4036e | pbrook | #define LOOP_GET_STATUS 0x4C03 |
91 | d7e4036e | pbrook | #define LOOP_SET_STATUS64 0x4C04 |
92 | d7e4036e | pbrook | #define LOOP_GET_STATUS64 0x4C05 |
93 | d7e4036e | pbrook | #define LOOP_CHANGE_FD 0x4C06 |
94 | d7e4036e | pbrook | |
95 | d7e4036e | pbrook | #endif |