ncp.h
001:
002:
003:
004:
005:
006:
007:
008:
009:
010: #ifndef _LINUX_NCP_H
011: #define _LINUX_NCP_H
012:
013: #include <linux/types.h>
014:
015: #define NCP_PTYPE (0x11)
016: #define NCP_PORT (0x0451)
017:
018: #define NCP_ALLOC_SLOT_REQUEST (0x1111)
019: #define NCP_REQUEST (0x2222)
020: #define NCP_DEALLOC_SLOT_REQUEST (0x5555)
021:
022: struct ncp_request_header {
023: __u16 type;
024: __u8 sequence;
025: __u8 conn_low;
026: __u8 task;
027: __u8 conn_high;
028: __u8 function;
029: __u8 data[0];
030: } __attribute__((packed));
031:
032: #define NCP_REPLY (0x3333)
033: #define NCP_WATCHDOG (0x3E3E)
034: #define NCP_POSITIVE_ACK (0x9999)
035:
036: struct ncp_reply_header {
037: __u16 type;
038: __u8 sequence;
039: __u8 conn_low;
040: __u8 task;
041: __u8 conn_high;
042: __u8 completion_code;
043: __u8 connection_state;
044: __u8 data[0];
045: } __attribute__((packed));
046:
047: #define NCP_VOLNAME_LEN (16)
048: #define NCP_NUMBER_OF_VOLUMES (256)
049: struct ncp_volume_info {
050: __u32 total_blocks;
051: __u32 free_blocks;
052: __u32 purgeable_blocks;
053: __u32 not_yet_purgeable_blocks;
054: __u32 total_dir_entries;
055: __u32 available_dir_entries;
056: __u8 sectors_per_block;
057: char volume_name[NCP_VOLNAME_LEN + 1];
058: };
059:
060: #define AR_READ (cpu_to_le16(1))
061: #define AR_WRITE (cpu_to_le16(2))
062: #define AR_EXCLUSIVE (cpu_to_le16(0x20))
063:
064: #define NCP_FILE_ID_LEN 6
065:
066:
067: #define NW_NS_DOS 0
068: #define NW_NS_MAC 1
069: #define NW_NS_NFS 2
070: #define NW_NS_FTAM 3
071: #define NW_NS_OS2 4
072:
073:
074: #define RIM_NAME (cpu_to_le32(1))
075: #define RIM_SPACE_ALLOCATED (cpu_to_le32(2))
076: #define RIM_ATTRIBUTES (cpu_to_le32(4))
077: #define RIM_DATA_SIZE (cpu_to_le32(8))
078: #define RIM_TOTAL_SIZE (cpu_to_le32(0x10))
079: #define RIM_EXT_ATTR_INFO (cpu_to_le32(0x20))
080: #define RIM_ARCHIVE (cpu_to_le32(0x40))
081: #define RIM_MODIFY (cpu_to_le32(0x80))
082: #define RIM_CREATION (cpu_to_le32(0x100))
083: #define RIM_OWNING_NAMESPACE (cpu_to_le32(0x200))
084: #define RIM_DIRECTORY (cpu_to_le32(0x400))
085: #define RIM_RIGHTS (cpu_to_le32(0x800))
086: #define RIM_ALL (cpu_to_le32(0xFFF))
087: #define RIM_COMPRESSED_INFO (cpu_to_le32(0x80000000))
088:
089:
090: #define NSIBM_NFS_NAME 0x0001
091: #define NSIBM_NFS_MODE 0x0002
092: #define NSIBM_NFS_GID 0x0004
093: #define NSIBM_NFS_NLINKS 0x0008
094: #define NSIBM_NFS_RDEV 0x0010
095: #define NSIBM_NFS_LINK 0x0020
096: #define NSIBM_NFS_CREATED 0x0040
097: #define NSIBM_NFS_UID 0x0080
098: #define NSIBM_NFS_ACSFLAG 0x0100
099: #define NSIBM_NFS_MYFLAG 0x0200
100:
101:
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:
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:
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;
132: __le32 attributes;
133: __u16 flags;
134: __le32 dataStreamSize;
135: __le32 totalStreamSize;
136: __u16 numberOfStreams;
137: __le16 creationTime;
138: __le16 creationDate;
139: __u32 creatorID;
140: __le16 modifyTime;
141: __le16 modifyDate;
142: __u32 modifierID;
143: __le16 lastAccessDate;
144: __u16 archiveTime;
145: __u16 archiveDate;
146: __u32 archiverID;
147: __u16 inheritedRightsMask;
148: __le32 dirEntNum;
149: __le32 DosDirNum;
150: __u32 volNumber;
151: __u32 EADataSize;
152: __u32 EAKeyCount;
153: __u32 EAKeySize;
154: __u32 NSCreator;
155: __u8 nameLen;
156: __u8 entryName[256];
157:
158: } __attribute__((packed));
159:
160:
161: #define DM_ATTRIBUTES (cpu_to_le32(0x02))
162: #define DM_CREATE_DATE (cpu_to_le32(0x04))
163: #define DM_CREATE_TIME (cpu_to_le32(0x08))
164: #define DM_CREATOR_ID (cpu_to_le32(0x10))
165: #define DM_ARCHIVE_DATE (cpu_to_le32(0x20))
166: #define DM_ARCHIVE_TIME (cpu_to_le32(0x40))
167: #define DM_ARCHIVER_ID (cpu_to_le32(0x80))
168: #define DM_MODIFY_DATE (cpu_to_le32(0x0100))
169: #define DM_MODIFY_TIME (cpu_to_le32(0x0200))
170: #define DM_MODIFIER_ID (cpu_to_le32(0x0400))
171: #define DM_LAST_ACCESS_DATE (cpu_to_le32(0x0800))
172: #define DM_INHERITED_RIGHTS_MASK (cpu_to_le32(0x1000))
173: #define DM_MAXIMUM_SPACE (cpu_to_le32(0x2000))
174:
175: struct nw_modify_dos_info {
176: __le32 attributes;
177: __le16 creationDate;
178: __le16 creationTime;
179: __u32 creatorID;
180: __le16 modifyDate;
181: __le16 modifyTime;
182: __u32 modifierID;
183: __u16 archiveDate;
184: __u16 archiveTime;
185: __u32 archiverID;
186: __le16 lastAccessDate;
187: __u16 inheritanceGrantMask;
188: __u16 inheritanceRevokeMask;
189: __u32 maximumSpace;
190: } __attribute__((packed));
191:
192: struct nw_search_sequence {
193: __u8 volNumber;
194: __u32 dirBase;
195: __u32 sequence;
196: } __attribute__((packed));
197:
198: #endif
199:
© Andrew Scott 2006 -
2025,
All Rights Reserved