initial check-in, version 0.5.0
[musl] / include / linux / loop.h
1 #ifndef _LINUX_LOOP_H
2 #define _LINUX_LOOP_H
3
4 #include <stdint.h>
5
6 #define LO_NAME_SIZE    64
7 #define LO_KEY_SIZE     32
8
9 enum {
10         LO_FLAGS_READ_ONLY      = 1,
11         LO_FLAGS_USE_AOPS       = 2,
12         LO_FLAGS_AUTOCLEAR      = 4,
13 };
14
15 struct loop_info {
16         int                lo_number;
17         long               lo_device;
18         unsigned long      lo_inode;
19         long               lo_rdevice;
20         int                lo_offset;
21         int                lo_encrypt_type;
22         int                lo_encrypt_key_size;
23         int                lo_flags;
24         char               lo_name[LO_NAME_SIZE];
25         unsigned char      lo_encrypt_key[LO_KEY_SIZE];
26         unsigned long      lo_init[2];
27         char               reserved[4];
28 };
29
30 struct loop_info64 {
31         uint64_t           lo_device;
32         uint64_t           lo_inode;
33         uint64_t           lo_rdevice;
34         uint64_t           lo_offset;
35         uint64_t           lo_sizelimit;
36         uint32_t           lo_number;
37         uint32_t           lo_encrypt_type;
38         uint32_t           lo_encrypt_key_size;
39         uint32_t           lo_flags;
40         uint8_t            lo_file_name[LO_NAME_SIZE];
41         uint8_t            lo_crypt_name[LO_NAME_SIZE];
42         uint8_t            lo_encrypt_key[LO_KEY_SIZE];
43         uint64_t           lo_init[2];
44 };
45
46
47 #define LO_CRYPT_NONE           0
48 #define LO_CRYPT_XOR            1
49 #define LO_CRYPT_DES            2
50 #define LO_CRYPT_FISH2          3
51 #define LO_CRYPT_BLOW           4
52 #define LO_CRYPT_CAST128        5
53 #define LO_CRYPT_IDEA           6
54 #define LO_CRYPT_DUMMY          9
55 #define LO_CRYPT_SKIPJACK       10
56 #define LO_CRYPT_CRYPTOAPI      18
57 #define MAX_LO_CRYPT            20
58
59
60 #define LOOP_SET_FD             0x4C00
61 #define LOOP_CLR_FD             0x4C01
62 #define LOOP_SET_STATUS         0x4C02
63 #define LOOP_GET_STATUS         0x4C03
64 #define LOOP_SET_STATUS64       0x4C04
65 #define LOOP_GET_STATUS64       0x4C05
66 #define LOOP_CHANGE_FD          0x4C06
67 #define LOOP_SET_CAPACITY       0x4C07
68
69 #endif