summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-01-17 16:23:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:13 -0500
commit940192ddcc9d23e3bec806b4419d5845eeac0fd0 (patch)
tree60d01078e1fd8f017e5245179d99a7b1bc8b6a12 /source3/include
parentb385a40f592ae7e9962f4034e9cbe66352681e2c (diff)
downloadsamba-940192ddcc9d23e3bec806b4419d5845eeac0fd0.tar.gz
samba-940192ddcc9d23e3bec806b4419d5845eeac0fd0.tar.bz2
samba-940192ddcc9d23e3bec806b4419d5845eeac0fd0.zip
r20854: Ok, now I think we're at a point where looking at notify starts to make sense
again :-) Volker (This used to be commit 5533cdeec1b0cdee39b1d89e2320587dc9281ee6)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/messages.h1
-rw-r--r--source3/include/smb.h61
2 files changed, 59 insertions, 3 deletions
diff --git a/source3/include/messages.h b/source3/include/messages.h
index 7b948e012e..1c01ba08c2 100644
--- a/source3/include/messages.h
+++ b/source3/include/messages.h
@@ -71,6 +71,7 @@
#define MSG_SMB_FILE_RENAME 3011
#define MSG_SMB_INJECT_FAULT 3012
#define MSG_SMB_BLOCKING_LOCK_CANCEL 3013
+#define MSG_SMB_NOTIFY 3014
/* winbind messages */
#define MSG_WINBIND_FINISHED 4001
diff --git a/source3/include/smb.h b/source3/include/smb.h
index c03fdd89e4..fc3acf6d6c 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -434,6 +434,49 @@ struct vfs_fsp_data {
*/
};
+/* the basic packet size, assuming no words or bytes */
+#define smb_size 39
+
+struct notify_change {
+ uint32_t action;
+ char *name;
+};
+
+struct notify_change_request {
+ struct notify_change_request *prev, *next;
+ struct files_struct *fsp; /* backpointer for cancel by mid */
+ char request_buf[smb_size];
+ uint32 filter;
+ uint32 max_param_count;
+ struct notify_mid_map *mid_map;
+};
+
+/*
+ * For NTCancel, we need to find the notify_change_request indexed by
+ * mid. Separate list here.
+ */
+
+struct notify_mid_map {
+ struct notify_mid_map *prev, *next;
+ struct notify_change_request *req;
+ uint16 mid;
+};
+
+struct notify_change_buf {
+ /*
+ * If no requests are pending, changes are queued here. Simple array,
+ * we only append.
+ */
+ unsigned num_changes;
+ struct notify_change *changes;
+
+ /*
+ * If no changes are around requests are queued here. Using a linked
+ * list, because we have to append at the end and delete from the top.
+ */
+ struct notify_change_request *requests;
+};
+
typedef struct files_struct {
struct files_struct *next, *prev;
int fnum;
@@ -476,6 +519,8 @@ typedef struct files_struct {
struct vfs_fsp_data *vfs_extension;
FAKE_FILE_HANDLE *fake_file_handle;
+
+ struct notify_change_buf *notify;
} files_struct;
#include "ntquotas.h"
@@ -885,9 +930,6 @@ struct bitmap {
unsigned int n;
};
-/* the basic packet size, assuming no words or bytes */
-#define smb_size 39
-
/* offsets into message for common items */
#define smb_com 8
#define smb_rcls 9
@@ -1349,6 +1391,19 @@ struct bitmap {
#define FILE_NOTIFY_CHANGE_SECURITY 0x100
#define FILE_NOTIFY_CHANGE_FILE_NAME 0x200
+#define FILE_NOTIFY_CHANGE_NAME \
+ (FILE_NOTIFY_CHANGE_FILE_NAME|FILE_NOTIFY_CHANGE_DIR_NAME)
+
+/* change notify action results */
+#define NOTIFY_ACTION_ADDED 1
+#define NOTIFY_ACTION_REMOVED 2
+#define NOTIFY_ACTION_MODIFIED 3
+#define NOTIFY_ACTION_OLD_NAME 4
+#define NOTIFY_ACTION_NEW_NAME 5
+#define NOTIFY_ACTION_ADDED_STREAM 6
+#define NOTIFY_ACTION_REMOVED_STREAM 7
+#define NOTIFY_ACTION_MODIFIED_STREAM 8
+
/* where to find the base of the SMB packet proper */
#define smb_base(buf) (((char *)(buf))+4)