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