#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
* 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;
/*
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;
GID_T *groups;
};
-typedef struct
+typedef struct files_struct
{
+ struct files_struct *next, *prev;
int fnum;
connection_struct *conn;
file_fd_struct *fd_ptr;
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
{
} def;
};
+struct bitmap {
+ uint32 *b;
+ int n;
+};
#define FLAG_BASIC 1 /* fundamental options */
#define FLAG_HIDE 2 /* options that should be hidden in SWAT */
/* 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)
#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))
extern int dcelogin_atmost_once;
#endif
-#if AJT
-void ajt_panic(void);
-#endif
-
#ifdef NOSTRDUP
char *strdup(char *s);
#endif
#define CMD_REPLY 0x8000
+/* useful macros */
+#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
+
#endif /* _SMB_H */
#include "ntdomain.h"