ldb The use of a private event context isn't a hack
[Samba/gebeck_regimport.git] / librpc / idl / epmapper.idl
blobd23b68ac256e2ad5e271d46b1feb00410fb5515e
1 #include "idl_types.h"
3 /*
4 endpoint mapper interface
5 Related links:
6 http://www.opengroup.org/onlinepubs/9629399/apdxo.htm : The official IDL for this pipe
7 http://www.opengroup.org/onlinepubs/9629399/apdxl.htm : Details on towers
8 http://www.opengroup.org/onlinepubs/9629399/chap6.htm#tagcjh_11_02_03_01: binding strings
12 import "misc.idl";
15 uuid("e1af8308-5d1f-11c9-91a4-08002b14a0fa"),
16 version(3.0),
17 endpoint("ncacn_np:[\\pipe\\epmapper]", "ncacn_ip_tcp:[135]",
18 "ncalrpc:[EPMAPPER]"),
19 helpstring("EndPoint Mapper"),
20 pointer_default(ptr)
22 interface epmapper
26 note that the following IDL won't work in MIDL, and in fact
27 that the full towers/floors representation of epm cannot be
28 represented in MIDL at all. I decided to represent it using
29 the extended IDL syntax in pidl to make it easier to work
30 with.
33 const int EPMAPPER_STATUS_CANT_PERFORM_OP = 0x6d8;
34 const int EPMAPPER_STATUS_NO_MORE_ENTRIES = 0x16c9a0d6;
35 const int EPMAPPER_STATUS_NO_MEMORY = 0x16C9A012;
36 const int EPMAPPER_STATUS_OK = 0;
40 typedef [enum8bit] enum {
42 /* Level 4 and higher */
43 EPM_PROTOCOL_DNET_NSP = 0x04,
44 EPM_PROTOCOL_OSI_TP4 = 0x05,
45 EPM_PROTOCOL_OSI_CLNS = 0x06,
46 EPM_PROTOCOL_TCP = 0x07,
47 EPM_PROTOCOL_UDP = 0x08,
48 EPM_PROTOCOL_IP = 0x09,
49 /* These 4 are protocol identifiers, always at level 3 or lower */
50 EPM_PROTOCOL_NCADG = 0x0a, /* Connectionless RPC */
51 EPM_PROTOCOL_NCACN = 0x0b,
52 EPM_PROTOCOL_NCALRPC = 0x0c, /* Local RPC */
53 EPM_PROTOCOL_UUID = 0x0d,
54 EPM_PROTOCOL_IPX = 0x0e,
55 EPM_PROTOCOL_SMB = 0x0f,
56 EPM_PROTOCOL_NAMED_PIPE = 0x10,
57 EPM_PROTOCOL_NETBIOS = 0x11,
58 EPM_PROTOCOL_NETBEUI = 0x12,
59 EPM_PROTOCOL_SPX = 0x13,
60 EPM_PROTOCOL_NB_IPX = 0x14, /* NetBIOS over IPX */
61 EPM_PROTOCOL_DSP = 0x16, /* AppleTalk Data Stream Protocol */
62 EPM_PROTOCOL_DDP = 0x17, /* AppleTalk Data Datagram Protocol */
63 EPM_PROTOCOL_APPLETALK = 0x18, /* AppleTalk */
64 EPM_PROTOCOL_VINES_SPP = 0x1a,
65 EPM_PROTOCOL_VINES_IPC = 0x1b, /* Inter Process Communication */
66 EPM_PROTOCOL_STREETTALK = 0x1c, /* Vines Streettalk */
67 EPM_PROTOCOL_HTTP = 0x1f,
68 EPM_PROTOCOL_UNIX_DS = 0x20, /* Unix domain socket */
69 EPM_PROTOCOL_NULL = 0x21
70 } epm_protocol;
72 typedef struct {
73 /*FIXME */
74 } epm_rhs_dnet_nsp;
76 typedef struct {
77 /*FIXME*/
78 } epm_rhs_osi_tp4;
80 typedef struct {
81 /*FIXME*/
82 } epm_rhs_osi_clns;
84 typedef struct {
85 uint16 port;
86 } epm_rhs_udp;
88 typedef struct {
89 uint16 port;
90 } epm_rhs_tcp;
92 typedef struct {
93 ipv4address ipaddr;
94 } epm_rhs_ip;
96 typedef struct {
97 uint16 minor_version;
98 } epm_rhs_ncadg;
100 typedef struct {
101 uint16 minor_version;
102 } epm_rhs_ncacn;
104 typedef struct {
105 [flag(NDR_REMAINING)] DATA_BLOB unknown;
106 } epm_rhs_uuid;
108 typedef struct {
109 /*FIXME */
110 } epm_rhs_ipx;
112 typedef struct {
113 astring unc;
114 } epm_rhs_smb;
116 typedef struct {
117 astring path;
118 } epm_rhs_named_pipe;
120 typedef struct {
121 astring name;
122 } epm_rhs_netbios;
124 typedef struct {
125 } epm_rhs_netbeui;
127 typedef struct {
128 } epm_rhs_spx;
130 typedef struct {
131 } epm_rhs_nb_ipx;
133 typedef struct {
134 uint16 port;
135 } epm_rhs_http;
137 typedef struct {
138 astring path;
139 } epm_rhs_unix_ds;
141 typedef struct {
142 } epm_rhs_null;
144 typedef struct {
145 uint16 minor_version;
146 } epm_rhs_ncalrpc;
148 typedef struct {
149 } epm_rhs_appletalk;
151 typedef struct {
152 } epm_rhs_atalk_stream;
154 typedef struct {
155 } epm_rhs_atalk_datagram;
157 typedef struct {
158 uint16 port;
159 } epm_rhs_vines_spp;
161 typedef struct {
162 uint16 port;
163 } epm_rhs_vines_ipc;
165 typedef struct {
166 astring streettalk;
167 } epm_rhs_streettalk;
169 typedef [flag(NDR_BIG_ENDIAN),nodiscriminant] union {
170 [case(EPM_PROTOCOL_DNET_NSP)] epm_rhs_dnet_nsp dnet_nsp;
171 [case(EPM_PROTOCOL_OSI_TP4)] epm_rhs_osi_tp4 osi_tp4;
172 [case(EPM_PROTOCOL_OSI_CLNS)] epm_rhs_osi_clns osi_clns;
173 [case(EPM_PROTOCOL_TCP)] epm_rhs_tcp tcp;
174 [case(EPM_PROTOCOL_UDP)] epm_rhs_udp udp;
175 [case(EPM_PROTOCOL_IP)] epm_rhs_ip ip;
176 [case(EPM_PROTOCOL_NCADG)] epm_rhs_ncadg ncadg;
177 [case(EPM_PROTOCOL_NCACN)] epm_rhs_ncacn ncacn;
178 [case(EPM_PROTOCOL_NCALRPC)] epm_rhs_ncalrpc ncalrpc;
179 [case(EPM_PROTOCOL_UUID)] epm_rhs_uuid uuid;
180 [case(EPM_PROTOCOL_IPX)] epm_rhs_ipx ipx;
181 [case(EPM_PROTOCOL_SMB)] epm_rhs_smb smb;
182 [case(EPM_PROTOCOL_NAMED_PIPE)] epm_rhs_named_pipe named_pipe;
183 [case(EPM_PROTOCOL_NETBIOS)] epm_rhs_netbios netbios;
184 [case(EPM_PROTOCOL_NETBEUI)] epm_rhs_netbeui netbeui;
185 [case(EPM_PROTOCOL_SPX)] epm_rhs_spx spx;
186 [case(EPM_PROTOCOL_NB_IPX)] epm_rhs_nb_ipx nb_ipx;
187 [case(EPM_PROTOCOL_DSP)] epm_rhs_atalk_stream atalk_stream;
188 [case(EPM_PROTOCOL_DDP)] epm_rhs_atalk_datagram atalk_datagram;
189 [case(EPM_PROTOCOL_APPLETALK)] epm_rhs_appletalk appletalk;
190 [case(EPM_PROTOCOL_VINES_SPP)] epm_rhs_vines_spp vines_spp;
191 [case(EPM_PROTOCOL_VINES_IPC)] epm_rhs_vines_ipc vines_ipc;
192 [case(EPM_PROTOCOL_STREETTALK)] epm_rhs_streettalk streettalk;
193 [case(EPM_PROTOCOL_HTTP)] epm_rhs_http http;
194 [case(EPM_PROTOCOL_UNIX_DS)] epm_rhs_unix_ds unix_ds;
195 [case(EPM_PROTOCOL_NULL)] epm_rhs_null null;
196 [default] [flag(NDR_REMAINING)] DATA_BLOB unknown;
197 } epm_rhs;
199 typedef struct {
200 epm_protocol protocol;
201 [flag(NDR_REMAINING)] DATA_BLOB lhs_data;
202 } epm_lhs;
204 typedef struct {
205 [subcontext(2)] epm_lhs lhs;
206 [subcontext(2),switch_is(lhs.protocol)] epm_rhs rhs;
207 } epm_floor;
209 /* note that the NDR_NOALIGN flag is inherited by all nested
210 structures. All of the towers/floors stuff is
211 non-aligned. I wonder what sort of wicked substance these
212 guys were smoking?
214 typedef [gensize,flag(NDR_NOALIGN|NDR_LITTLE_ENDIAN)] struct {
215 uint16 num_floors;
216 epm_floor floors[num_floors];
217 } epm_tower;
219 typedef struct {
220 [value(ndr_size_epm_tower(&tower, ndr->flags))] uint32 tower_length;
221 [subcontext(4)] epm_tower tower;
222 } epm_twr_t;
224 typedef struct {
225 GUID object;
226 epm_twr_t *tower;
228 * In theory this should be:
229 * [charset(DOS),string] uint8 annotation[64]
230 * But midl treats this as:
231 * [charset(DOS),string] uint8 annotation[]
232 * and pidl doesn't support this yet
234 [value(0)] uint32 __annotation_offset;
235 [value(strlen(annotation)+1)] uint32 __annotation_length;
236 [charset(DOS)] uint8 annotation[__annotation_length];
237 } epm_entry_t;
239 typedef struct {
240 GUID uuid;
241 uint16 vers_major;
242 uint16 vers_minor;
243 } rpc_if_id_t;
245 /**********************/
246 /* Function 0x0 */
247 error_status_t epm_Insert(
248 [in] uint32 num_ents,
249 [in,size_is(num_ents)] epm_entry_t entries[],
250 [in] uint32 replace
253 /**********************/
254 /* Function 0x1 */
255 error_status_t epm_Delete(
256 [in] uint32 num_ents,
257 [in, size_is(num_ents)] epm_entry_t entries[]
260 /**********************/
261 /* Function 0x02 */
262 error_status_t epm_Lookup(
263 [in] uint32 inquiry_type,
264 [in,ptr] GUID *object,
265 [in,ptr] rpc_if_id_t *interface_id,
266 [in] uint32 vers_option,
267 [in,out] policy_handle *entry_handle,
268 [in] uint32 max_ents,
269 [out] uint32 *num_ents,
270 [out, length_is(*num_ents), size_is(max_ents)] epm_entry_t entries[]
274 /**********************/
275 /* Function 0x03 */
277 typedef struct {
278 epm_twr_t *twr;
279 } epm_twr_p_t;
281 [public] error_status_t epm_Map(
282 [in,ptr] GUID *object,
283 [in,ptr] epm_twr_t *map_tower,
284 [in,out] policy_handle *entry_handle,
285 [in] uint32 max_towers,
286 [out] uint32 *num_towers,
287 [out, length_is(*num_towers), size_is(max_towers)] epm_twr_p_t towers[]
291 /**********************/
292 /* Function 0x04 */
293 error_status_t epm_LookupHandleFree(
294 [in,out] policy_handle *entry_handle
297 /**********************/
298 /* Function 0x05 */
299 error_status_t epm_InqObject(
300 [in] GUID *epm_object
304 /**********************/
305 /* Function 0x06 */
306 error_status_t epm_MgmtDelete(
307 [in] uint32 object_speced,
308 [in,ptr] GUID *object,
309 [in,ptr] epm_twr_t *tower
312 /**********************/
313 /* Function 0x07 */
314 [todo] error_status_t epm_MapAuth();