00001
00002 #ifndef _LINUX_LOOP_H
00003 #define _LINUX_LOOP_H
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #define LO_NAME_SIZE 64
00015 #define LO_KEY_SIZE 32
00016
00017
00018
00019
00020
00021 enum {
00022 LO_FLAGS_READ_ONLY = 1,
00023 LO_FLAGS_USE_AOPS = 2,
00024 LO_FLAGS_AUTOCLEAR = 4,
00025 };
00026
00027 #include <linux/version.h>
00028 #include <asm/posix_types.h>
00029 #include <asm/types.h>
00030
00031 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
00032 #define __kernel_old_dev_t __kernel_dev_t
00033 #endif
00034
00035
00036 struct loop_info {
00037 int lo_number;
00038 __kernel_old_dev_t lo_device;
00039 unsigned long lo_inode;
00040 __kernel_old_dev_t lo_rdevice;
00041 int lo_offset;
00042 int lo_encrypt_type;
00043 int lo_encrypt_key_size;
00044 int lo_flags;
00045 char lo_name[LO_NAME_SIZE];
00046 unsigned char lo_encrypt_key[LO_KEY_SIZE];
00047 unsigned long lo_init[2];
00048 char reserved[4];
00049 };
00050
00051 struct loop_info64 {
00052 __u64 lo_device;
00053 __u64 lo_inode;
00054 __u64 lo_rdevice;
00055 __u64 lo_offset;
00056 __u64 lo_sizelimit;
00057 __u32 lo_number;
00058 __u32 lo_encrypt_type;
00059 __u32 lo_encrypt_key_size;
00060 __u32 lo_flags;
00061 __u8 lo_file_name[LO_NAME_SIZE];
00062 __u8 lo_crypt_name[LO_NAME_SIZE];
00063 __u8 lo_encrypt_key[LO_KEY_SIZE];
00064 __u64 lo_init[2];
00065 };
00066
00067
00068
00069
00070
00071 #define LO_CRYPT_NONE 0
00072 #define LO_CRYPT_XOR 1
00073 #define LO_CRYPT_DES 2
00074 #define LO_CRYPT_FISH2 3
00075 #define LO_CRYPT_BLOW 4
00076 #define LO_CRYPT_CAST128 5
00077 #define LO_CRYPT_IDEA 6
00078 #define LO_CRYPT_DUMMY 9
00079 #define LO_CRYPT_SKIPJACK 10
00080 #define LO_CRYPT_CRYPTOAPI 18
00081 #define MAX_LO_CRYPT 20
00082
00083
00084
00085
00086
00087 #define LOOP_SET_FD 0x4C00
00088 #define LOOP_CLR_FD 0x4C01
00089 #define LOOP_SET_STATUS 0x4C02
00090 #define LOOP_GET_STATUS 0x4C03
00091 #define LOOP_SET_STATUS64 0x4C04
00092 #define LOOP_GET_STATUS64 0x4C05
00093 #define LOOP_CHANGE_FD 0x4C06
00094
00095 #endif