ncp_fs.h 3.4 KB

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