4 * Copyright (C) 1995 by Volker Lendecke
5 * Modified for sparc by J.F. Chadima
6 * Modified for __constant_ntoh by Frank A. Vorstenbosch
13 #include <linux/types.h>
14 #include <linux/ipx.h>
16 #define NCP_PTYPE (0x11)
17 #define NCP_PORT (0x0451)
19 #define NCP_ALLOC_SLOT_REQUEST (0x1111)
20 #define NCP_REQUEST (0x2222)
21 #define NCP_DEALLOC_SLOT_REQUEST (0x5555)
23 struct ncp_request_header
{
24 __u16 type
__attribute__((packed
));
25 __u8 sequence
__attribute__((packed
));
26 __u8 conn_low
__attribute__((packed
));
27 __u8 task
__attribute__((packed
));
28 __u8 conn_high
__attribute__((packed
));
29 __u8 function
__attribute__((packed
));
30 __u8 data
[0] __attribute__((packed
));
33 #define NCP_REPLY (0x3333)
34 #define NCP_POSITIVE_ACK (0x9999)
36 struct ncp_reply_header
{
37 __u16 type
__attribute__((packed
));
38 __u8 sequence
__attribute__((packed
));
39 __u8 conn_low
__attribute__((packed
));
40 __u8 task
__attribute__((packed
));
41 __u8 conn_high
__attribute__((packed
));
42 __u8 completion_code
__attribute__((packed
));
43 __u8 connection_state
__attribute__((packed
));
44 __u8 data
[0] __attribute__((packed
));
47 #define NCP_VOLNAME_LEN (16)
48 #define NCP_NUMBER_OF_VOLUMES (64)
49 struct ncp_volume_info
{
52 __u32 purgeable_blocks
;
53 __u32 not_yet_purgeable_blocks
;
54 __u32 total_dir_entries
;
55 __u32 available_dir_entries
;
56 __u8 sectors_per_block
;
57 char volume_name
[NCP_VOLNAME_LEN
+ 1];
60 /* these define the attribute byte as seen by NCP */
61 #define aRONLY (ntohl(0x01000000))
62 #define aHIDDEN (__constant_ntohl(0x02000000))
63 #define aSYSTEM (__constant_ntohl(0x04000000))
64 #define aEXECUTE (ntohl(0x08000000))
65 #define aDIR (ntohl(0x10000000))
66 #define aARCH (ntohl(0x20000000))
67 #define aSHARED (ntohl(0x80000000))
68 #define aDONTSUBALLOCATE (ntohl(1L<<(11+8)))
69 #define aTRANSACTIONAL (ntohl(1L<<(12+8)))
70 #define aPURGE (ntohl(1L<<(16-8)))
71 #define aRENAMEINHIBIT (ntohl(1L<<(17-8)))
72 #define aDELETEINHIBIT (ntohl(1L<<(18-8)))
73 #define aDONTCOMPRESS (nothl(1L<<(27-24)))
75 #define AR_READ (ntohs(0x0100))
76 #define AR_WRITE (ntohs(0x0200))
77 #define AR_EXCLUSIVE (ntohs(0x2000))
79 #define NCP_FILE_ID_LEN 6
81 /* Defines for Name Spaces */
88 /* Defines for ReturnInformationMask */
89 #define RIM_NAME (ntohl(0x01000000L))
90 #define RIM_SPACE_ALLOCATED (ntohl(0x02000000L))
91 #define RIM_ATTRIBUTES (ntohl(0x04000000L))
92 #define RIM_DATA_SIZE (ntohl(0x08000000L))
93 #define RIM_TOTAL_SIZE (ntohl(0x10000000L))
94 #define RIM_EXT_ATTR_INFO (ntohl(0x20000000L))
95 #define RIM_ARCHIVE (ntohl(0x40000000L))
96 #define RIM_MODIFY (ntohl(0x80000000L))
97 #define RIM_CREATION (ntohl(0x00010000L))
98 #define RIM_OWNING_NAMESPACE (ntohl(0x00020000L))
99 #define RIM_DIRECTORY (ntohl(0x00040000L))
100 #define RIM_RIGHTS (ntohl(0x00080000L))
101 #define RIM_ALL (ntohl(0xFF0F0000L))
102 #define RIM_COMPRESSED_INFO (ntohl(0x00000080L))
104 /* open/create modes */
105 #define OC_MODE_OPEN 0x01
106 #define OC_MODE_TRUNCATE 0x02
107 #define OC_MODE_REPLACE 0x02
108 #define OC_MODE_CREATE 0x08
110 /* open/create results */
111 #define OC_ACTION_NONE 0x00
112 #define OC_ACTION_OPEN 0x01
113 #define OC_ACTION_CREATE 0x02
114 #define OC_ACTION_TRUNCATE 0x04
115 #define OC_ACTION_REPLACE 0x04
117 /* access rights attributes */
119 #define AR_READ_ONLY 0x0001
120 #define AR_WRITE_ONLY 0x0002
121 #define AR_DENY_READ 0x0004
122 #define AR_DENY_WRITE 0x0008
123 #define AR_COMPATIBILITY 0x0010
124 #define AR_WRITE_THROUGH 0x0040
125 #define AR_OPEN_COMPRESSED 0x0100
128 struct nw_info_struct
{
129 __u32 spaceAlloc
__attribute__((packed
));
130 __u32 attributes
__attribute__((packed
));
131 __u16 flags
__attribute__((packed
));
132 __u32 dataStreamSize
__attribute__((packed
));
133 __u32 totalStreamSize
__attribute__((packed
));
134 __u16 numberOfStreams
__attribute__((packed
));
135 __u16 creationTime
__attribute__((packed
));
136 __u16 creationDate
__attribute__((packed
));
137 __u32 creatorID
__attribute__((packed
));
138 __u16 modifyTime
__attribute__((packed
));
139 __u16 modifyDate
__attribute__((packed
));
140 __u32 modifierID
__attribute__((packed
));
141 __u16 lastAccessDate
__attribute__((packed
));
142 __u16 archiveTime
__attribute__((packed
));
143 __u16 archiveDate
__attribute__((packed
));
144 __u32 archiverID
__attribute__((packed
));
145 __u16 inheritedRightsMask
__attribute__((packed
));
146 __u32 dirEntNum
__attribute__((packed
));
147 __u32 DosDirNum
__attribute__((packed
));
148 __u32 volNumber
__attribute__((packed
));
149 __u32 EADataSize
__attribute__((packed
));
150 __u32 EAKeyCount
__attribute__((packed
));
151 __u32 EAKeySize
__attribute__((packed
));
152 __u32 NSCreator
__attribute__((packed
));
153 __u8 nameLen
__attribute__((packed
));
154 __u8 entryName
[256] __attribute__((packed
));
157 /* modify mask - use with MODIFY_DOS_INFO structure */
158 #define DM_ATTRIBUTES (ntohl(0x02000000L))
159 #define DM_CREATE_DATE (ntohl(0x04000000L))
160 #define DM_CREATE_TIME (ntohl(0x08000000L))
161 #define DM_CREATOR_ID (ntohl(0x10000000L))
162 #define DM_ARCHIVE_DATE (ntohl(0x20000000L))
163 #define DM_ARCHIVE_TIME (ntohl(0x40000000L))
164 #define DM_ARCHIVER_ID (ntohl(0x80000000L))
165 #define DM_MODIFY_DATE (ntohl(0x00010000L))
166 #define DM_MODIFY_TIME (ntohl(0x00020000L))
167 #define DM_MODIFIER_ID (ntohl(0x00040000L))
168 #define DM_LAST_ACCESS_DATE (ntohl(0x00080000L))
169 #define DM_INHERITED_RIGHTS_MASK (ntohl(0x00100000L))
170 #define DM_MAXIMUM_SPACE (ntohl(0x00200000L))
172 struct nw_modify_dos_info
{
173 __u32 attributes
__attribute__((packed
));
174 __u16 creationDate
__attribute__((packed
));
175 __u16 creationTime
__attribute__((packed
));
176 __u32 creatorID
__attribute__((packed
));
177 __u16 modifyDate
__attribute__((packed
));
178 __u16 modifyTime
__attribute__((packed
));
179 __u32 modifierID
__attribute__((packed
));
180 __u16 archiveDate
__attribute__((packed
));
181 __u16 archiveTime
__attribute__((packed
));
182 __u32 archiverID
__attribute__((packed
));
183 __u16 lastAccessDate
__attribute__((packed
));
184 __u16 inheritanceGrantMask
__attribute__((packed
));
185 __u16 inheritanceRevokeMask
__attribute__((packed
));
186 __u32 maximumSpace
__attribute__((packed
));
189 struct nw_file_info
{
190 struct nw_info_struct i
;
193 __u32 server_file_handle
__attribute__((packed
));
194 __u8 open_create_action
__attribute__((packed
));
195 __u8 file_handle
[6] __attribute__((packed
));
198 struct nw_search_sequence
{
199 __u8 volNumber
__attribute__((packed
));
200 __u32 dirBase
__attribute__((packed
));
201 __u32 sequence
__attribute__((packed
));
204 #endif /* _LINUX_NCP_H */