summaryrefslogtreecommitdiff
path: root/librpc/idl/notify.idl
blob: 5f83f4fd24ee8c6c423efcf961635d6048400425 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#include "idl_types.h"

import "file_id.idl", "server_id.idl";

/*
   IDL structures for notify change code

   this defines the structures used in the notify database code, and
   the change notify buffers
*/

[
  pointer_default(unique)
]
interface notify
{

	/* structure used in the notify database */
	typedef [public] struct {
		server_id server;
		uint32 filter; /* filter to apply in this directory */
		uint32 subdir_filter; /* filter to apply in child directories */
		uint32 dir_fd;   /* fd of open directory */
		file_id dir_id;  /* file_id of open directory */
		utf8string path;
		uint32 path_len; /* saves some computation on search */
		pointer private_data;
	} notify_entry;

	typedef [public] struct {
		uint32 num_entries;
		notify_entry entries[num_entries];
	} notify_entry_array;

	typedef [public] struct {
		server_id server;
		uint32 filter; /* filter to apply in this directory */
		uint32 subdir_filter; /* filter to apply in child directories */
		pointer private_data;
	} notify_db_entry;

	/*
	  to allow for efficient search for matching entries, we
	  divide them by the directory depth, with a separate array
	  per depth. The entries within each depth are sorted by path,
	  allowing for a bisection search.

	  The max_mask and max_mask_subdir at each depth is the
	  bitwise or of the filters and subdir filters for all entries
	  at that depth. This allows a depth to be quickly skipped if
	  no entries will match the target filter
	*/
	typedef struct {
		uint32 max_mask;
		uint32 max_mask_subdir;
		uint32 num_entries;
		notify_entry entries[num_entries];
	} notify_depth;

	typedef [public] struct {
		uint32 num_depths;
		notify_depth depth[num_depths];
	} notify_array;

	/* structure sent between servers in notify messages */
	typedef [public] struct {
		uint32 action;
		utf8string dir;
		utf8string path;
		pointer private_data;
	} notify_event;

	typedef [v1_enum] enum {
		FILE_ACTION_ADDED		= 0x00000001,
		FILE_ACTION_REMOVED		= 0x00000002,
		FILE_ACTION_MODIFIED		= 0x00000003,
		FILE_ACTION_RENAMED_OLD_NAME	= 0x00000004,
		FILE_ACTION_RENAMED_NEW_NAME	= 0x00000005,
		FILE_ACTION_ADDED_STREAM	= 0x00000006,
		FILE_ACTION_REMOVED_STREAM	= 0x00000007,
		FILE_ACTION_MODIFIED_STREAM	= 0x00000008
	} FILE_NOTIFY_ACTION;

	/* structure sent at the CIFS layer */
	/* Align on 4-byte boundary according to MS-CIFS 2.2.7.4.2 */
	typedef [public,gensize,flag(NDR_ALIGN4)] struct {
		uint32 NextEntryOffset;
		FILE_NOTIFY_ACTION Action;
		[value(strlen_m(FileName1)*2)] uint32 FileNameLength;
		[charset(UTF16),flag(STR_NOTERM)]
			uint16 FileName1[strlen_m(FileName1)];
		DATA_BLOB _pad;
	} FILE_NOTIFY_INFORMATION;
}