added new smb.conf option "panic action". see my samba-technical
[samba.git] / source3 / include / smb.h
index 801e1344354936dc69e8a17f7cd0e5fddf1fd588..a11a3ac61f1f45f4ff9a26c7c96e5f8df637cbc8 100644 (file)
@@ -200,6 +200,13 @@ implemented */
 #define aDIR (1L<<4)
 #define aARCH (1L<<5)
 
+/* for readability... */
+#define IS_DOS_READONLY(test_mode) (((test_mode) & aRONLY) != 0)
+#define IS_DOS_DIR(test_mode) (((test_mode) & aDIR) != 0)
+#define IS_DOS_ARCHIVE(test_mode) (((test_mode) & aARCH) != 0)
+#define IS_DOS_SYSTEM(test_mode) (((test_mode) & aSYSTEM) != 0)
+#define IS_DOS_HIDDEN(test_mode) (((test_mode) & aHIDDEN) != 0)
+
 /* deny modes */
 #define DENY_DOS 0
 #define DENY_ALL 1
@@ -494,17 +501,19 @@ typedef struct
  * file descriptor and process.
  */
 
-typedef struct
+typedef struct file_fd_struct
 {
-  uint16 ref_count;
-  uint16 uid_cache_count;
-  uid_t uid_users_cache[10];
-  uint32 dev;
-  uint32 inode;
-  int fd;
-  int fd_readonly;
-  int fd_writeonly;
-  int real_open_flags;
+       struct file_fd_struct *next, *prev;
+       uint16 ref_count;
+       uint16 uid_cache_count;
+       uid_t uid_users_cache[10];
+       uint32 dev;
+       uint32 inode;
+       int fd;
+       int fdnum;
+       int fd_readonly;
+       int fd_writeonly;
+       int real_open_flags;
 } file_fd_struct;
 
 /*
@@ -529,14 +538,14 @@ typedef struct
   BOOL is_wild;
 } name_compare_entry;
 
-typedef struct
+typedef struct connection_struct
 {
+       struct connection_struct *next, *prev;
        unsigned cnum; /* an index passed over the wire */
        int service;
        BOOL force_user;
        struct uid_cache uid_cache;
        void *dirptr;
-       BOOL open;
        BOOL printer;
        BOOL ipc;
        BOOL read_only;
@@ -573,8 +582,9 @@ struct current_user
        GID_T *groups;
 };
 
-typedef struct
+typedef struct files_struct
 {
+       struct files_struct *next, *prev;
        int fnum;
        connection_struct *conn;
        file_fd_struct *fd_ptr;
@@ -596,15 +606,9 @@ typedef struct
        BOOL granted_oplock;
        BOOL sent_oplock_break;
        BOOL is_directory;
-       BOOL reserved;
        char *fsp_name;
 } files_struct;
 
-/* this macro should always be used to extract an fnum (smb_fid) from
-   a packet to ensure chaining works correctly */
-#define GETFSP(buf,where) (chain_fsp?chain_fsp:file_fsp(SVAL(buf,where)))
-
-
 /* Domain controller authentication protocol info */
 struct dcinfo
 {
@@ -852,6 +856,10 @@ struct parm_struct
        } def;
 };
 
+struct bitmap {
+       uint32 *b;
+       int n;
+};
 
 #define FLAG_BASIC 1 /* fundamental options */
 #define FLAG_HIDE  2 /* options that should be hidden in SWAT */
@@ -864,7 +872,6 @@ struct parm_struct
 
 /* these are useful macros for checking validity of handles */
 #define OPEN_FSP(fsp)    ((fsp) && (fsp)->open && !(fsp)->is_directory)
-#define VALID_CNUM(cnum)   (((cnum) >= 0) && ((cnum) < MAX_CONNECTIONS))
 #define OPEN_CONN(conn)    ((conn) && (conn)->open)
 #define IS_IPC(conn)       ((conn) && (conn)->ipc)
 #define IS_PRINT(conn)       ((conn) && (conn)->printer)
@@ -887,7 +894,7 @@ struct parm_struct
 #define PRINTCAP           (lp_printcapname())
 #define PRINTCOMMAND(snum) (lp_printcommand(snum))
 #define PRINTERNAME(snum)  (lp_printername(snum))
-#define CAN_WRITE(conn)    (OPEN_CONN(conn) && !conn->read_only)
+#define CAN_WRITE(conn)    (!conn->read_only)
 #define VALID_SNUM(snum)   (lp_snum_ok(snum))
 #define GUEST_OK(snum)     (VALID_SNUM(snum) && lp_guest_ok(snum))
 #define GUEST_ONLY(snum)   (VALID_SNUM(snum) && lp_guest_only(snum))
@@ -1258,10 +1265,6 @@ void dfs_unlogin(void);
 extern int dcelogin_atmost_once;
 #endif
 
-#if AJT
-void ajt_panic(void);
-#endif
-
 #ifdef NOSTRDUP
 char *strdup(char *s);
 #endif
@@ -1556,6 +1559,9 @@ extern int unix_ERR_code;
 
 #define CMD_REPLY 0x8000
 
+/* useful macros */
+#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
+
 #endif /* _SMB_H */
 
 #include "ntdomain.h"