home *** CD-ROM | disk | FTP | other *** search
/ Chip 1995 March / CHIP3.mdf / slackwar / a / util / util-lin.2 / util-lin / util-linux-2.2 / mount / loop.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-22  |  1.7 KB  |  78 lines

  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 Public License.
  11.  */
  12.  
  13. #define LO_NAME_SIZE    64
  14. #define LO_KEY_SIZE    32
  15.        
  16. struct loop_device {
  17.     int        lo_number;
  18.     struct inode    *lo_inode;
  19.     int        lo_refcnt;
  20.     dev_t        lo_device;
  21.     int        lo_offset;
  22.     int        lo_encrypt_type;
  23.     int        lo_encrypt_key_size;
  24.     int        lo_flags;
  25.     int        (*transfer)(struct loop_device *, int cmd,
  26.                     char *raw_buf, char *loop_buf, int size);
  27.     char        lo_name[LO_NAME_SIZE];
  28.     char        lo_encrypt_key[LO_KEY_SIZE];
  29. #ifdef DES_AVAILABLE
  30.     des_key_schedule lo_des_key;
  31.     unsigned long    lo_des_init[2];
  32. #endif
  33. };
  34.  
  35. typedef    int (* transfer_proc_t)(struct loop_device *, int cmd,
  36.                 char *raw_buf, char *loop_buf, int size);
  37.  
  38. /*
  39.  * Loop flags
  40.  */
  41. #define LO_FLAGS_DO_BMAP    0x00000001
  42.  
  43. struct loop_info {
  44.     int        lo_number;    /* ioctl r/o */
  45.     dev_t        lo_device;     /* ioctl r/o */
  46.     unsigned long    lo_inode;     /* ioctl r/o */
  47.     dev_t        lo_rdevice;     /* ioctl r/o */
  48.     int        lo_offset;
  49.     int        lo_encrypt_type;
  50.     int        lo_encrypt_key_size;     /* ioctl w/o */
  51.     int        lo_flags;    /* ioctl r/o */
  52.     char        lo_name[LO_NAME_SIZE];
  53.     unsigned char    lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
  54.     unsigned long    lo_init[2];
  55.     char        reserved[4];
  56. };
  57.  
  58. /*
  59.  * Loop encryption types --- LO_CRYPT_IDEA isn't supported yet
  60.  */
  61.  
  62. #define LO_CRYPT_NONE    0
  63. #define LO_CRYPT_XOR    1
  64. #define LO_CRYPT_DES    2
  65. #define LO_CRYPT_IDEA    4
  66. #define MAX_LO_CRYPT    3
  67.  
  68. /*
  69.  * IOCTL commands --- we will commandeer 0x4C ('L')
  70.  */
  71.  
  72. #define LOOP_SET_FD    0x4C00
  73. #define LOOP_CLR_FD    0x4C01
  74. #define LOOP_SET_STATUS    0x4C02
  75. #define LOOP_GET_STATUS    0x4C03
  76.  
  77. #endif
  78.