summaryrefslogtreecommitdiffstats
path: root/source4/librpc/idl/winsif.idl
blob: 433e6bc1b0002f24b3c058729cb752570095e999 (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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
#include "idl_types.h"

import "nbt.idl";

[
	uuid("45f52c28-7f9f-101a-b52b-08002b2efabe"),
	version(1.0),
	helpstring("WINS Administration Interface1"),
	helper("../libcli/nbt/libnbt.h"),
	pointer_default(unique)
] interface winsif
{
	/*****************/
	/* Function 0x00 */
	typedef struct {
		uint8 type;
		uint32 length;
		ipv4address addr;
	} winsif_Address;

	typedef enum {
		WINSIF_ACTION_INSERT	= 0x0000,
		WINSIF_ACTION_DELETE	= 0x0001,
		WINSIF_ACTION_RELEASE	= 0x0002,
		WINSIF_ACTION_MODIFY	= 0x0003,
		WINSIF_ACTION_QUERY	= 0x0004
	} winsif_Action;

	typedef enum {
		WINSIF_RECORD_UNIQUE_NAME	= 0x0000,
		WINSIF_RECORD_GROUP_NAME	= 0x0001,
		WINSIF_RECORD_SGROUP_NAME	= 0x0002,
		WINSIF_RECORD_MHOMED_NAME	= 0x0003
	} winsif_RecordType;

	typedef [enum8bit] enum {
		WINSIF_NODE_B	= 0x00,
		WINSIF_NODE_P	= 0x01,
		WINSIF_NODE_H	= 0x03
	} winsif_NodeType;

	typedef [v1_enum] enum {
		WINSIF_RECORD_ACTIVE	= 0x00000000,
		WINSIF_RECORD_RELEASED	= 0x00000001,
		WINSIF_RECORD_TOMBSTONE	= 0x00000002,
		WINSIF_RECORD_DELETED	= 0x00000003
	} winsif_RecordState;

	typedef struct {
		winsif_Action cmd;
		wrepl_nbt_name *name;
		[value(name?16:0)] uint32 name_len;
		winsif_RecordType record_type;
		uint32 num_of_addresses;
		[size_is(num_of_addresses)] winsif_Address *addresses;
		winsif_Address address;
		hyper version_number;
		winsif_NodeType node_type;
		ipv4address owner_address;
		winsif_RecordState record_state;
		boolean32 is_static;
		time_t expire_time;
	} winsif_RecordAction;

	WERROR winsif_WinsRecordAction(
		[in,out,ref] winsif_RecordAction **record_action
	);

	/*****************/
	/* Function 0x01 */
	typedef struct {
		winsif_Address address;
		hyper version_number;
	} winsif_AddressVersionMap;

	typedef enum {
		WINSIF_PRIORITY_NORMAL	= 0x0000,
		WINSIF_PRIORITY_HIGH	= 0x0001
	} winsif_PriorityClass;

	typedef struct {
		winsif_Address address;
		uint32 num_replications;
		uint32 num_communication_failures;
	} winsif_ReplCounter;

	typedef struct {
		uint32 num_unique_registrations;
		uint32 num_group_registrations;
		uint32 num_queries;
		uint32 num_successful_queries;
		uint32 num_failed_queries;
		uint32 num_unique_refreshes;
		uint32 num_group_refreshes;
		uint32 num_releases;
		uint32 num_successful_releases;
		uint32 num_failed_releases;
		uint32 num_unique_conflicts;
		uint32 num_group_conflicts;
	} winsif_StatCounters;

	typedef struct {
		time_t wins_start_time;
		time_t last_periodic_scavenging;
		time_t last_triggered_scavenging;
		time_t last_tombstone_scavenging;
		time_t last_verification_scavenging;
		time_t last_periodic_pull_replication;
		time_t last_triggered_pull_replication;
		time_t ignore_last_ntrepl;
		time_t ignore_last_actrepl;
		time_t last_init_db;
		time_t counter_reset;
	} winsif_StatTimeStamps;

	typedef struct {
		winsif_StatCounters counters;
		winsif_StatTimeStamps time_stamps;
		uint32 num_partners;
		[size_is(num_partners)] winsif_ReplCounter *partners;
	} winsif_Stat;

	typedef struct {
		uint32 num_owners;
		winsif_AddressVersionMap address_version_maps[25];
		hyper my_max_version_number;
		uint32 refresh_interval;
		uint32 tombstone_interval;
		uint32 tombstone_timeout;
		uint32 verify_interval;
		winsif_PriorityClass prioritiy_class;
		uint32 num_worker_threads;
		winsif_Stat wstat;
	} winsif_Results;

	typedef enum {
		WINSIF_STATUS_CMD_ADDRESS_VERSION_MAP	= 0x0000,
		WINSIF_STATUS_CMD_CONFIG		= 0x0001,
		WINSIF_STATUS_CMD_STAT			= 0x0002,
		WINSIF_STATUS_CMD_ALL_MAPS		= 0x0003
	} winsif_StatusCmd;

	WERROR winsif_WinsStatus(
		[in] winsif_StatusCmd cmd,
		[in,out,ref] winsif_Results *results
	);

	/*****************/
	/* Function 0x02 */
	typedef enum {
		WINSIF_TRIGGER_PULL	= 0x0000,
		WINSIF_TRIGGER_PUSH	= 0x0001,
		WINSIF_TRIGGER_PUSH_PROP= 0x0002
	} winsif_TriggerType;

	WERROR winsif_WinsTrigger(
		[in,ref] winsif_Address *owner_address,
		[in] winsif_TriggerType trigger_type
	);

	/*****************/
	/* Function 0x03 */
	WERROR winsif_WinsDoStaticInit(
		[in,unique,string,charset(UTF16)] uint16 *data_file_path,
		[in] boolean32 delete_file
	);

	/*****************/
	/* Function 0x04 */
	WERROR winsif_WinsDoScavenging();

	/*****************/
	/* Function 0x05 */
	typedef struct {
		uint32 buffer_size;
		[size_is(num_records)] winsif_RecordAction *row;
		uint32 num_records;
		uint32 total_num_records;
	} winsif_Records;

	WERROR winsif_WinsGetDbRecs(
		[in,unique] winsif_Address *owner_address,
		[in] hyper min_version_number,
		[in] hyper max_version_number,
		[out,ref] winsif_Records *records
	);

	/*****************/
	/* Function 0x06 */
	WERROR winsif_WinsTerm(
		[in] uint16 abrupt_termination
	);

	/*****************/
	/* Function 0x07 */
	WERROR winsif_WinsBackup(
		[in,ref,string,charset(DOS)] uint8 *backup_path,
		[in] uint16 incremental
	);

	/*****************/
	/* Function 0x08 */
	WERROR winsif_WinsDelDbRecs(
		[in,ref] winsif_Address *owner_address,
		[in] hyper min_version_number,
		[in] hyper max_version_number
	);

	/*****************/
	/* Function 0x09 */
	WERROR winsif_WinsPullRange(
		[in,ref] winsif_Address *server_address,
		[in,ref] winsif_Address *owner_address,
		[in] hyper min_version_number,
		[in] hyper max_version_number
	);

	/*****************/
	/* Function 0x0A */
	WERROR winsif_WinsSetPriorityClass(
		[in] winsif_PriorityClass prioritiy_class
	);

	/*****************/
	/* Function 0x0B */
	WERROR winsif_WinsResetCounters();

	/*****************/
	/* Function 0x0C */
	WERROR winsif_WinsWorkerThreadUpdate(
		[in] uint32 num_of_threads
	);

	/*****************/
	/* Function 0x0D */
	WERROR winsif_WinsGetNameAndAdd(
		[out,ref] winsif_Address *server_address,
		/*
		 * TODO: fix pidl to handles this completely correct...
		 *       currently it gives a warning about a missing pointer.
		 */
		[out,ref,string,charset(DOS),size_is(80)] uint8 *unc_name
	);

	/*****************/
	/* Function 0x0E */
	typedef struct {
		uint32 name_len;
		[string,charset(DOS)] uint8 *name;
	} winsif_BrowserInfo;

	typedef struct {
		uint32 num_entries;
		[size_is(num_entries)] winsif_BrowserInfo *info;
	} winsif_BrowserNames;

	WERROR winsif_WinsGetBrowserNames_Old(
		[out,ref] winsif_BrowserNames *names
	);

	/*****************/
	/* Function 0x0F */
	WERROR winsif_WinsDeleteWins(
		[in,ref] winsif_Address *owner_address
	);

	/*****************/
	/* Function 0x10 */
	WERROR winsif_WinsSetFlags(
		[in] uint32 flags
	);

	/*****************/
	/* Function 0x11 */
	typedef struct {
		boolean32 tcp_ip;
		[string,charset(DOS)] uint8 *server_address;
		[string,charset(DOS)] uint8 *pipe_name;
	} winsif_BindData;

	WERROR winsif_WinsGetBrowserNames(
		[in,ref] winsif_BindData *server_handle,
		[out,ref] winsif_BrowserNames *names
	);

	/*****************/
	/* Function 0x12 */
	WERROR winsif_WinsGetDbRecsByName(
		[in,unique] winsif_Address *owner_address,
		[in] boolean32 search_backward,
		[in,unique] wrepl_nbt_name *name,
		[in,value(name?16:0),range(0,16)] uint32 name_len,
		[in] uint32 num_records_desired,
		[in] boolean32 only_statics,
		[out,ref] winsif_Records *records
	);

	/*****************/
	/* Function 0x13 */
	typedef struct {
		uint32 num_owners;
		[size_is(num_owners)] winsif_AddressVersionMap *address_version_maps;
		hyper my_max_version_number;
		uint32 refresh_interval;
		uint32 tombstone_interval;
		uint32 tombstone_timeout;
		uint32 verify_interval;
		winsif_PriorityClass prioritiy_class;
		uint32 num_worker_threads;
		winsif_Stat wstat;
	} winsif_ResultsNew;

	WERROR winsif_WinsStatusNew(
		[in] winsif_StatusCmd cmd,
		[out,ref] winsif_ResultsNew *results
	);

	/*****************/
	/* Function 0x14 */
	WERROR winsif_WinsStatusWHdl(
		[in,ref] winsif_BindData *server_handle,
		[in] winsif_StatusCmd cmd,
		[in,out,ref] winsif_ResultsNew *results
	);

	/*****************/
	/* Function 0x15 */
	typedef enum {
		WINSIF_SCAVENGING_GENERAL	= 0x0000,
		WINSIF_SCAVENGING_VERIFY	= 0x0001
	} winsif_ScavengingOpcode;

	typedef struct {
		winsif_ScavengingOpcode opcode;
		uint32 age;
		boolean32 force;
	} winsif_ScavengingRequest;

	WERROR winsif_WinsDoScanvengingNew(
		[in,ref] winsif_ScavengingRequest *request
	);
}