| 1 | /* |
|---|
| 2 | * ncp_fs.h |
|---|
| 3 | * |
|---|
| 4 | * Copyright (C) 1995, 1996 by Volker Lendecke |
|---|
| 5 | * |
|---|
| 6 | */ |
|---|
| 7 | |
|---|
| 8 | #ifndef _LINUX_NCP_FS_H |
|---|
| 9 | #define _LINUX_NCP_FS_H |
|---|
| 10 | |
|---|
| 11 | #include <linux/fs.h> |
|---|
| 12 | #include <linux/in.h> |
|---|
| 13 | #include <linux/types.h> |
|---|
| 14 | |
|---|
| 15 | #include <linux/ipx.h> |
|---|
| 16 | #include <linux/ncp_no.h> |
|---|
| 17 | |
|---|
| 18 | /* |
|---|
| 19 | * ioctl commands |
|---|
| 20 | */ |
|---|
| 21 | |
|---|
| 22 | struct ncp_ioctl_request { |
|---|
| 23 | unsigned int function; |
|---|
| 24 | unsigned int size; |
|---|
| 25 | char *data; |
|---|
| 26 | }; |
|---|
| 27 | |
|---|
| 28 | struct ncp_fs_info { |
|---|
| 29 | int version; |
|---|
| 30 | struct sockaddr_ipx addr; |
|---|
| 31 | __kernel_uid_t mounted_uid; |
|---|
| 32 | int connection; /* Connection number the server assigned us */ |
|---|
| 33 | int buffer_size; /* The negotiated buffer size, to be |
|---|
| 34 | used for read/write requests! */ |
|---|
| 35 | |
|---|
| 36 | int volume_number; |
|---|
| 37 | __le32 directory_id; |
|---|
| 38 | }; |
|---|
| 39 | |
|---|
| 40 | struct ncp_fs_info_v2 { |
|---|
| 41 | int version; |
|---|
| 42 | unsigned long mounted_uid; |
|---|
| 43 | unsigned int connection; |
|---|
| 44 | unsigned int buffer_size; |
|---|
| 45 | |
|---|
| 46 | unsigned int volume_number; |
|---|
| 47 | __le32 directory_id; |
|---|
| 48 | |
|---|
| 49 | __u32 dummy1; |
|---|
| 50 | __u32 dummy2; |
|---|
| 51 | __u32 dummy3; |
|---|
| 52 | }; |
|---|
| 53 | |
|---|
| 54 | struct ncp_sign_init |
|---|
| 55 | { |
|---|
| 56 | char sign_root[8]; |
|---|
| 57 | char sign_last[16]; |
|---|
| 58 | }; |
|---|
| 59 | |
|---|
| 60 | struct ncp_lock_ioctl |
|---|
| 61 | { |
|---|
| 62 | #define NCP_LOCK_LOG 0 |
|---|
| 63 | #define NCP_LOCK_SH 1 |
|---|
| 64 | #define NCP_LOCK_EX 2 |
|---|
| 65 | #define NCP_LOCK_CLEAR 256 |
|---|
| 66 | int cmd; |
|---|
| 67 | int origin; |
|---|
| 68 | unsigned int offset; |
|---|
| 69 | unsigned int length; |
|---|
| 70 | #define NCP_LOCK_DEFAULT_TIMEOUT 18 |
|---|
| 71 | #define NCP_LOCK_MAX_TIMEOUT 180 |
|---|
| 72 | int timeout; |
|---|
| 73 | }; |
|---|
| 74 | |
|---|
| 75 | struct ncp_setroot_ioctl |
|---|
| 76 | { |
|---|
| 77 | int volNumber; |
|---|
| 78 | int namespace; |
|---|
| 79 | __le32 dirEntNum; |
|---|
| 80 | }; |
|---|
| 81 | |
|---|
| 82 | struct ncp_objectname_ioctl |
|---|
| 83 | { |
|---|
| 84 | #define NCP_AUTH_NONE 0x00 |
|---|
| 85 | #define NCP_AUTH_BIND 0x31 |
|---|
| 86 | #define NCP_AUTH_NDS 0x32 |
|---|
| 87 | int auth_type; |
|---|
| 88 | size_t object_name_len; |
|---|
| 89 | void* object_name; /* an userspace data, in most cases user name */ |
|---|
| 90 | }; |
|---|
| 91 | |
|---|
| 92 | struct ncp_privatedata_ioctl |
|---|
| 93 | { |
|---|
| 94 | size_t len; |
|---|
| 95 | void* data; /* ~1000 for NDS */ |
|---|
| 96 | }; |
|---|
| 97 | |
|---|
| 98 | /* NLS charsets by ioctl */ |
|---|
| 99 | #define NCP_IOCSNAME_LEN 20 |
|---|
| 100 | struct ncp_nls_ioctl |
|---|
| 101 | { |
|---|
| 102 | unsigned char codepage[NCP_IOCSNAME_LEN+1]; |
|---|
| 103 | unsigned char iocharset[NCP_IOCSNAME_LEN+1]; |
|---|
| 104 | }; |
|---|
| 105 | |
|---|
| 106 | #define NCP_IOC_NCPREQUEST _IOR('n', 1, struct ncp_ioctl_request) |
|---|
| 107 | #define NCP_IOC_GETMOUNTUID _IOW('n', 2, __kernel_old_uid_t) |
|---|
| 108 | #define NCP_IOC_GETMOUNTUID2 _IOW('n', 2, unsigned long) |
|---|
| 109 | |
|---|
| 110 | #define NCP_IOC_CONN_LOGGED_IN _IO('n', 3) |
|---|
| 111 | |
|---|
| 112 | #define NCP_GET_FS_INFO_VERSION (1) |
|---|
| 113 | #define NCP_IOC_GET_FS_INFO _IOWR('n', 4, struct ncp_fs_info) |
|---|
| 114 | #define NCP_GET_FS_INFO_VERSION_V2 (2) |
|---|
| 115 | #define NCP_IOC_GET_FS_INFO_V2 _IOWR('n', 4, struct ncp_fs_info_v2) |
|---|
| 116 | |
|---|
| 117 | #define NCP_IOC_SIGN_INIT _IOR('n', 5, struct ncp_sign_init) |
|---|
| 118 | #define NCP_IOC_SIGN_WANTED _IOR('n', 6, int) |
|---|
| 119 | #define NCP_IOC_SET_SIGN_WANTED _IOW('n', 6, int) |
|---|
| 120 | |
|---|
| 121 | #define NCP_IOC_LOCKUNLOCK _IOR('n', 7, struct ncp_lock_ioctl) |
|---|
| 122 | |
|---|
| 123 | #define NCP_IOC_GETROOT _IOW('n', 8, struct ncp_setroot_ioctl) |
|---|
| 124 | #define NCP_IOC_SETROOT _IOR('n', 8, struct ncp_setroot_ioctl) |
|---|
| 125 | |
|---|
| 126 | #define NCP_IOC_GETOBJECTNAME _IOWR('n', 9, struct ncp_objectname_ioctl) |
|---|
| 127 | #define NCP_IOC_SETOBJECTNAME _IOR('n', 9, struct ncp_objectname_ioctl) |
|---|
| 128 | #define NCP_IOC_GETPRIVATEDATA _IOWR('n', 10, struct ncp_privatedata_ioctl) |
|---|
| 129 | #define NCP_IOC_SETPRIVATEDATA _IOR('n', 10, struct ncp_privatedata_ioctl) |
|---|
| 130 | |
|---|
| 131 | #define NCP_IOC_GETCHARSETS _IOWR('n', 11, struct ncp_nls_ioctl) |
|---|
| 132 | #define NCP_IOC_SETCHARSETS _IOR('n', 11, struct ncp_nls_ioctl) |
|---|
| 133 | |
|---|
| 134 | #define NCP_IOC_GETDENTRYTTL _IOW('n', 12, __u32) |
|---|
| 135 | #define NCP_IOC_SETDENTRYTTL _IOR('n', 12, __u32) |
|---|
| 136 | |
|---|
| 137 | /* |
|---|
| 138 | * The packet size to allocate. One page should be enough. |
|---|
| 139 | */ |
|---|
| 140 | #define NCP_PACKET_SIZE 4070 |
|---|
| 141 | |
|---|
| 142 | #define NCP_MAXPATHLEN 255 |
|---|
| 143 | #define NCP_MAXNAMELEN 14 |
|---|
| 144 | |
|---|
| 145 | |
|---|
| 146 | #endif /* _LINUX_NCP_FS_H */ |
|---|