1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
5 * Copyright (C) 1995 by Volker Lendecke
6 * Modified for sparc by J.F. Chadima
7 * Modified for __constant_ntoh by Frank A. Vorstenbosch
14 #include <linux/types.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
{
31 } __attribute__((packed
));
33 #define NCP_REPLY (0x3333)
34 #define NCP_WATCHDOG (0x3E3E)
35 #define NCP_POSITIVE_ACK (0x9999)
37 struct ncp_reply_header
{
44 __u8 connection_state
;
46 } __attribute__((packed
));
48 #define NCP_VOLNAME_LEN (16)
49 #define NCP_NUMBER_OF_VOLUMES (256)
50 struct ncp_volume_info
{
53 __u32 purgeable_blocks
;
54 __u32 not_yet_purgeable_blocks
;
55 __u32 total_dir_entries
;
56 __u32 available_dir_entries
;
57 __u8 sectors_per_block
;
58 char volume_name
[NCP_VOLNAME_LEN
+ 1];
61 #define AR_READ (cpu_to_le16(1))
62 #define AR_WRITE (cpu_to_le16(2))
63 #define AR_EXCLUSIVE (cpu_to_le16(0x20))
65 #define NCP_FILE_ID_LEN 6
67 /* Defines for Name Spaces */
74 /* Defines for ReturnInformationMask */
75 #define RIM_NAME (cpu_to_le32(1))
76 #define RIM_SPACE_ALLOCATED (cpu_to_le32(2))
77 #define RIM_ATTRIBUTES (cpu_to_le32(4))
78 #define RIM_DATA_SIZE (cpu_to_le32(8))
79 #define RIM_TOTAL_SIZE (cpu_to_le32(0x10))
80 #define RIM_EXT_ATTR_INFO (cpu_to_le32(0x20))
81 #define RIM_ARCHIVE (cpu_to_le32(0x40))
82 #define RIM_MODIFY (cpu_to_le32(0x80))
83 #define RIM_CREATION (cpu_to_le32(0x100))
84 #define RIM_OWNING_NAMESPACE (cpu_to_le32(0x200))
85 #define RIM_DIRECTORY (cpu_to_le32(0x400))
86 #define RIM_RIGHTS (cpu_to_le32(0x800))
87 #define RIM_ALL (cpu_to_le32(0xFFF))
88 #define RIM_COMPRESSED_INFO (cpu_to_le32(0x80000000))
90 /* Defines for NSInfoBitMask */
91 #define NSIBM_NFS_NAME 0x0001
92 #define NSIBM_NFS_MODE 0x0002
93 #define NSIBM_NFS_GID 0x0004
94 #define NSIBM_NFS_NLINKS 0x0008
95 #define NSIBM_NFS_RDEV 0x0010
96 #define NSIBM_NFS_LINK 0x0020
97 #define NSIBM_NFS_CREATED 0x0040
98 #define NSIBM_NFS_UID 0x0080
99 #define NSIBM_NFS_ACSFLAG 0x0100
100 #define NSIBM_NFS_MYFLAG 0x0200
102 /* open/create modes */
103 #define OC_MODE_OPEN 0x01
104 #define OC_MODE_TRUNCATE 0x02
105 #define OC_MODE_REPLACE 0x02
106 #define OC_MODE_CREATE 0x08
108 /* open/create results */
109 #define OC_ACTION_NONE 0x00
110 #define OC_ACTION_OPEN 0x01
111 #define OC_ACTION_CREATE 0x02
112 #define OC_ACTION_TRUNCATE 0x04
113 #define OC_ACTION_REPLACE 0x04
115 /* access rights attributes */
117 #define AR_READ_ONLY 0x0001
118 #define AR_WRITE_ONLY 0x0002
119 #define AR_DENY_READ 0x0004
120 #define AR_DENY_WRITE 0x0008
121 #define AR_COMPATIBILITY 0x0010
122 #define AR_WRITE_THROUGH 0x0040
123 #define AR_OPEN_COMPRESSED 0x0100
131 struct nw_info_struct
{
135 __le32 dataStreamSize
;
136 __le32 totalStreamSize
;
137 __u16 numberOfStreams
;
144 __le16 lastAccessDate
;
148 __u16 inheritedRightsMask
;
158 /* libncp may depend on there being nothing after entryName */
160 struct nw_nfs_info nfs
;
162 } __attribute__((packed
));
164 /* modify mask - use with MODIFY_DOS_INFO structure */
165 #define DM_ATTRIBUTES (cpu_to_le32(0x02))
166 #define DM_CREATE_DATE (cpu_to_le32(0x04))
167 #define DM_CREATE_TIME (cpu_to_le32(0x08))
168 #define DM_CREATOR_ID (cpu_to_le32(0x10))
169 #define DM_ARCHIVE_DATE (cpu_to_le32(0x20))
170 #define DM_ARCHIVE_TIME (cpu_to_le32(0x40))
171 #define DM_ARCHIVER_ID (cpu_to_le32(0x80))
172 #define DM_MODIFY_DATE (cpu_to_le32(0x0100))
173 #define DM_MODIFY_TIME (cpu_to_le32(0x0200))
174 #define DM_MODIFIER_ID (cpu_to_le32(0x0400))
175 #define DM_LAST_ACCESS_DATE (cpu_to_le32(0x0800))
176 #define DM_INHERITED_RIGHTS_MASK (cpu_to_le32(0x1000))
177 #define DM_MAXIMUM_SPACE (cpu_to_le32(0x2000))
179 struct nw_modify_dos_info
{
190 __le16 lastAccessDate
;
191 __u16 inheritanceGrantMask
;
192 __u16 inheritanceRevokeMask
;
194 } __attribute__((packed
));
196 struct nw_search_sequence
{
200 } __attribute__((packed
));
202 #endif /* _LINUX_NCP_H */