diff options
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/config.h.in | 6 | ||||
-rw-r--r-- | source3/include/includes.h | 45 | ||||
-rw-r--r-- | source3/include/proto.h | 12 | ||||
-rw-r--r-- | source3/include/smb.h | 53 |
4 files changed, 69 insertions, 47 deletions
diff --git a/source3/include/config.h.in b/source3/include/config.h.in index dd8e509fad..f67061a289 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -302,6 +302,9 @@ /* Define if you have the <netinet/tcp.h> header file. */ #undef HAVE_NETINET_TCP_H +/* Define if you have the <poll.h> header file. */ +#undef HAVE_POLL_H + /* Define if you have the <rpc/types.h> header file. */ #undef HAVE_RPC_TYPES_H @@ -338,6 +341,9 @@ /* Define if you have the <strings.h> header file. */ #undef HAVE_STRINGS_H +/* Define if you have the <stropts.h> header file. */ +#undef HAVE_STROPTS_H + /* Define if you have the <sys/dir.h> header file. */ #undef HAVE_SYS_DIR_H diff --git a/source3/include/includes.h b/source3/include/includes.h index 4efa475424..8b7620e4f9 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -260,6 +260,14 @@ #include <compat.h> #endif +#ifdef HAVE_STROPTS_H +#include <stropts.h> +#endif + +#ifdef HAVE_POLL_H +#include <poll.h> +#endif + #ifndef uchar #define uchar unsigned char #endif @@ -270,6 +278,31 @@ #define schar char #endif +/* + Samba needs type definitions for int16, int32, uint16 and uint32. + + Normally these are signed and unsigned 16 and 32 bit integers, but + they actually only need to be at least 16 and 32 bits + respectively. Thus if your word size is 8 bytes just defining them + as signed and unsigned int will work. +*/ + +#ifndef uint8 +#define uint8 unsigned char +#endif + +#ifndef int16 +#if (SIZEOF_SHORT == 4) +#define int16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16; +#else /* SIZEOF_SHORT != 4 */ +#define int16 short +#endif /* SIZEOF_SHORT != 4 */ +#endif + +#ifndef uint16 +#define uint16 unsigned int16 +#endif + #ifndef int32 #if (SIZEOF_INT == 4) #define int32 int @@ -284,6 +317,18 @@ #define uint32 unsigned int32 #endif +/* + * Type for device and inodes. + */ + +#ifndef SMB_DEV_T +#define SMB_DEV_T uint32 +#endif + +#ifndef SMB_INO_T +#define SMB_INO_T uint32 +#endif + #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif diff --git a/source3/include/proto.h b/source3/include/proto.h index 8ee95483c5..3bc2a132a0 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -498,11 +498,11 @@ BOOL do_unlock(files_struct *fsp,connection_struct *conn, BOOL locking_init(int read_only); BOOL locking_end(void); BOOL lock_share_entry(connection_struct *conn, - uint32 dev, uint32 inode, int *ptok); + SMB_DEV_T dev, SMB_INO_T inode, int *ptok); BOOL unlock_share_entry(connection_struct *conn, - uint32 dev, uint32 inode, int token); + SMB_DEV_T dev, SMB_INO_T inode, int token); int get_share_modes(connection_struct *conn, - int token, uint32 dev, uint32 inode, + int token, SMB_DEV_T dev, SMB_INO_T inode, share_mode_entry **shares); void del_share_mode(int token, files_struct *fsp); BOOL set_share_mode(int token, files_struct *fsp, uint16 port, uint16 op_type); @@ -2027,7 +2027,7 @@ file_fd_struct *fd_get_new(void); void file_close_conn(connection_struct *conn); void file_init(void); void file_close_user(int vuid); -files_struct *file_find_dit(int dev, int inode, struct timeval *tval); +files_struct *file_find_dit(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval); files_struct *file_find_print(void); void file_sync_all(connection_struct *conn); void file_free(files_struct *fsp); @@ -2102,9 +2102,9 @@ int check_share_mode( share_mode_entry *share, int deny_mode, char *fname, BOOL open_oplock_ipc(void); BOOL process_local_message(int sock, char *buffer, int buf_size); -BOOL oplock_break(uint32 dev, uint32 inode, struct timeval *tval); +BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval); BOOL request_oplock_break(share_mode_entry *share_entry, - uint32 dev, uint32 inode); + SMB_DEV_T dev, SMB_INO_T inode); BOOL attempt_close_oplocked_file(files_struct *fsp); /*The following definitions come from smbd/password.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 90435b208e..b27c531937 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -48,35 +48,6 @@ typedef int BOOL; /* limiting size of ipc replies */ #define REALLOC(ptr,size) Realloc(ptr,MAX((size),4*1024)) -/* - Samba needs type definitions for int16, int32, uint16 and uint32. - - Normally these are signed and unsigned 16 and 32 bit integers, but - they actually only need to be at least 16 and 32 bits - respectively. Thus if your word size is 8 bytes just defining them - as signed and unsigned int will work. -*/ - -#ifndef uint8 -typedef unsigned char uint8; -#endif - -#ifndef uint16 -typedef unsigned short uint16; -#endif - -#ifndef uchar -#define uchar unsigned char -#endif - -#ifndef int16 -#define int16 short -#endif - -#ifndef uint16 -#define uint16 unsigned short -#endif - #define SIZEOFWORD 2 #ifndef DEF_CREATE_MASK @@ -507,8 +478,8 @@ typedef struct file_fd_struct uint16 ref_count; uint16 uid_cache_count; uid_t uid_users_cache[10]; - uint32 dev; - uint32 inode; + SMB_DEV_T dev; + SMB_INO_T inode; int fd; int fdnum; int fd_readonly; @@ -701,9 +672,9 @@ typedef struct to support the following operations */ struct share_ops { BOOL (*stop_mgmt)(void); - BOOL (*lock_entry)(connection_struct *, uint32 , uint32 , int *); - BOOL (*unlock_entry)(connection_struct *, uint32 , uint32 , int ); - int (*get_entries)(connection_struct *, int , uint32 , uint32 , share_mode_entry **); + BOOL (*lock_entry)(connection_struct *, SMB_DEV_T , SMB_INO_T , int *); + BOOL (*unlock_entry)(connection_struct *, SMB_DEV_T , SMB_INO_T , int ); + int (*get_entries)(connection_struct *, int , SMB_DEV_T , SMB_INO_T , share_mode_entry **); void (*del_entry)(int , files_struct *); BOOL (*set_entry)(int, files_struct *, uint16 , uint16 ); BOOL (*remove_oplock)(files_struct *, int); @@ -1551,19 +1522,19 @@ extern int unix_ERR_code; * * Form of this is : * - * 0 2 6 10 14 18 22 + * 0 2 6 10 14 14+devsize 14+devsize+inodesize * +----+--------+--------+--------+-------+--------+ - * | cmd| pid | dev | inode | sec | usec | + * | cmd| pid | sec | usec | dev | inode | * +----+--------+--------+--------+-------+--------+ */ #define OPLOCK_BREAK_CMD 0x1 #define OPLOCK_BREAK_PID_OFFSET 2 -#define OPLOCK_BREAK_DEV_OFFSET 6 -#define OPLOCK_BREAK_INODE_OFFSET 10 -#define OPLOCK_BREAK_SEC_OFFSET 14 -#define OPLOCK_BREAK_USEC_OFFSET 18 -#define OPLOCK_BREAK_MSG_LEN 22 +#define OPLOCK_BREAK_SEC_OFFSET 6 +#define OPLOCK_BREAK_USEC_OFFSET 10 +#define OPLOCK_BREAK_DEV_OFFSET 14 +#define OPLOCK_BREAK_INODE_OFFSET (OPLOCK_BREAK_DEV_OFFSET + sizeof(SMB_DEV_T)) +#define OPLOCK_BREAK_MSG_LEN (OPLOCK_BREAK_INODE_OFFSET + sizeof(SMB_INO_T)) #define CMD_REPLY 0x8000 |