ncp_fs.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /*
  2. * ncp_fs.h
  3. *
  4. * Copyright (C) 1995, 1996 by Volker Lendecke
  5. *
  6. */
  7. #ifndef _LINUX_NCP_FS_H
  8. #define _LINUX_NCP_FS_H
  9. #include <linux/fs.h>
  10. #include <linux/in.h>
  11. #include <linux/types.h>
  12. #include <linux/magic.h>
  13. #include <linux/ipx.h>
  14. #include <linux/ncp_no.h>
  15. /*
  16. * ioctl commands
  17. */
  18. struct ncp_ioctl_request {
  19. unsigned int function;
  20. unsigned int size;
  21. char __user *data;
  22. };
  23. struct ncp_fs_info {
  24. int version;
  25. struct sockaddr_ipx addr;
  26. __kernel_uid_t mounted_uid;
  27. int connection; /* Connection number the server assigned us */
  28. int buffer_size; /* The negotiated buffer size, to be
  29. used for read/write requests! */
  30. int volume_number;
  31. __le32 directory_id;
  32. };
  33. struct ncp_fs_info_v2 {
  34. int version;
  35. unsigned long mounted_uid;
  36. unsigned int connection;
  37. unsigned int buffer_size;
  38. unsigned int volume_number;
  39. __le32 directory_id;
  40. __u32 dummy1;
  41. __u32 dummy2;
  42. __u32 dummy3;
  43. };
  44. struct ncp_sign_init
  45. {
  46. char sign_root[8];
  47. char sign_last[16];
  48. };
  49. struct ncp_lock_ioctl
  50. {
  51. #define NCP_LOCK_LOG 0
  52. #define NCP_LOCK_SH 1
  53. #define NCP_LOCK_EX 2
  54. #define NCP_LOCK_CLEAR 256
  55. int cmd;
  56. int origin;
  57. unsigned int offset;
  58. unsigned int length;
  59. #define NCP_LOCK_DEFAULT_TIMEOUT 18
  60. #define NCP_LOCK_MAX_TIMEOUT 180
  61. int timeout;
  62. };
  63. struct ncp_setroot_ioctl
  64. {
  65. int volNumber;
  66. int namespace;
  67. __le32 dirEntNum;
  68. };
  69. struct ncp_objectname_ioctl
  70. {
  71. #define NCP_AUTH_NONE 0x00
  72. #define NCP_AUTH_BIND 0x31
  73. #define NCP_AUTH_NDS 0x32
  74. int auth_type;
  75. size_t object_name_len;
  76. void __user * object_name; /* a userspace data, in most cases user name */
  77. };
  78. struct ncp_privatedata_ioctl
  79. {
  80. size_t len;
  81. void __user * data; /* ~1000 for NDS */
  82. };
  83. /* NLS charsets by ioctl */
  84. #define NCP_IOCSNAME_LEN 20
  85. struct ncp_nls_ioctl
  86. {
  87. unsigned char codepage[NCP_IOCSNAME_LEN+1];
  88. unsigned char iocharset[NCP_IOCSNAME_LEN+1];
  89. };
  90. #define NCP_IOC_NCPREQUEST _IOR('n', 1, struct ncp_ioctl_request)
  91. #define NCP_IOC_GETMOUNTUID _IOW('n', 2, __kernel_old_uid_t)
  92. #define NCP_IOC_GETMOUNTUID2 _IOW('n', 2, unsigned long)
  93. #define NCP_IOC_CONN_LOGGED_IN _IO('n', 3)
  94. #define NCP_GET_FS_INFO_VERSION (1)
  95. #define NCP_IOC_GET_FS_INFO _IOWR('n', 4, struct ncp_fs_info)
  96. #define NCP_GET_FS_INFO_VERSION_V2 (2)
  97. #define NCP_IOC_GET_FS_INFO_V2 _IOWR('n', 4, struct ncp_fs_info_v2)
  98. #define NCP_IOC_SIGN_INIT _IOR('n', 5, struct ncp_sign_init)
  99. #define NCP_IOC_SIGN_WANTED _IOR('n', 6, int)
  100. #define NCP_IOC_SET_SIGN_WANTED _IOW('n', 6, int)
  101. #define NCP_IOC_LOCKUNLOCK _IOR('n', 7, struct ncp_lock_ioctl)
  102. #define NCP_IOC_GETROOT _IOW('n', 8, struct ncp_setroot_ioctl)
  103. #define NCP_IOC_SETROOT _IOR('n', 8, struct ncp_setroot_ioctl)
  104. #define NCP_IOC_GETOBJECTNAME _IOWR('n', 9, struct ncp_objectname_ioctl)
  105. #define NCP_IOC_SETOBJECTNAME _IOR('n', 9, struct ncp_objectname_ioctl)
  106. #define NCP_IOC_GETPRIVATEDATA _IOWR('n', 10, struct ncp_privatedata_ioctl)
  107. #define NCP_IOC_SETPRIVATEDATA _IOR('n', 10, struct ncp_privatedata_ioctl)
  108. #define NCP_IOC_GETCHARSETS _IOWR('n', 11, struct ncp_nls_ioctl)
  109. #define NCP_IOC_SETCHARSETS _IOR('n', 11, struct ncp_nls_ioctl)
  110. #define NCP_IOC_GETDENTRYTTL _IOW('n', 12, __u32)
  111. #define NCP_IOC_SETDENTRYTTL _IOR('n', 12, __u32)
  112. /*
  113. * The packet size to allocate. One page should be enough.
  114. */
  115. #define NCP_PACKET_SIZE 4070
  116. #define NCP_MAXPATHLEN 255
  117. #define NCP_MAXNAMELEN 14
  118. #endif /* _LINUX_NCP_FS_H */