nbt: trim down header dependencies of nbt.idl.
[kai/samba.git] / source4 / librpc / idl / winsif.idl
1 #include "idl_types.h"
2
3 import "nbt.idl";
4
5 [
6         uuid("45f52c28-7f9f-101a-b52b-08002b2efabe"),
7         version(1.0),
8         helpstring("WINS Administration Interface1"),
9         helper("../libcli/nbt/libnbt.h"),
10         pointer_default(unique)
11 ] interface winsif
12 {
13         /*****************/
14         /* Function 0x00 */
15         typedef struct {
16                 uint8 type;
17                 uint32 length;
18                 ipv4address addr;
19         } winsif_Address;
20
21         typedef enum {
22                 WINSIF_ACTION_INSERT    = 0x0000,
23                 WINSIF_ACTION_DELETE    = 0x0001,
24                 WINSIF_ACTION_RELEASE   = 0x0002,
25                 WINSIF_ACTION_MODIFY    = 0x0003,
26                 WINSIF_ACTION_QUERY     = 0x0004
27         } winsif_Action;
28
29         typedef enum {
30                 WINSIF_RECORD_UNIQUE_NAME       = 0x0000,
31                 WINSIF_RECORD_GROUP_NAME        = 0x0001,
32                 WINSIF_RECORD_SGROUP_NAME       = 0x0002,
33                 WINSIF_RECORD_MHOMED_NAME       = 0x0003
34         } winsif_RecordType;
35
36         typedef [enum8bit] enum {
37                 WINSIF_NODE_B   = 0x00,
38                 WINSIF_NODE_P   = 0x01,
39                 WINSIF_NODE_H   = 0x03
40         } winsif_NodeType;
41
42         typedef [v1_enum] enum {
43                 WINSIF_RECORD_ACTIVE    = 0x00000000,
44                 WINSIF_RECORD_RELEASED  = 0x00000001,
45                 WINSIF_RECORD_TOMBSTONE = 0x00000002,
46                 WINSIF_RECORD_DELETED   = 0x00000003
47         } winsif_RecordState;
48
49         typedef struct {
50                 winsif_Action cmd;
51                 wrepl_nbt_name *name;
52                 [value(name?16:0)] uint32 name_len;
53                 winsif_RecordType record_type;
54                 uint32 num_of_addresses;
55                 [size_is(num_of_addresses)] winsif_Address *addresses;
56                 winsif_Address address;
57                 hyper version_number;
58                 winsif_NodeType node_type;
59                 ipv4address owner_address;
60                 winsif_RecordState record_state;
61                 boolean32 is_static;
62                 time_t expire_time;
63         } winsif_RecordAction;
64
65         WERROR winsif_WinsRecordAction(
66                 [in,out,ref] winsif_RecordAction **record_action
67         );
68
69         /*****************/
70         /* Function 0x01 */
71         typedef struct {
72                 winsif_Address address;
73                 hyper version_number;
74         } winsif_AddressVersionMap;
75
76         typedef enum {
77                 WINSIF_PRIORITY_NORMAL  = 0x0000,
78                 WINSIF_PRIORITY_HIGH    = 0x0001
79         } winsif_PriorityClass;
80
81         typedef struct {
82                 winsif_Address address;
83                 uint32 num_replications;
84                 uint32 num_communication_failures;
85         } winsif_ReplCounter;
86
87         typedef struct {
88                 uint32 num_unique_registrations;
89                 uint32 num_group_registrations;
90                 uint32 num_queries;
91                 uint32 num_successful_queries;
92                 uint32 num_failed_queries;
93                 uint32 num_unique_refreshes;
94                 uint32 num_group_refreshes;
95                 uint32 num_releases;
96                 uint32 num_successful_releases;
97                 uint32 num_failed_releases;
98                 uint32 num_unique_conflicts;
99                 uint32 num_group_conflicts;
100         } winsif_StatCounters;
101
102         typedef struct {
103                 time_t wins_start_time;
104                 time_t last_periodic_scavenging;
105                 time_t last_triggered_scavenging;
106                 time_t last_tombstone_scavenging;
107                 time_t last_verification_scavenging;
108                 time_t last_periodic_pull_replication;
109                 time_t last_triggered_pull_replication;
110                 time_t ignore_last_ntrepl;
111                 time_t ignore_last_actrepl;
112                 time_t last_init_db;
113                 time_t counter_reset;
114         } winsif_StatTimeStamps;
115
116         typedef struct {
117                 winsif_StatCounters counters;
118                 winsif_StatTimeStamps time_stamps;
119                 uint32 num_partners;
120                 [size_is(num_partners)] winsif_ReplCounter *partners;
121         } winsif_Stat;
122
123         typedef struct {
124                 uint32 num_owners;
125                 winsif_AddressVersionMap address_version_maps[25];
126                 hyper my_max_version_number;
127                 uint32 refresh_interval;
128                 uint32 tombstone_interval;
129                 uint32 tombstone_timeout;
130                 uint32 verify_interval;
131                 winsif_PriorityClass prioritiy_class;
132                 uint32 num_worker_threads;
133                 winsif_Stat wstat;
134         } winsif_Results;
135
136         typedef enum {
137                 WINSIF_STATUS_CMD_ADDRESS_VERSION_MAP   = 0x0000,
138                 WINSIF_STATUS_CMD_CONFIG                = 0x0001,
139                 WINSIF_STATUS_CMD_STAT                  = 0x0002,
140                 WINSIF_STATUS_CMD_ALL_MAPS              = 0x0003
141         } winsif_StatusCmd;
142
143         WERROR winsif_WinsStatus(
144                 [in] winsif_StatusCmd cmd,
145                 [in,out,ref] winsif_Results *results
146         );
147
148         /*****************/
149         /* Function 0x02 */
150         typedef enum {
151                 WINSIF_TRIGGER_PULL     = 0x0000,
152                 WINSIF_TRIGGER_PUSH     = 0x0001,
153                 WINSIF_TRIGGER_PUSH_PROP= 0x0002
154         } winsif_TriggerType;
155
156         WERROR winsif_WinsTrigger(
157                 [in,ref] winsif_Address *owner_address,
158                 [in] winsif_TriggerType trigger_type
159         );
160
161         /*****************/
162         /* Function 0x03 */
163         WERROR winsif_WinsDoStaticInit(
164                 [in,unique,string,charset(UTF16)] uint16 *data_file_path,
165                 [in] boolean32 delete_file
166         );
167
168         /*****************/
169         /* Function 0x04 */
170         WERROR winsif_WinsDoScavenging();
171
172         /*****************/
173         /* Function 0x05 */
174         typedef struct {
175                 uint32 buffer_size;
176                 [size_is(num_records)] winsif_RecordAction *row;
177                 uint32 num_records;
178                 uint32 total_num_records;
179         } winsif_Records;
180
181         WERROR winsif_WinsGetDbRecs(
182                 [in,unique] winsif_Address *owner_address,
183                 [in] hyper min_version_number,
184                 [in] hyper max_version_number,
185                 [out,ref] winsif_Records *records
186         );
187
188         /*****************/
189         /* Function 0x06 */
190         WERROR winsif_WinsTerm(
191                 [in] uint16 abrupt_termination
192         );
193
194         /*****************/
195         /* Function 0x07 */
196         WERROR winsif_WinsBackup(
197                 [in,ref,string,charset(DOS)] uint8 *backup_path,
198                 [in] uint16 incremental
199         );
200
201         /*****************/
202         /* Function 0x08 */
203         WERROR winsif_WinsDelDbRecs(
204                 [in,ref] winsif_Address *owner_address,
205                 [in] hyper min_version_number,
206                 [in] hyper max_version_number
207         );
208
209         /*****************/
210         /* Function 0x09 */
211         WERROR winsif_WinsPullRange(
212                 [in,ref] winsif_Address *server_address,
213                 [in,ref] winsif_Address *owner_address,
214                 [in] hyper min_version_number,
215                 [in] hyper max_version_number
216         );
217
218         /*****************/
219         /* Function 0x0A */
220         WERROR winsif_WinsSetPriorityClass(
221                 [in] winsif_PriorityClass prioritiy_class
222         );
223
224         /*****************/
225         /* Function 0x0B */
226         WERROR winsif_WinsResetCounters();
227
228         /*****************/
229         /* Function 0x0C */
230         WERROR winsif_WinsWorkerThreadUpdate(
231                 [in] uint32 num_of_threads
232         );
233
234         /*****************/
235         /* Function 0x0D */
236         WERROR winsif_WinsGetNameAndAdd(
237                 [out,ref] winsif_Address *server_address,
238                 /*
239                  * TODO: fix pidl to handles this completly correct...
240                  *       currently it gives a warning about a missing pointer.
241                  */
242                 [out,ref,string,charset(DOS),size_is(80)] uint8 *unc_name
243         );
244
245         /*****************/
246         /* Function 0x0E */
247         typedef struct {
248                 uint32 name_len;
249                 [string,charset(DOS)] uint8 *name;
250         } winsif_BrowserInfo;
251
252         typedef struct {
253                 uint32 num_entries;
254                 [size_is(num_entries)] winsif_BrowserInfo *info;
255         } winsif_BrowserNames;
256
257         WERROR winsif_WinsGetBrowserNames_Old(
258                 [out,ref] winsif_BrowserNames *names
259         );
260
261         /*****************/
262         /* Function 0x0F */
263         WERROR winsif_WinsDeleteWins(
264                 [in,ref] winsif_Address *owner_address
265         );
266
267         /*****************/
268         /* Function 0x10 */
269         WERROR winsif_WinsSetFlags(
270                 [in] uint32 flags
271         );
272
273         /*****************/
274         /* Function 0x11 */
275         typedef struct {
276                 boolean32 tcp_ip;
277                 [string,charset(DOS)] uint8 *server_address;
278                 [string,charset(DOS)] uint8 *pipe_name;
279         } winsif_BindData;
280
281         WERROR winsif_WinsGetBrowserNames(
282                 [in,ref] winsif_BindData *server_handle,
283                 [out,ref] winsif_BrowserNames *names
284         );
285
286         /*****************/
287         /* Function 0x12 */
288         WERROR winsif_WinsGetDbRecsByName(
289                 [in,unique] winsif_Address *owner_address,
290                 [in] boolean32 search_backward,
291                 [in,unique] wrepl_nbt_name *name,
292                 [in,value(name?16:0),range(0,16)] uint32 name_len,
293                 [in] uint32 num_records_desired,
294                 [in] boolean32 only_statics,
295                 [out,ref] winsif_Records *records
296         );
297
298         /*****************/
299         /* Function 0x13 */
300         typedef struct {
301                 uint32 num_owners;
302                 [size_is(num_owners)] winsif_AddressVersionMap *address_version_maps;
303                 hyper my_max_version_number;
304                 uint32 refresh_interval;
305                 uint32 tombstone_interval;
306                 uint32 tombstone_timeout;
307                 uint32 verify_interval;
308                 winsif_PriorityClass prioritiy_class;
309                 uint32 num_worker_threads;
310                 winsif_Stat wstat;
311         } winsif_ResultsNew;
312
313         WERROR winsif_WinsStatusNew(
314                 [in] winsif_StatusCmd cmd,
315                 [out,ref] winsif_ResultsNew *results
316         );
317
318         /*****************/
319         /* Function 0x14 */
320         WERROR winsif_WinsStatusWHdl(
321                 [in,ref] winsif_BindData *server_handle,
322                 [in] winsif_StatusCmd cmd,
323                 [in,out,ref] winsif_ResultsNew *results
324         );
325
326         /*****************/
327         /* Function 0x15 */
328         typedef enum {
329                 WINSIF_SCAVENGING_GENERAL       = 0x0000,
330                 WINSIF_SCAVENGING_VERIFY        = 0x0001
331         } winsif_ScavengingOpcode;
332
333         typedef struct {
334                 winsif_ScavengingOpcode opcode;
335                 uint32 age;
336                 boolean32 force;
337         } winsif_ScavengingRequest;
338
339         WERROR winsif_WinsDoScanvengingNew(
340                 [in,ref] winsif_ScavengingRequest *request
341         );
342 }