s3-librpc: move server_id marshalling to own helper file.
[Samba/vl.git] / source3 / librpc / idl / notify.idl
blobd65e8c5f86cd909fb8893372d8a28ea2754c0b90
1 #include "idl_types.h"
3 import "file_id.idl";
5 /*
6 IDL structures for notify change code
8 this defines the structures used in the notify database code, and
9 the change notify buffers
13 helper("../librpc/ndr/ndr_server_id.h"),
14 pointer_default(unique)
16 interface notify
19 /* structure used in the notify database */
20 typedef [public] struct {
21 server_id server;
22 uint32 filter; /* filter to apply in this directory */
23 uint32 subdir_filter; /* filter to apply in child directories */
24 uint32 dir_fd; /* fd of open directory */
25 file_id dir_id; /* file_id of open directory */
26 utf8string path;
27 uint32 path_len; /* saves some computation on search */
28 pointer private_data;
29 } notify_entry;
31 typedef [public] struct {
32 uint32 num_entries;
33 notify_entry entries[num_entries];
34 } notify_entry_array;
37 to allow for efficient search for matching entries, we
38 divide them by the directory depth, with a separate array
39 per depth. The entries within each depth are sorted by path,
40 allowing for a bisection search.
42 The max_mask and max_mask_subdir at each depth is the
43 bitwise or of the filters and subdir filters for all entries
44 at that depth. This allows a depth to be quickly skipped if
45 no entries will match the target filter
47 typedef struct {
48 uint32 max_mask;
49 uint32 max_mask_subdir;
50 uint32 num_entries;
51 notify_entry entries[num_entries];
52 } notify_depth;
54 typedef [public] struct {
55 uint32 num_depths;
56 notify_depth depth[num_depths];
57 } notify_array;
59 /* structure sent between servers in notify messages */
60 typedef [public] struct {
61 uint32 action;
62 utf8string path;
63 pointer private_data;
64 } notify_event;
66 typedef [v1_enum] enum {
67 FILE_ACTION_ADDED = 0x00000001,
68 FILE_ACTION_REMOVED = 0x00000002,
69 FILE_ACTION_MODIFIED = 0x00000003,
70 FILE_ACTION_RENAMED_OLD_NAME = 0x00000004,
71 FILE_ACTION_RENAMED_NEW_NAME = 0x00000005,
72 FILE_ACTION_ADDED_STREAM = 0x00000006,
73 FILE_ACTION_REMOVED_STREAM = 0x00000007,
74 FILE_ACTION_MODIFIED_STREAM = 0x00000008
75 } FILE_NOTIFY_ACTION;
77 /* structure sent at the CIFS layer */
78 /* Align on 4-byte boundary according to MS-CIFS 2.2.7.4.2 */
79 typedef [public,gensize,flag(NDR_ALIGN4)] struct {
80 uint32 NextEntryOffset;
81 FILE_NOTIFY_ACTION Action;
82 [value(strlen_m(FileName1)*2)] uint32 FileNameLength;
83 [charset(UTF16),flag(STR_NOTERM)] uint16 FileName1[FileNameLength];
84 } FILE_NOTIFY_INFORMATION;