ncp.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. /*
  2. * ncp.h
  3. *
  4. * Copyright (C) 1995 by Volker Lendecke
  5. * Modified for sparc by J.F. Chadima
  6. * Modified for __constant_ntoh by Frank A. Vorstenbosch
  7. *
  8. */
  9. #ifndef _LINUX_NCP_H
  10. #define _LINUX_NCP_H
  11. #include <linux/types.h>
  12. #define NCP_PTYPE (0x11)
  13. #define NCP_PORT (0x0451)
  14. #define NCP_ALLOC_SLOT_REQUEST (0x1111)
  15. #define NCP_REQUEST (0x2222)
  16. #define NCP_DEALLOC_SLOT_REQUEST (0x5555)
  17. struct ncp_request_header {
  18. __u16 type;
  19. __u8 sequence;
  20. __u8 conn_low;
  21. __u8 task;
  22. __u8 conn_high;
  23. __u8 function;
  24. __u8 data[0];
  25. } __attribute__((packed));
  26. #define NCP_REPLY (0x3333)
  27. #define NCP_WATCHDOG (0x3E3E)
  28. #define NCP_POSITIVE_ACK (0x9999)
  29. struct ncp_reply_header {
  30. __u16 type;
  31. __u8 sequence;
  32. __u8 conn_low;
  33. __u8 task;
  34. __u8 conn_high;
  35. __u8 completion_code;
  36. __u8 connection_state;
  37. __u8 data[0];
  38. } __attribute__((packed));
  39. #define NCP_VOLNAME_LEN (16)
  40. #define NCP_NUMBER_OF_VOLUMES (256)
  41. struct ncp_volume_info {
  42. __u32 total_blocks;
  43. __u32 free_blocks;
  44. __u32 purgeable_blocks;
  45. __u32 not_yet_purgeable_blocks;
  46. __u32 total_dir_entries;
  47. __u32 available_dir_entries;
  48. __u8 sectors_per_block;
  49. char volume_name[NCP_VOLNAME_LEN + 1];
  50. };
  51. #define AR_READ (cpu_to_le16(1))
  52. #define AR_WRITE (cpu_to_le16(2))
  53. #define AR_EXCLUSIVE (cpu_to_le16(0x20))
  54. #define NCP_FILE_ID_LEN 6
  55. /* Defines for Name Spaces */
  56. #define NW_NS_DOS 0
  57. #define NW_NS_MAC 1
  58. #define NW_NS_NFS 2
  59. #define NW_NS_FTAM 3
  60. #define NW_NS_OS2 4
  61. /* Defines for ReturnInformationMask */
  62. #define RIM_NAME (cpu_to_le32(1))
  63. #define RIM_SPACE_ALLOCATED (cpu_to_le32(2))
  64. #define RIM_ATTRIBUTES (cpu_to_le32(4))
  65. #define RIM_DATA_SIZE (cpu_to_le32(8))
  66. #define RIM_TOTAL_SIZE (cpu_to_le32(0x10))
  67. #define RIM_EXT_ATTR_INFO (cpu_to_le32(0x20))
  68. #define RIM_ARCHIVE (cpu_to_le32(0x40))
  69. #define RIM_MODIFY (cpu_to_le32(0x80))
  70. #define RIM_CREATION (cpu_to_le32(0x100))
  71. #define RIM_OWNING_NAMESPACE (cpu_to_le32(0x200))
  72. #define RIM_DIRECTORY (cpu_to_le32(0x400))
  73. #define RIM_RIGHTS (cpu_to_le32(0x800))
  74. #define RIM_ALL (cpu_to_le32(0xFFF))
  75. #define RIM_COMPRESSED_INFO (cpu_to_le32(0x80000000))
  76. /* Defines for NSInfoBitMask */
  77. #define NSIBM_NFS_NAME 0x0001
  78. #define NSIBM_NFS_MODE 0x0002
  79. #define NSIBM_NFS_GID 0x0004
  80. #define NSIBM_NFS_NLINKS 0x0008
  81. #define NSIBM_NFS_RDEV 0x0010
  82. #define NSIBM_NFS_LINK 0x0020
  83. #define NSIBM_NFS_CREATED 0x0040
  84. #define NSIBM_NFS_UID 0x0080
  85. #define NSIBM_NFS_ACSFLAG 0x0100
  86. #define NSIBM_NFS_MYFLAG 0x0200
  87. /* open/create modes */
  88. #define OC_MODE_OPEN 0x01
  89. #define OC_MODE_TRUNCATE 0x02
  90. #define OC_MODE_REPLACE 0x02
  91. #define OC_MODE_CREATE 0x08
  92. /* open/create results */
  93. #define OC_ACTION_NONE 0x00
  94. #define OC_ACTION_OPEN 0x01
  95. #define OC_ACTION_CREATE 0x02
  96. #define OC_ACTION_TRUNCATE 0x04
  97. #define OC_ACTION_REPLACE 0x04
  98. /* access rights attributes */
  99. #ifndef AR_READ_ONLY
  100. #define AR_READ_ONLY 0x0001
  101. #define AR_WRITE_ONLY 0x0002
  102. #define AR_DENY_READ 0x0004
  103. #define AR_DENY_WRITE 0x0008
  104. #define AR_COMPATIBILITY 0x0010
  105. #define AR_WRITE_THROUGH 0x0040
  106. #define AR_OPEN_COMPRESSED 0x0100
  107. #endif
  108. struct nw_nfs_info {
  109. __u32 mode;
  110. __u32 rdev;
  111. };
  112. struct nw_info_struct {
  113. __u32 spaceAlloc;
  114. __le32 attributes;
  115. __u16 flags;
  116. __le32 dataStreamSize;
  117. __le32 totalStreamSize;
  118. __u16 numberOfStreams;
  119. __le16 creationTime;
  120. __le16 creationDate;
  121. __u32 creatorID;
  122. __le16 modifyTime;
  123. __le16 modifyDate;
  124. __u32 modifierID;
  125. __le16 lastAccessDate;
  126. __u16 archiveTime;
  127. __u16 archiveDate;
  128. __u32 archiverID;
  129. __u16 inheritedRightsMask;
  130. __le32 dirEntNum;
  131. __le32 DosDirNum;
  132. __u32 volNumber;
  133. __u32 EADataSize;
  134. __u32 EAKeyCount;
  135. __u32 EAKeySize;
  136. __u32 NSCreator;
  137. __u8 nameLen;
  138. __u8 entryName[256];
  139. /* libncp may depend on there being nothing after entryName */
  140. #ifdef __KERNEL__
  141. struct nw_nfs_info nfs;
  142. #endif
  143. } __attribute__((packed));
  144. /* modify mask - use with MODIFY_DOS_INFO structure */
  145. #define DM_ATTRIBUTES (cpu_to_le32(0x02))
  146. #define DM_CREATE_DATE (cpu_to_le32(0x04))
  147. #define DM_CREATE_TIME (cpu_to_le32(0x08))
  148. #define DM_CREATOR_ID (cpu_to_le32(0x10))
  149. #define DM_ARCHIVE_DATE (cpu_to_le32(0x20))
  150. #define DM_ARCHIVE_TIME (cpu_to_le32(0x40))
  151. #define DM_ARCHIVER_ID (cpu_to_le32(0x80))
  152. #define DM_MODIFY_DATE (cpu_to_le32(0x0100))
  153. #define DM_MODIFY_TIME (cpu_to_le32(0x0200))
  154. #define DM_MODIFIER_ID (cpu_to_le32(0x0400))
  155. #define DM_LAST_ACCESS_DATE (cpu_to_le32(0x0800))
  156. #define DM_INHERITED_RIGHTS_MASK (cpu_to_le32(0x1000))
  157. #define DM_MAXIMUM_SPACE (cpu_to_le32(0x2000))
  158. struct nw_modify_dos_info {
  159. __le32 attributes;
  160. __le16 creationDate;
  161. __le16 creationTime;
  162. __u32 creatorID;
  163. __le16 modifyDate;
  164. __le16 modifyTime;
  165. __u32 modifierID;
  166. __u16 archiveDate;
  167. __u16 archiveTime;
  168. __u32 archiverID;
  169. __le16 lastAccessDate;
  170. __u16 inheritanceGrantMask;
  171. __u16 inheritanceRevokeMask;
  172. __u32 maximumSpace;
  173. } __attribute__((packed));
  174. struct nw_search_sequence {
  175. __u8 volNumber;
  176. __u32 dirBase;
  177. __u32 sequence;
  178. } __attribute__((packed));
  179. #endif /* _LINUX_NCP_H */