Rev 422 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
422 | giacomo | 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 | |||
10 | #ifndef _LINUX_NCP_H |
||
11 | #define _LINUX_NCP_H |
||
12 | |||
13 | #include <linux/types.h> |
||
14 | |||
15 | #define NCP_PTYPE (0x11) |
||
16 | #define NCP_PORT (0x0451) |
||
17 | |||
18 | #define NCP_ALLOC_SLOT_REQUEST (0x1111) |
||
19 | #define NCP_REQUEST (0x2222) |
||
20 | #define NCP_DEALLOC_SLOT_REQUEST (0x5555) |
||
21 | |||
22 | struct ncp_request_header { |
||
23 | __u16 type __attribute__((packed)); |
||
24 | __u8 sequence __attribute__((packed)); |
||
25 | __u8 conn_low __attribute__((packed)); |
||
26 | __u8 task __attribute__((packed)); |
||
27 | __u8 conn_high __attribute__((packed)); |
||
28 | __u8 function __attribute__((packed)); |
||
29 | __u8 data[0] __attribute__((packed)); |
||
30 | }; |
||
31 | |||
32 | #define NCP_REPLY (0x3333) |
||
33 | #define NCP_WATCHDOG (0x3E3E) |
||
34 | #define NCP_POSITIVE_ACK (0x9999) |
||
35 | |||
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)); |
||
45 | }; |
||
46 | |||
47 | #define NCP_VOLNAME_LEN (16) |
||
48 | #define NCP_NUMBER_OF_VOLUMES (256) |
||
49 | struct ncp_volume_info { |
||
50 | __u32 total_blocks; |
||
51 | __u32 free_blocks; |
||
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]; |
||
58 | }; |
||
59 | |||
60 | #define AR_READ (ntohs(0x0100)) |
||
61 | #define AR_WRITE (ntohs(0x0200)) |
||
62 | #define AR_EXCLUSIVE (ntohs(0x2000)) |
||
63 | |||
64 | #define NCP_FILE_ID_LEN 6 |
||
65 | |||
66 | /* Defines for Name Spaces */ |
||
67 | #define NW_NS_DOS 0 |
||
68 | #define NW_NS_MAC 1 |
||
69 | #define NW_NS_NFS 2 |
||
70 | #define NW_NS_FTAM 3 |
||
71 | #define NW_NS_OS2 4 |
||
72 | |||
73 | /* Defines for ReturnInformationMask */ |
||
74 | #define RIM_NAME (ntohl(0x01000000L)) |
||
75 | #define RIM_SPACE_ALLOCATED (ntohl(0x02000000L)) |
||
76 | #define RIM_ATTRIBUTES (ntohl(0x04000000L)) |
||
77 | #define RIM_DATA_SIZE (ntohl(0x08000000L)) |
||
78 | #define RIM_TOTAL_SIZE (ntohl(0x10000000L)) |
||
79 | #define RIM_EXT_ATTR_INFO (ntohl(0x20000000L)) |
||
80 | #define RIM_ARCHIVE (ntohl(0x40000000L)) |
||
81 | #define RIM_MODIFY (ntohl(0x80000000L)) |
||
82 | #define RIM_CREATION (ntohl(0x00010000L)) |
||
83 | #define RIM_OWNING_NAMESPACE (ntohl(0x00020000L)) |
||
84 | #define RIM_DIRECTORY (ntohl(0x00040000L)) |
||
85 | #define RIM_RIGHTS (ntohl(0x00080000L)) |
||
86 | #define RIM_ALL (ntohl(0xFF0F0000L)) |
||
87 | #define RIM_COMPRESSED_INFO (ntohl(0x00000080L)) |
||
88 | |||
89 | /* Defines for NSInfoBitMask */ |
||
90 | #define NSIBM_NFS_NAME 0x0001 |
||
91 | #define NSIBM_NFS_MODE 0x0002 |
||
92 | #define NSIBM_NFS_GID 0x0004 |
||
93 | #define NSIBM_NFS_NLINKS 0x0008 |
||
94 | #define NSIBM_NFS_RDEV 0x0010 |
||
95 | #define NSIBM_NFS_LINK 0x0020 |
||
96 | #define NSIBM_NFS_CREATED 0x0040 |
||
97 | #define NSIBM_NFS_UID 0x0080 |
||
98 | #define NSIBM_NFS_ACSFLAG 0x0100 |
||
99 | #define NSIBM_NFS_MYFLAG 0x0200 |
||
100 | |||
101 | /* open/create modes */ |
||
102 | #define OC_MODE_OPEN 0x01 |
||
103 | #define OC_MODE_TRUNCATE 0x02 |
||
104 | #define OC_MODE_REPLACE 0x02 |
||
105 | #define OC_MODE_CREATE 0x08 |
||
106 | |||
107 | /* open/create results */ |
||
108 | #define OC_ACTION_NONE 0x00 |
||
109 | #define OC_ACTION_OPEN 0x01 |
||
110 | #define OC_ACTION_CREATE 0x02 |
||
111 | #define OC_ACTION_TRUNCATE 0x04 |
||
112 | #define OC_ACTION_REPLACE 0x04 |
||
113 | |||
114 | /* access rights attributes */ |
||
115 | #ifndef AR_READ_ONLY |
||
116 | #define AR_READ_ONLY 0x0001 |
||
117 | #define AR_WRITE_ONLY 0x0002 |
||
118 | #define AR_DENY_READ 0x0004 |
||
119 | #define AR_DENY_WRITE 0x0008 |
||
120 | #define AR_COMPATIBILITY 0x0010 |
||
121 | #define AR_WRITE_THROUGH 0x0040 |
||
122 | #define AR_OPEN_COMPRESSED 0x0100 |
||
123 | #endif |
||
124 | |||
125 | struct nw_nfs_info { |
||
126 | __u32 mode; |
||
127 | __u32 rdev; |
||
128 | }; |
||
129 | |||
130 | struct nw_info_struct { |
||
131 | __u32 spaceAlloc __attribute__((packed)); |
||
132 | __u32 attributes __attribute__((packed)); |
||
133 | __u16 flags __attribute__((packed)); |
||
134 | __u32 dataStreamSize __attribute__((packed)); |
||
135 | __u32 totalStreamSize __attribute__((packed)); |
||
136 | __u16 numberOfStreams __attribute__((packed)); |
||
137 | __u16 creationTime __attribute__((packed)); |
||
138 | __u16 creationDate __attribute__((packed)); |
||
139 | __u32 creatorID __attribute__((packed)); |
||
140 | __u16 modifyTime __attribute__((packed)); |
||
141 | __u16 modifyDate __attribute__((packed)); |
||
142 | __u32 modifierID __attribute__((packed)); |
||
143 | __u16 lastAccessDate __attribute__((packed)); |
||
144 | __u16 archiveTime __attribute__((packed)); |
||
145 | __u16 archiveDate __attribute__((packed)); |
||
146 | __u32 archiverID __attribute__((packed)); |
||
147 | __u16 inheritedRightsMask __attribute__((packed)); |
||
148 | __u32 dirEntNum __attribute__((packed)); |
||
149 | __u32 DosDirNum __attribute__((packed)); |
||
150 | __u32 volNumber __attribute__((packed)); |
||
151 | __u32 EADataSize __attribute__((packed)); |
||
152 | __u32 EAKeyCount __attribute__((packed)); |
||
153 | __u32 EAKeySize __attribute__((packed)); |
||
154 | __u32 NSCreator __attribute__((packed)); |
||
155 | __u8 nameLen __attribute__((packed)); |
||
156 | __u8 entryName[256] __attribute__((packed)); |
||
157 | /* libncp may depend on there being nothing after entryName */ |
||
158 | #ifdef __KERNEL__ |
||
159 | struct nw_nfs_info nfs; |
||
160 | #endif |
||
161 | }; |
||
162 | |||
163 | /* modify mask - use with MODIFY_DOS_INFO structure */ |
||
164 | #define DM_ATTRIBUTES (ntohl(0x02000000L)) |
||
165 | #define DM_CREATE_DATE (ntohl(0x04000000L)) |
||
166 | #define DM_CREATE_TIME (ntohl(0x08000000L)) |
||
167 | #define DM_CREATOR_ID (ntohl(0x10000000L)) |
||
168 | #define DM_ARCHIVE_DATE (ntohl(0x20000000L)) |
||
169 | #define DM_ARCHIVE_TIME (ntohl(0x40000000L)) |
||
170 | #define DM_ARCHIVER_ID (ntohl(0x80000000L)) |
||
171 | #define DM_MODIFY_DATE (ntohl(0x00010000L)) |
||
172 | #define DM_MODIFY_TIME (ntohl(0x00020000L)) |
||
173 | #define DM_MODIFIER_ID (ntohl(0x00040000L)) |
||
174 | #define DM_LAST_ACCESS_DATE (ntohl(0x00080000L)) |
||
175 | #define DM_INHERITED_RIGHTS_MASK (ntohl(0x00100000L)) |
||
176 | #define DM_MAXIMUM_SPACE (ntohl(0x00200000L)) |
||
177 | |||
178 | struct nw_modify_dos_info { |
||
179 | __u32 attributes __attribute__((packed)); |
||
180 | __u16 creationDate __attribute__((packed)); |
||
181 | __u16 creationTime __attribute__((packed)); |
||
182 | __u32 creatorID __attribute__((packed)); |
||
183 | __u16 modifyDate __attribute__((packed)); |
||
184 | __u16 modifyTime __attribute__((packed)); |
||
185 | __u32 modifierID __attribute__((packed)); |
||
186 | __u16 archiveDate __attribute__((packed)); |
||
187 | __u16 archiveTime __attribute__((packed)); |
||
188 | __u32 archiverID __attribute__((packed)); |
||
189 | __u16 lastAccessDate __attribute__((packed)); |
||
190 | __u16 inheritanceGrantMask __attribute__((packed)); |
||
191 | __u16 inheritanceRevokeMask __attribute__((packed)); |
||
192 | __u32 maximumSpace __attribute__((packed)); |
||
193 | }; |
||
194 | |||
195 | struct nw_search_sequence { |
||
196 | __u8 volNumber __attribute__((packed)); |
||
197 | __u32 dirBase __attribute__((packed)); |
||
198 | __u32 sequence __attribute__((packed)); |
||
199 | }; |
||
200 | |||
201 | #endif /* _LINUX_NCP_H */ |