diff options
author | Andrew Tridgell <tridge@samba.org> | 1999-07-14 13:06:36 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1999-07-14 13:06:36 +0000 |
commit | 9db19ffa0b7d5cf5bc9f7f0a597f3ac5e915548b (patch) | |
tree | be3f3b9a1fb7dd583d1be5319f4515747b53e848 | |
parent | 9070bb4d018391f32372c50e02cad474f110020e (diff) | |
download | samba-9db19ffa0b7d5cf5bc9f7f0a597f3ac5e915548b.tar.gz |
include changes to support the new stuff, particularly levelII
oplocks.
all taken from the 2.0 branch
-rw-r--r-- | source/include/client.h | 2 | ||||
-rw-r--r-- | source/include/includes.h | 24 | ||||
-rw-r--r-- | source/include/smb.h | 59 | ||||
-rw-r--r-- | source/include/version.h | 2 |
4 files changed, 50 insertions, 37 deletions
diff --git a/source/include/client.h b/source/include/client.h index 876dca8429d..15ba66e3e12 100644 --- a/source/include/client.h +++ b/source/include/client.h @@ -138,6 +138,8 @@ struct cli_state { fstring clnt_name_slash; /* \\local client. */ uint16 max_xmit_frag; uint16 max_recv_frag; + + BOOL use_oplocks; /* should we use oplocks? */ }; #endif /* _CLIENT_H */ diff --git a/source/include/includes.h b/source/include/includes.h index 1180f857609..5418b34450f 100644 --- a/source/include/includes.h +++ b/source/include/includes.h @@ -64,16 +64,9 @@ #endif -/* if we have both SYSV IPC and shared mmap then we need to choose. For most - systems it is much faster to use SYSV IPC, but under Linux it is - about 5 times faster to use fcntl, so for Linux systems we force - fcntl based locking */ +/* if we have both SYSV IPC and shared mmap then we need to choose */ #if (defined(USE_SYSV_IPC) && defined(USE_SHARED_MMAP)) -# ifdef LINUX -# undef USE_SYSV_IPC -# else # undef USE_SHARED_MMAP -# endif #endif #include <sys/types.h> @@ -221,7 +214,7 @@ #endif /* - * The next two defines are needed to the IPTOS_* options + * The next three defines are needed to access the IPTOS_* options * on some systems. */ @@ -230,6 +223,10 @@ #endif #ifdef HAVE_NETINET_IN_IP_H +#include <netinet/in_ip.h> +#endif + +#ifdef HAVE_NETINET_IP_H #include <netinet/ip.h> #endif @@ -843,4 +840,13 @@ int crypt(const char *key, const char *salt); /* yuck, I'd like a better way of doing this */ #define DIRP_SIZE (256 + 32) +/* + * glibc on linux doesn't seem to have MSG_WAITALL + * defined. I think the kernel has it though.. + */ + +#ifndef MSG_WAITALL +#define MSG_WAITALL 0 +#endif + #endif /* _INCLUDES_H */ diff --git a/source/include/smb.h b/source/include/smb.h index 764380ff5d1..8cbfc93279f 100644 --- a/source/include/smb.h +++ b/source/include/smb.h @@ -623,20 +623,25 @@ typedef struct files_struct struct timeval open_time; int share_mode; time_t pending_modtime; + int oplock_type; + int sent_oplock_break; BOOL open; BOOL can_lock; BOOL can_read; BOOL can_write; BOOL print_file; BOOL modified; - BOOL granted_oplock; - BOOL sent_oplock_break; BOOL is_directory; BOOL directory_delete_on_close; BOOL stat_open; char *fsp_name; } files_struct; +/* Defines for the sent_oplock_break field above. */ +#define NO_BREAK_SENT 0 +#define EXCLUSIVE_BREAK_SENT 1 +#define LEVEL_II_BREAK_SENT 2 + /* Domain controller authentication protocol info */ struct dcinfo { @@ -717,7 +722,7 @@ struct interface /* struct returned by get_share_modes */ typedef struct { - int pid; + pid_t pid; uint16 op_port; uint16 op_type; int share_mode; @@ -822,7 +827,7 @@ struct passdb_ops { struct connect_record { int magic; - int pid; + pid_t pid; int cnum; uid_t uid; gid_t gid; @@ -832,25 +837,6 @@ struct connect_record time_t start; }; -/* This is used by smbclient to send it to a smbfs mount point */ -struct connection_options { - int protocol; - /* Connection-Options */ - uint32 max_xmit; - uint16 server_vuid; - uint16 tid; - /* The following are LANMAN 1.0 options */ - uint16 sec_mode; - uint16 max_mux; - uint16 max_vcs; - uint16 rawmode; - uint32 sesskey; - /* The following are NT LM 0.12 options */ - uint32 maxraw; - uint32 capabilities; - uint16 serverzone; -}; - /* the following are used by loadparm for option lists */ typedef enum { @@ -1616,13 +1602,29 @@ extern int unix_ERR_code; /* * Bits we test with. */ + +#define NO_OPLOCK 0 #define EXCLUSIVE_OPLOCK 1 #define BATCH_OPLOCK 2 +#define LEVEL_II_OPLOCK 4 + +#define EXLUSIVE_OPLOCK_TYPE(lck) ((lck) & (EXCLUSIVE_OPLOCK|BATCH_OPLOCK)) +#define BATCH_OPLOCK_TYPE(lck) ((lck) & BATCH_OPLOCK) +#define LEVEL_II_OPLOCK_TYPE(lck) ((lck) & LEVEL_II_OPLOCK) #define CORE_OPLOCK_GRANTED (1<<5) #define EXTENDED_OPLOCK_GRANTED (1<<15) /* + * Return values for oplock types. + */ + +#define NO_OPLOCK_RETURN 0 +#define EXCLUSIVE_OPLOCK_RETURN 1 +#define BATCH_OPLOCK_RETURN 2 +#define LEVEL_II_OPLOCK_RETURN 3 + +/* * Loopback command offsets. */ @@ -1634,8 +1636,9 @@ extern int unix_ERR_code; /* * Oplock break command code to send over the udp socket. + * The same message is sent for both exlusive and level II breaks. * - * Form of this is : + * The form of this is : * * 0 2 6 10 14 14+devsize 14+devsize+inodesize * +----+--------+--------+--------+-------+--------+ @@ -1645,12 +1648,14 @@ extern int unix_ERR_code; #define OPLOCK_BREAK_CMD 0x1 #define OPLOCK_BREAK_PID_OFFSET 2 -#define OPLOCK_BREAK_SEC_OFFSET 6 -#define OPLOCK_BREAK_USEC_OFFSET 10 -#define OPLOCK_BREAK_DEV_OFFSET 14 +#define OPLOCK_BREAK_SEC_OFFSET (OPLOCK_BREAK_PID_OFFSET + sizeof(pid_t)) +#define OPLOCK_BREAK_USEC_OFFSET (OPLOCK_BREAK_SEC_OFFSET + sizeof(time_t)) +#define OPLOCK_BREAK_DEV_OFFSET (OPLOCK_BREAK_USEC_OFFSET + sizeof(long)) #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 LEVEL_II_OPLOCK_BREAK_CMD 0x3 + /* * Capabilities abstracted for different systems. */ diff --git a/source/include/version.h b/source/include/version.h index c3feadab634..05f7828ffd8 100644 --- a/source/include/version.h +++ b/source/include/version.h @@ -1 +1 @@ -#define VERSION "2.0.4c" +#define VERSION "pre-2.0.5" |