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