summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/proto.h10
-rw-r--r--source3/include/smb.h50
2 files changed, 52 insertions, 8 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 46a96a8bef..8903437d00 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -299,13 +299,13 @@ BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token tok
int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode,
min_share_mode_entry **old_shares);
void del_share_mode(share_lock_token token, int fnum);
-BOOL set_share_mode(share_lock_token token, int fnum, uint16 port);
+BOOL set_share_mode(share_lock_token token, int fnum, uint16 port, uint16 op_type);
BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok);
BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token);
int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode,
min_share_mode_entry **old_shares);
void del_share_mode(share_lock_token token, int fnum);
-BOOL set_share_mode(share_lock_token token,int fnum, uint16 port);
+BOOL set_share_mode(share_lock_token token,int fnum, uint16 port, uint16 op_type);
/*The following definitions come from mangle.c */
@@ -707,8 +707,10 @@ int fd_attempt_close(file_fd_struct *fd_ptr);
void sync_file(int fnum);
void close_file(int fnum);
BOOL check_file_sharing(int cnum,char *fname);
+int check_share_mode( min_share_mode_entry *share, int deny_mode, char *fname,
+ BOOL fcbopen, int *flags);
void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun,
- int mode,int *Access,int *action);
+ int mode,int oplock_request, int *Access,int *action);
int seek_file(int fnum,uint32 pos);
int read_file(int fnum,char *data,uint32 pos,int n);
int write_file(int fnum,char *data,int n);
@@ -979,3 +981,5 @@ void file_unlock(int fd);
BOOL is_myname(char *s);
void set_remote_arch(enum remote_arch_types type);
enum remote_arch_types get_remote_arch();
+void fstrcpy(char *dest, char *src);
+void pstrcpy(char *dest, char *src);
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 435b71f4db..07614194f7 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -330,6 +330,7 @@ typedef struct
BOOL share_mode;
BOOL print_file;
BOOL modified;
+ BOOL granted_oplock;
char *name;
} files_struct;
@@ -454,6 +455,7 @@ typedef struct
int pid;
#ifdef USE_OPLOCKS
uint16 op_port;
+ uint16 op_type;
#endif /* USE_OPLOCKS */
int share_mode;
struct timeval time;
@@ -465,6 +467,7 @@ typedef struct
int pid;
#ifdef USE_OPLOCKS
uint16 op_port;
+ uint16 op_type;
#endif /* USE_OPLOCKS */
int share_mode;
struct timeval time;
@@ -514,7 +517,7 @@ struct connect_record
#ifdef USE_OPLOCKS
#define SMF_ENTRY_LENGTH 16
#else /* USE_OPLOCKS */
-#define SMF_ENTRY_LENGTH 18
+#define SMF_ENTRY_LENGTH 20
#endif /* USE_OPLOCKS */
/*
@@ -528,6 +531,7 @@ struct connect_record
#ifdef USE_OPLOCKS
#define SME_PORT_OFFSET 16
+#define SME_OPLOCK_TYPE_OFFSET 18
#endif /* USE_OPLOCKS */
#endif /* FAST_SHARE_MODES */
@@ -971,16 +975,52 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
#define KANJI_CODEPAGE 932
#ifdef KANJI
-/* Default client code page - Japanese */
+/*
+ * Default client code page - Japanese
+ */
#define DEFAULT_CLIENT_CODE_PAGE KANJI_CODEPAGE
#else /* KANJI */
-/* Default client code page - 850 - Western European */
+/*
+ * Default client code page - 850 - Western European
+ */
#define DEFAULT_CLIENT_CODE_PAGE 850
#endif /* KANJI */
-/* Size of buffer to use when moving files across filesystems. */
+
+/*
+ * Size of buffer to use when moving files across filesystems.
+ */
#define COPYBUF_SIZE (8*1024)
-/* Integers used to override error codes. */
+/*
+ * Integers used to override error codes.
+ */
extern int unix_ERR_class;
extern int unix_ERR_code;
+
+/*
+ * Map the Core and Extended Oplock requesst bits down
+ * to common bits (EXCLUSIVE_OPLOCK & BATCH_OPLOCK).
+ */
+
+/*
+ * Core protocol.
+ */
+#define CORE_OPLOCK_REQUEST(inbuf) (((CVAL(inbuf,smb_flg)|(1<<5))>>5) | \
+ ((CVAL(inbuf,smb_flg)|(1<<6))>>5))
+
+/*
+ * Extended protocol.
+ */
+#define EXTENDED_OPLOCK_REQUEST(inbuf) (((SVAL(inbuf,smb_vwv2)|(1<<1))>>1) | \
+ ((SVAL(inbuf,smb_vwv2)|(1<<2))>>1))
+
+/*
+ * Bits we test with.
+ */
+#define EXCLUSIVE_OPLOCK 1
+#define BATCH_OPLOCK 2
+
+#define CORE_OPLOCK_GRANTED (1<<5)
+#define EXTENDED_OPLOCK_GRANTED (1<<15)
+
/* _SMB_H */