r3043: Use binding strings for specifying endpoints. The property for
[mat/samba.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  pointer_default(unique)
16 ]
17 interface epmapper
18 {
19
20         /*
21           note that the following IDL won't work in MIDL, and in fact
22           that the full towers/floors representation of epm cannot be
23           represented in MIDL at all. I decided to represent it using
24           the extended IDL syntax in pidl to make it easier to work
25           with.
26         */
27
28         const int EPMAPPER_STATUS_NO_MORE_ENTRIES = 0x16c9a0d6;
29         const int EPMAPPER_STATUS_NO_MEMORY = 0x16C9A012;
30         const int EPMAPPER_STATUS_OK = 0;
31
32
33         /* this guid indicates NDR encoding in a protocol tower */
34         const string NDR_GUID = "8a885d04-1ceb-11c9-9fe8-08002b104860";
35         const string NDR_GUID_VERSION = 2;
36
37         const uint32 EPMAPPER_PORT = 135;
38
39         typedef struct {
40                 GUID uuid;
41                 uint16 version;
42         } epm_prot_uuid;
43
44         typedef enum {
45                 
46                 /* Level 4 and higher */
47                 EPM_PROTOCOL_DNET_NSP           = 0x04,
48                 EPM_PROTOCOL_OSI_TP4            = 0x05,
49                 EPM_PROTOCOL_OSI_CLNS           = 0x06,
50                 EPM_PROTOCOL_TCP                = 0x07,
51                 EPM_PROTOCOL_UDP                = 0x08,
52                 EPM_PROTOCOL_IP                 = 0x09,
53
54                 /* These 4 are protocol identifiers, always at level 3 or lower */
55                 EPM_PROTOCOL_NCADG                      = 0x0a, /* Connectionless RPC */
56                 EPM_PROTOCOL_NCACN                      = 0x0b,
57                 EPM_PROTOCOL_NCALRPC            = 0x0c, /* Local RPC */
58                 EPM_PROTOCOL_UUID                       = 0x0d,
59
60                 EPM_PROTOCOL_IPX                        = 0x0e,
61                 EPM_PROTOCOL_SMB                = 0x0f,
62                 EPM_PROTOCOL_PIPE               = 0x10,
63                 EPM_PROTOCOL_NETBIOS            = 0x11,
64                 EPM_PROTOCOL_NB_NB              = 0x12, /* NetBIOS over NetBEUI */
65                 EPM_PROTOCOL_SPX                = 0x13,
66                 EPM_PROTOCOL_NB_IPX             = 0x14, /* NetBIOS over IPX */
67                 EPM_PROTOCOL_HTTP               = 0x1f,
68                 EPM_PROTOCOL_UNIX_DS            = 0x20,  /* Unix domain socket */
69                 EPM_PROTOCOL_NULL                       = 0x21
70         } epm_protocols;
71
72         typedef [nodiscriminant] union {
73                 [case(EPM_PROTOCOL_UUID)] epm_prot_uuid uuid;
74                 [default]  [flag(NDR_REMAINING)] DATA_BLOB lhs_data;
75         } epm_protocol_info;
76
77         typedef struct {
78                 /*FIXME */
79         } epm_rhs_dnet_nsp;
80
81         typedef struct {
82                 /*FIXME*/
83         } epm_rhs_osi_tp4;
84
85         typedef struct {
86                 /*FIXME*/
87         } epm_rhs_osi_clns;
88         
89         typedef struct {
90                 uint16 port;
91         } epm_rhs_udp;
92
93         typedef struct {
94                 uint16 port;
95         } epm_rhs_tcp;
96
97         typedef struct {
98                 uint32 address;
99         } epm_rhs_ip;
100
101         typedef struct {
102                 uint16 minor_version;
103         } epm_rhs_ncadg;
104
105         typedef struct {
106                 uint16 minor_version;
107         } epm_rhs_ncacn;
108
109         typedef struct {
110                 uint16 unknown;
111         } epm_rhs_uuid;
112
113         typedef struct {
114                 /*FIXME */
115         } epm_rhs_ipx;
116
117         typedef struct {
118                 astring unc;
119         } epm_rhs_smb;
120
121         typedef struct {
122                 astring path;   
123         } epm_rhs_pipe;
124
125         typedef struct {
126                 astring name;
127         } epm_rhs_netbios;
128
129         typedef struct {
130         } epm_rhs_nb_nb;
131
132         typedef struct {
133         } epm_rhs_spx;
134
135         typedef struct {
136         } epm_rhs_nb_ipx;
137
138         typedef struct {
139                 uint16 port;
140         } epm_rhs_http;
141
142         typedef struct {
143                 astring path;
144         } epm_rhs_unix_ds;
145
146         typedef struct {
147         } epm_rhs_null;
148
149         typedef struct {
150         } epm_rhs_ncalrpc;
151
152         typedef [flag(NDR_BIG_ENDIAN),nodiscriminant] union {
153                 [case(EPM_PROTOCOL_DNET_NSP)] epm_rhs_dnet_nsp dnet_nsp;
154                 [case(EPM_PROTOCOL_OSI_TP4)] epm_rhs_osi_tp4 osi_tp4;
155                 [case(EPM_PROTOCOL_OSI_CLNS)] epm_rhs_osi_clns osi_clns;
156                 [case(EPM_PROTOCOL_TCP)] epm_rhs_tcp tcp;
157                 [case(EPM_PROTOCOL_UDP)] epm_rhs_udp udp;
158                 [case(EPM_PROTOCOL_IP)] epm_rhs_ip ip;
159                 [case(EPM_PROTOCOL_NCADG)] epm_rhs_ncadg ncadg;
160                 [case(EPM_PROTOCOL_NCACN)] epm_rhs_ncacn ncacn;
161                 [case(EPM_PROTOCOL_NCALRPC)] epm_rhs_ncalrpc ncalrpc;
162                 [case(EPM_PROTOCOL_UUID)] epm_rhs_uuid uuid;
163                 [case(EPM_PROTOCOL_IPX)] epm_rhs_ipx ipx;
164                 [case(EPM_PROTOCOL_SMB)] epm_rhs_smb smb;
165                 [case(EPM_PROTOCOL_PIPE)] epm_rhs_pipe pipe;
166                 [case(EPM_PROTOCOL_NETBIOS)] epm_rhs_netbios netbios;
167                 [case(EPM_PROTOCOL_NB_NB)] epm_rhs_nb_nb nb_nb;
168                 [case(EPM_PROTOCOL_SPX)] epm_rhs_spx spx;
169                 [case(EPM_PROTOCOL_NB_IPX)] epm_rhs_nb_ipx nb_ipx;
170                 [case(EPM_PROTOCOL_HTTP)] epm_rhs_http http;
171                 [case(EPM_PROTOCOL_UNIX_DS)] epm_rhs_unix_ds unix_ds;
172                 [case(EPM_PROTOCOL_NULL)] epm_rhs_null null;
173                 [default]  [flag(NDR_REMAINING)] DATA_BLOB unknown;
174         } epm_rhs;
175
176         typedef struct {
177                 uint8  protocol;
178                 [switch_is(protocol)] epm_protocol_info info;
179         } epm_lhs;
180
181         typedef struct {
182                 [subcontext(2)] epm_lhs lhs;
183                 [subcontext(2),switch_is(lhs.protocol)] epm_rhs rhs;
184         } epm_floor;
185
186         /* note that the NDR_NOALIGN flag is inherited by all nested
187            structures. All of the towers/floors stuff is
188            non-aligned. I wonder what sort of wicked substance these
189            guys were smoking?
190         */
191         typedef [flag(NDR_NOALIGN|NDR_LITTLE_ENDIAN)] struct {
192                 uint16 num_floors;
193                 epm_floor floors[num_floors];
194         } epm_towers;
195
196         typedef [gensize] struct {
197                 [value(ndr_size_epm_towers(0, &r->towers,ndr->flags))] uint32  tower_length;
198                 [subcontext(4)] epm_towers towers;
199         } epm_twr_t;
200
201         typedef struct {
202                 GUID        object;
203                 epm_twr_t   *tower;
204                 ascstr2     annotation;
205         } epm_entry_t;
206
207         typedef struct {
208                 GUID                uuid;
209                 uint16              vers_major;
210                 uint16              vers_minor;
211         } rpc_if_id_t;
212     
213         /**********************/
214         /* Function 0x0       */
215         error_status_t epm_Insert(
216                 [in]    uint32          num_ents,
217                 [in,size_is(num_ents)]  epm_entry_t         entries[],
218                 [in]    uint32    replace
219                 );
220     
221         /**********************/
222         /* Function 0x1       */
223         error_status_t epm_Delete(
224                 [in]     uint32          num_ents,
225                 [in, size_is(num_ents)]  epm_entry_t entries[]
226                 );
227     
228         /**********************/
229         /* Function 0x02      */
230         error_status_t epm_Lookup(
231                 [in]            uint32          inquiry_type,
232                 [in]            GUID            *object,
233                 [in]            rpc_if_id_t     *interface_id,
234                 [in]            uint32          vers_option,
235                 [in,out,ref]    policy_handle   *entry_handle,
236                 [in]            uint32          max_ents,
237                 [out]           uint32          num_ents,
238                 [out, length_is(num_ents), size_is(max_ents)]  epm_entry_t entries[]
239                 );
240
241
242         /**********************/
243         /* Function 0x03      */
244
245         typedef struct {
246                 epm_twr_t *twr;
247         } epm_twr_p_t;
248
249         error_status_t epm_Map(
250                 [in]            GUID            *object,
251                 [in]            epm_twr_t       *map_tower,
252                 [in,out,ref]    policy_handle   *entry_handle,
253                 [in]            uint32          max_towers,
254                 [out]           uint32          num_towers,
255                 [out, length_is(num_towers), size_is(max_towers)]  epm_twr_p_t towers[]
256                 );
257     
258
259         /**********************/
260         /* Function 0x04      */
261         error_status_t epm_LookupHandleFree(
262                 [in,out,ref]    policy_handle *entry_handle
263                 );
264     
265         /**********************/
266         /* Function 0x05      */
267         error_status_t epm_InqObject(
268                 [out]           GUID        *epm_object
269                 );
270     
271
272         /**********************/
273         /* Function 0x06      */
274         error_status_t epm_MgmtDelete(
275                 [in]            uint32   object_speced,
276                 [in]            GUID     *object,
277                 [in]            epm_twr_t    *tower
278                 );
279
280         /**********************/
281         /* Function 0x07      */
282         error_status_t epm_MapAuth();
283 }