summaryrefslogtreecommitdiffstats
path: root/librpc/idl/witness.idl
blob: cf605366f0a5d4d1ee008b90a8805702cfd9488a (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
#include "idl_types.h"

import "misc.idl";

[
  uuid("ccd8c074-d0e5-4a40-92b4-d074faa6ba28"),
  version(1.1),
  pointer_default(unique),
  helpstring("SMB Witness Service"),
  endpoint("ncacn_ip_tcp:")
]
interface witness
{
	typedef [v1_enum] enum {
		WITNESS_V1 = 0x00010001,
		WITNESS_V2 = 0x00020000
	} witness_version;

	/*****************/
	/* Function 0x00 */

	typedef [enum16bit] enum {
		WITNESS_STATE_UNKNOWN     = 0x00,
		WITNESS_STATE_AVAILABLE   = 0x01,
		WITNESS_STATE_UNAVAILABLE = 0xff
	} witness_interfaceInfo_state;

	typedef [bitmap32bit] bitmap {
		WITNESS_INFO_IPv4_VALID = 0x01,
		WITNESS_INFO_IPv6_VALID = 0x02,
		WITNESS_INFO_WITNESS_IF = 0x04
	} witness_interfaceInfo_flags;

	typedef struct {
		[charset(UTF16),to_null] uint16 group_name[260];
		witness_version version;
		witness_interfaceInfo_state state;
		[flag(NDR_BIG_ENDIAN)] ipv4address ipv4;
		[flag(NDR_BIG_ENDIAN)] ipv6address ipv6;
		witness_interfaceInfo_flags flags;
	} witness_interfaceInfo;

	typedef struct {
		uint32 num_interfaces;
		[size_is(num_interfaces)] witness_interfaceInfo *interfaces;
	} witness_interfaceList;

	WERROR witness_GetInterfaceList(
		[out] witness_interfaceList **interface_list
		);

	/*****************/
	/* Function 0x01 */

	WERROR witness_Register(
		[out,ref] policy_handle *context_handle,
		[in] witness_version version,
		[in,unique,string,charset(UTF16)] uint16 *net_name,
		[in,unique,string,charset(UTF16)] uint16 *ip_address,
		[in,unique,string,charset(UTF16)] uint16 *client_computer_name
		);

	/*****************/
	/* Function 0x02 */

	WERROR witness_UnRegister(
		[in] policy_handle context_handle
		);

	/*****************/
	/* Function 0x03 */

	typedef [v1_enum] enum {
		WITNESS_NOTIFY_RESOURCE_CHANGE = 1,
		WITNESS_NOTIFY_CLIENT_MOVE     = 2,
		WITNESS_NOTIFY_SHARE_MOVE      = 3,
		WITNESS_NOTIFY_IP_CHANGE       = 4
	} witness_notifyResponse_type;

	typedef struct {
		witness_notifyResponse_type message_type;
		uint32 length;
		uint32 num_messages;
		[size_is(length)] uint8 *message_buffer;
	} witness_notifyResponse;

	WERROR witness_AsyncNotify(
		[in] policy_handle context_handle,
		[out] witness_notifyResponse **response
		);

	/*****************/
	/* Function 0x04 */

	typedef [bitmap32bit] bitmap {
		WITNESS_REGISTER_NONE            = 0x00,
		WITNESS_REGISTER_IP_NOTIFICATION = 0x01
	} witness_RegisterEx_flags;

	WERROR witness_RegisterEx(
		[out,ref] policy_handle *context_handle,
		[in] witness_version version,
		[in,unique,string,charset(UTF16)] uint16 *net_name,
		[in,unique,string,charset(UTF16)] uint16 *share_name,
		[in,unique,string,charset(UTF16)] uint16 *ip_address,
		[in,unique,string,charset(UTF16)] uint16 *client_computer_name,
		[in] witness_RegisterEx_flags flags,
		[in] uint32 timeout
		);
}