Import 2.3.40pre5
[davej-history.git] / include / linux / ncp_fs_sb.h
blobfbb1537b3fc225e5693c855e29d20292d6ceb907
1 /*
2 * ncp_fs_sb.h
4 * Copyright (C) 1995, 1996 by Volker Lendecke
6 */
8 #ifndef _NCP_FS_SB
9 #define _NCP_FS_SB
11 #include <linux/types.h>
12 #include <linux/ncp_mount.h>
14 #ifdef __KERNEL__
16 #define NCP_DEFAULT_BUFSIZE 1024
17 #define NCP_DEFAULT_OPTIONS 0 /* 2 for packet signatures */
19 struct ncp_server {
21 struct ncp_mount_data_kernel m; /* Nearly all of the mount data is of
22 interest for us later, so we store
23 it completely. */
25 __u8 name_space[NCP_NUMBER_OF_VOLUMES + 2];
27 struct file *ncp_filp; /* File pointer to ncp socket */
29 u8 sequence;
30 u8 task;
31 u16 connection; /* Remote connection number */
33 u8 completion; /* Status message from server */
34 u8 conn_status; /* Bit 4 = 1 ==> Server going down, no
35 requests allowed anymore.
36 Bit 0 = 1 ==> Server is down. */
38 int buffer_size; /* Negotiated bufsize */
40 int reply_size; /* Size of last reply */
42 int packet_size;
43 unsigned char *packet; /* Here we prepare requests and
44 receive replies */
46 int lock; /* To prevent mismatch in protocols. */
47 struct semaphore sem;
49 int current_size; /* for packet preparation */
50 int has_subfunction;
51 int ncp_reply_size;
53 int root_setuped;
55 /* info for packet signing */
56 int sign_wanted; /* 1=Server needs signed packets */
57 int sign_active; /* 0=don't do signing, 1=do */
58 char sign_root[8]; /* generated from password and encr. key */
59 char sign_last[16];
61 /* Authentication info: NDS or BINDERY, username */
62 struct {
63 int auth_type;
64 size_t object_name_len;
65 void* object_name;
66 int object_type;
67 } auth;
68 /* Password info */
69 struct {
70 size_t len;
71 void* data;
72 } priv;
74 /* nls info: codepage for volume and charset for I/O */
75 struct nls_table *nls_vol;
76 struct nls_table *nls_io;
78 /* maximum age in jiffies */
79 int dentry_ttl;
81 /* miscellaneous */
82 unsigned int flags;
85 #define ncp_sb_info ncp_server
87 #define NCP_FLAG_UTF8 1
89 #define NCP_CLR_FLAG(server, flag) ((server)->flags &= ~(flag))
90 #define NCP_SET_FLAG(server, flag) ((server)->flags |= (flag))
91 #define NCP_IS_FLAG(server, flag) ((server)->flags & (flag))
93 static inline int ncp_conn_valid(struct ncp_server *server)
95 return ((server->conn_status & 0x11) == 0);
98 static inline void ncp_invalidate_conn(struct ncp_server *server)
100 server->conn_status |= 0x01;
103 #endif /* __KERNEL__ */
105 #endif