aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsglob.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/cifsglob.h')
-rw-r--r--fs/cifs/cifsglob.h70
1 files changed, 46 insertions, 24 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 006eb33bff5f..87453a6bcaf8 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -88,7 +88,8 @@ enum statusEnum {
88}; 88};
89 89
90enum securityEnum { 90enum securityEnum {
91 NTLM = 0, /* Legacy NTLM012 auth with NTLM hash */ 91 LANMAN = 0, /* Legacy LANMAN auth */
92 NTLM, /* Legacy NTLM012 auth with NTLM hash */
92 NTLMv2, /* Legacy NTLM auth with NTLMv2 hash */ 93 NTLMv2, /* Legacy NTLM auth with NTLMv2 hash */
93 RawNTLMSSP, /* NTLMSSP without SPNEGO */ 94 RawNTLMSSP, /* NTLMSSP without SPNEGO */
94 NTLMSSP, /* NTLMSSP via SPNEGO */ 95 NTLMSSP, /* NTLMSSP via SPNEGO */
@@ -157,7 +158,7 @@ struct TCP_Server_Info {
157 /* 16th byte of RFC1001 workstation name is always null */ 158 /* 16th byte of RFC1001 workstation name is always null */
158 char workstation_RFC1001_name[SERVER_NAME_LEN_WITH_NULL]; 159 char workstation_RFC1001_name[SERVER_NAME_LEN_WITH_NULL];
159 __u32 sequence_number; /* needed for CIFS PDU signature */ 160 __u32 sequence_number; /* needed for CIFS PDU signature */
160 char mac_signing_key[CIFS_SESSION_KEY_SIZE + 16]; 161 char mac_signing_key[CIFS_SESS_KEY_SIZE + 16];
161}; 162};
162 163
163/* 164/*
@@ -179,7 +180,9 @@ struct cifsUidInfo {
179struct cifsSesInfo { 180struct cifsSesInfo {
180 struct list_head cifsSessionList; 181 struct list_head cifsSessionList;
181 struct semaphore sesSem; 182 struct semaphore sesSem;
183#if 0
182 struct cifsUidInfo *uidInfo; /* pointer to user info */ 184 struct cifsUidInfo *uidInfo; /* pointer to user info */
185#endif
183 struct TCP_Server_Info *server; /* pointer to server info */ 186 struct TCP_Server_Info *server; /* pointer to server info */
184 atomic_t inUse; /* # of mounts (tree connections) on this ses */ 187 atomic_t inUse; /* # of mounts (tree connections) on this ses */
185 enum statusEnum status; 188 enum statusEnum status;
@@ -194,7 +197,7 @@ struct cifsSesInfo {
194 char serverName[SERVER_NAME_LEN_WITH_NULL * 2]; /* BB make bigger for 197 char serverName[SERVER_NAME_LEN_WITH_NULL * 2]; /* BB make bigger for
195 TCP names - will ipv6 and sctp addresses fit? */ 198 TCP names - will ipv6 and sctp addresses fit? */
196 char userName[MAX_USERNAME_SIZE + 1]; 199 char userName[MAX_USERNAME_SIZE + 1];
197 char domainName[MAX_USERNAME_SIZE + 1]; 200 char * domainName;
198 char * password; 201 char * password;
199}; 202};
200/* session flags */ 203/* session flags */
@@ -209,12 +212,12 @@ struct cifsTconInfo {
209 struct list_head openFileList; 212 struct list_head openFileList;
210 struct semaphore tconSem; 213 struct semaphore tconSem;
211 struct cifsSesInfo *ses; /* pointer to session associated with */ 214 struct cifsSesInfo *ses; /* pointer to session associated with */
212 char treeName[MAX_TREE_SIZE + 1]; /* UNC name of resource (in ASCII not UTF) */ 215 char treeName[MAX_TREE_SIZE + 1]; /* UNC name of resource in ASCII */
213 char *nativeFileSystem; 216 char *nativeFileSystem;
214 __u16 tid; /* The 2 byte tree id */ 217 __u16 tid; /* The 2 byte tree id */
215 __u16 Flags; /* optional support bits */ 218 __u16 Flags; /* optional support bits */
216 enum statusEnum tidStatus; 219 enum statusEnum tidStatus;
217 atomic_t useCount; /* how many mounts (explicit or implicit) to this share */ 220 atomic_t useCount; /* how many explicit/implicit mounts to share */
218#ifdef CONFIG_CIFS_STATS 221#ifdef CONFIG_CIFS_STATS
219 atomic_t num_smbs_sent; 222 atomic_t num_smbs_sent;
220 atomic_t num_writes; 223 atomic_t num_writes;
@@ -254,7 +257,7 @@ struct cifsTconInfo {
254 spinlock_t stat_lock; 257 spinlock_t stat_lock;
255#endif /* CONFIG_CIFS_STATS */ 258#endif /* CONFIG_CIFS_STATS */
256 FILE_SYSTEM_DEVICE_INFO fsDevInfo; 259 FILE_SYSTEM_DEVICE_INFO fsDevInfo;
257 FILE_SYSTEM_ATTRIBUTE_INFO fsAttrInfo; /* ok if file system name truncated */ 260 FILE_SYSTEM_ATTRIBUTE_INFO fsAttrInfo; /* ok if fs name truncated */
258 FILE_SYSTEM_UNIX_INFO fsUnixInfo; 261 FILE_SYSTEM_UNIX_INFO fsUnixInfo;
259 unsigned retry:1; 262 unsigned retry:1;
260 unsigned nocase:1; 263 unsigned nocase:1;
@@ -305,7 +308,6 @@ struct cifsFileInfo {
305 atomic_t wrtPending; /* handle in use - defer close */ 308 atomic_t wrtPending; /* handle in use - defer close */
306 struct semaphore fh_sem; /* prevents reopen race after dead ses*/ 309 struct semaphore fh_sem; /* prevents reopen race after dead ses*/
307 char * search_resume_name; /* BB removeme BB */ 310 char * search_resume_name; /* BB removeme BB */
308 unsigned int resume_name_length; /* BB removeme - field renamed and moved BB */
309 struct cifs_search_info srch_inf; 311 struct cifs_search_info srch_inf;
310}; 312};
311 313
@@ -391,9 +393,9 @@ struct mid_q_entry {
391 struct smb_hdr *resp_buf; /* response buffer */ 393 struct smb_hdr *resp_buf; /* response buffer */
392 int midState; /* wish this were enum but can not pass to wait_event */ 394 int midState; /* wish this were enum but can not pass to wait_event */
393 __u8 command; /* smb command code */ 395 __u8 command; /* smb command code */
394 unsigned multiPart:1; /* multiple responses to one SMB request */
395 unsigned largeBuf:1; /* if valid response, is pointer to large buf */ 396 unsigned largeBuf:1; /* if valid response, is pointer to large buf */
396 unsigned multiResp:1; /* multiple trans2 responses for one request */ 397 unsigned multiRsp:1; /* multiple trans2 responses for one request */
398 unsigned multiEnd:1; /* both received */
397}; 399};
398 400
399struct oplock_q_entry { 401struct oplock_q_entry {
@@ -430,15 +432,35 @@ struct dir_notify_req {
430#define CIFS_LARGE_BUFFER 2 432#define CIFS_LARGE_BUFFER 2
431#define CIFS_IOVEC 4 /* array of response buffers */ 433#define CIFS_IOVEC 4 /* array of response buffers */
432 434
433/* Type of session setup needed */ 435/* Security Flags: indicate type of session setup needed */
434#define CIFS_PLAINTEXT 0 436#define CIFSSEC_MAY_SIGN 0x00001
435#define CIFS_LANMAN 1 437#define CIFSSEC_MAY_NTLM 0x00002
436#define CIFS_NTLM 2 438#define CIFSSEC_MAY_NTLMV2 0x00004
437#define CIFS_NTLMSSP_NEG 3 439#define CIFSSEC_MAY_KRB5 0x00008
438#define CIFS_NTLMSSP_AUTH 4 440#ifdef CONFIG_CIFS_WEAK_PW_HASH
439#define CIFS_SPNEGO_INIT 5 441#define CIFSSEC_MAY_LANMAN 0x00010
440#define CIFS_SPNEGO_TARG 6 442#define CIFSSEC_MAY_PLNTXT 0x00020
441 443#endif /* weak passwords */
444#define CIFSSEC_MAY_SEAL 0x00040 /* not supported yet */
445
446#define CIFSSEC_MUST_SIGN 0x01001
447/* note that only one of the following can be set so the
448result of setting MUST flags more than once will be to
449require use of the stronger protocol */
450#define CIFSSEC_MUST_NTLM 0x02002
451#define CIFSSEC_MUST_NTLMV2 0x04004
452#define CIFSSEC_MUST_KRB5 0x08008
453#ifdef CONFIG_CIFS_WEAK_PW_HASH
454#define CIFSSEC_MUST_LANMAN 0x10010
455#define CIFSSEC_MUST_PLNTXT 0x20020
456#define CIFSSEC_MASK 0x37037 /* current flags supported if weak */
457#else
458#define CIFSSEC_MASK 0x07007 /* flags supported if no weak config */
459#endif /* WEAK_PW_HASH */
460#define CIFSSEC_MUST_SEAL 0x40040 /* not supported yet */
461
462#define CIFSSEC_DEF CIFSSEC_MAY_SIGN | CIFSSEC_MAY_NTLM | CIFSSEC_MAY_NTLMV2
463#define CIFSSEC_MAX CIFSSEC_MUST_SIGN | CIFSSEC_MUST_NTLMV2
442/* 464/*
443 ***************************************************************** 465 *****************************************************************
444 * All constants go here 466 * All constants go here
@@ -500,16 +522,16 @@ GLOBAL_EXTERN rwlock_t GlobalSMBSeslock; /* protects list inserts on 3 above */
500GLOBAL_EXTERN struct list_head GlobalOplock_Q; 522GLOBAL_EXTERN struct list_head GlobalOplock_Q;
501 523
502GLOBAL_EXTERN struct list_head GlobalDnotifyReqList; /* Outstanding dir notify requests */ 524GLOBAL_EXTERN struct list_head GlobalDnotifyReqList; /* Outstanding dir notify requests */
503GLOBAL_EXTERN struct list_head GlobalDnotifyRsp_Q; /* Dir notify response queue */ 525GLOBAL_EXTERN struct list_head GlobalDnotifyRsp_Q;/* DirNotify response queue */
504 526
505/* 527/*
506 * Global transaction id (XID) information 528 * Global transaction id (XID) information
507 */ 529 */
508GLOBAL_EXTERN unsigned int GlobalCurrentXid; /* protected by GlobalMid_Sem */ 530GLOBAL_EXTERN unsigned int GlobalCurrentXid; /* protected by GlobalMid_Sem */
509GLOBAL_EXTERN unsigned int GlobalTotalActiveXid; /* prot by GlobalMid_Sem */ 531GLOBAL_EXTERN unsigned int GlobalTotalActiveXid; /* prot by GlobalMid_Sem */
510GLOBAL_EXTERN unsigned int GlobalMaxActiveXid; /* prot by GlobalMid_Sem */ 532GLOBAL_EXTERN unsigned int GlobalMaxActiveXid; /* prot by GlobalMid_Sem */
511GLOBAL_EXTERN spinlock_t GlobalMid_Lock; /* protects above and list operations */ 533GLOBAL_EXTERN spinlock_t GlobalMid_Lock; /* protects above & list operations */
512 /* on midQ entries */ 534 /* on midQ entries */
513GLOBAL_EXTERN char Local_System_Name[15]; 535GLOBAL_EXTERN char Local_System_Name[15];
514 536
515/* 537/*
@@ -531,7 +553,7 @@ GLOBAL_EXTERN atomic_t smBufAllocCount;
531GLOBAL_EXTERN atomic_t midCount; 553GLOBAL_EXTERN atomic_t midCount;
532 554
533/* Misc globals */ 555/* Misc globals */
534GLOBAL_EXTERN unsigned int multiuser_mount; /* if enabled allows new sessions 556GLOBAL_EXTERN unsigned int multiuser_mount; /* if enabled allows new sessions
535 to be established on existing mount if we 557 to be established on existing mount if we
536 have the uid/password or Kerberos credential 558 have the uid/password or Kerberos credential
537 or equivalent for current user */ 559 or equivalent for current user */
@@ -540,8 +562,8 @@ GLOBAL_EXTERN unsigned int experimEnabled;
540GLOBAL_EXTERN unsigned int lookupCacheEnabled; 562GLOBAL_EXTERN unsigned int lookupCacheEnabled;
541GLOBAL_EXTERN unsigned int extended_security; /* if on, session setup sent 563GLOBAL_EXTERN unsigned int extended_security; /* if on, session setup sent
542 with more secure ntlmssp2 challenge/resp */ 564 with more secure ntlmssp2 challenge/resp */
543GLOBAL_EXTERN unsigned int ntlmv2_support; /* better optional password hash */
544GLOBAL_EXTERN unsigned int sign_CIFS_PDUs; /* enable smb packet signing */ 565GLOBAL_EXTERN unsigned int sign_CIFS_PDUs; /* enable smb packet signing */
566GLOBAL_EXTERN unsigned int secFlags;
545GLOBAL_EXTERN unsigned int linuxExtEnabled;/*enable Linux/Unix CIFS extensions*/ 567GLOBAL_EXTERN unsigned int linuxExtEnabled;/*enable Linux/Unix CIFS extensions*/
546GLOBAL_EXTERN unsigned int CIFSMaxBufSize; /* max size not including hdr */ 568GLOBAL_EXTERN unsigned int CIFSMaxBufSize; /* max size not including hdr */
547GLOBAL_EXTERN unsigned int cifs_min_rcv; /* min size of big ntwrk buf pool */ 569GLOBAL_EXTERN unsigned int cifs_min_rcv; /* min size of big ntwrk buf pool */