summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/local.h5
-rw-r--r--source3/include/proto.h7
-rw-r--r--source3/include/smb.h41
3 files changed, 52 insertions, 1 deletions
diff --git a/source3/include/local.h b/source3/include/local.h
index 9548bf74b6..e7eff2a300 100644
--- a/source3/include/local.h
+++ b/source3/include/local.h
@@ -159,4 +159,9 @@
/* the directory to sit in when idle */
/* #define IDLE_DIR "/" */
+/* Timout (in seconds) to wait for an oplock breal
+ message to return. */
+
+#define OPLOCK_BREAK_TIMEOUT 120
+
#endif
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 8903437d00..7a1ccc626f 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -719,6 +719,9 @@ int find_service(char *service);
int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line);
int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line);
int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line);
+BOOL oplock_break(uint32 dev, uint32 inode);
+BOOL request_oplock_break(min_share_mode_entry *share_entry,
+ uint32 dev, uint32 inode);
BOOL snum_used(int snum);
BOOL reload_services(BOOL test);
int setup_groups(char *user, int uid, int gid, int *p_ngroups,
@@ -925,7 +928,9 @@ int read_data(int fd,char *buffer,int N);
int write_data(int fd,char *buffer,int N);
int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align);
int read_smb_length(int fd,char *inbuf,int timeout);
-BOOL receive_smb(int fd,char *buffer,int timeout);
+BOOL receive_smb(int fd,char *buffer, int timeout);
+BOOL receive_local_message(int fd, char *buffer, int buffer_len, int timeout);
+BOOL push_local_message(char *buf, int msg_len);
BOOL receive_message_or_smb(int smbfd, int oplock_fd,
char *buffer, int buffer_len,
int timeout, BOOL *got_smb);
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 07614194f7..c8de001fda 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -1014,6 +1014,17 @@ extern int unix_ERR_code;
#define EXTENDED_OPLOCK_REQUEST(inbuf) (((SVAL(inbuf,smb_vwv2)|(1<<1))>>1) | \
((SVAL(inbuf,smb_vwv2)|(1<<2))>>1))
+/* Lock types. */
+#define LOCKING_ANDX_SHARED_LOCK 0x1
+#define LOCKING_ANDX_OPLOCK_RELEASE 0x2
+#define LOCKING_ANDX_CHANGE_LOCKTYPE 0x4
+#define LOCKING_ANDX_CANCEL_LOCK 0x8
+#define LOCKING_ANDX_LARGE_FILES 0x10
+
+/* Oplock levels */
+#define OPLOCKLEVEL_NONE 0
+#define OPLOCKLEVEL_II 1
+
/*
* Bits we test with.
*/
@@ -1023,4 +1034,34 @@ extern int unix_ERR_code;
#define CORE_OPLOCK_GRANTED (1<<5)
#define EXTENDED_OPLOCK_GRANTED (1<<15)
+/*
+ * Loopback command offsets.
+ */
+
+#define UDP_CMD_LEN_OFFSET 0
+#define UDP_CMD_PORT_OFFSET 4
+#define UDP_CMD_HEADER_LEN 6
+
+#define UDP_MESSAGE_CMD_OFFSET 0
+
+/*
+ * Oplock break command code to send over the udp socket.
+ *
+ * Form of this is :
+ *
+ * 0 2 6 10
+ * +----+--------+--------+--------+
+ * | cmd| pid | 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_MSG_LEN 14
+
+
+#define CMD_REPLY 0x8000
+
/* _SMB_H */