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