/*++ Copyright (C) Microsoft Corporation, 1991 - 1999 Module Name: epmp.idl Abstract: This file specifies the interface to the endpoint mapper Author: Bharat Shah (barats) 2-11-92 Revision History: barats 03-13-92 Changed to new spec. barats 05-10-92 Midl related bugbug removed mariogo 06-08-94 Changed to full pointers. mariogo 04-24-96 Added local interface for local runtime <-> rpcss calls. gopalp 06-03-97 Added code to cleanup stale EP Mapper entries. --*/ #ifdef WIN #define __RPC_FAR __far #else #define __RPC_FAR #endif // // EPMP Interface. // [ uuid(e1af8308-5d1f-11c9-91a4-08002b14a0fa), version(3.0), pointer_default(ptr) ] interface epmp { import "nbase.idl"; import "wtypes.idl"; // // Well known endpoint mapper constants // const unsigned32 ep_max_annotation_size = 64; const unsigned32 EP_S_CANT_PERFORM_OP = 0x16c9a0cd; const unsigned32 EP_S_NOT_REGISTERED = 0x16c9a0d6; // // User Defind Types // typedef unsigned long ulong; typedef unsigned32 error_status; typedef [context_handle] void * ept_lookup_handle_t; typedef [context_handle] void * ept_cleanup_handle_t; #define ep_max_annotation_size 64 typedef struct _twr_t { [range(0, 2000)] unsigned32 tower_length; [size_is(tower_length)] byte tower_octet_string[]; } twr_t, *twr_p_t; #ifdef _CLIENT_PASS_ typedef [unique] twr_t *TWR_P_T; #else typedef [ptr] twr_t *TWR_P_T; #endif typedef struct { UUID object; twr_p_t tower; [string] char annotation[ep_max_annotation_size]; } ept_entry_t; typedef [ptr] ept_entry_t * ept_entry_p_t; typedef struct _I_Tower { TWR_P_T Tower; } I_Tower; cpp_quote("//") cpp_quote("// The maximum size, in bytes, of incoming data for methods in the interface.") cpp_quote("//") cpp_quote("// The largest [in] size is for ept_insert if 500 ept_entry_t's are passed but") cpp_quote("// the funciton is depricated and will fail. Any legitimate call should fit into") cpp_quote("// several K and we will be generous.") cpp_quote("//") cpp_quote("#define epmp_MaxRpcSize (4*1024)") // // Interface Exported Methods // void ept_insert( [in] handle_t hEpMapper, [in, range(0,500)] unsigned32 num_ents, [in, size_is(num_ents)] ept_entry_t entries[], [in] unsigned long replace, [out] error_status *status ); void ept_delete ( [in] handle_t hEpMapper, [in, range(0,500)] unsigned32 num_ents, [in, size_is(num_ents)] ept_entry_t entries[], [out] error_status *status ); void ept_lookup ( [in] handle_t hEpMapper, [in] unsigned32 inquiry_type, [in, ptr] UUID * object, [in, ptr] RPC_IF_ID * Ifid, [in] unsigned32 vers_option, [in, out] ept_lookup_handle_t *entry_handle, [in, range(0, 500)] unsigned32 max_ents, [out] unsigned32 *num_ents, [out, length_is(*num_ents), size_is(max_ents)] ept_entry_t entries[], [out] error_status *status ); void __RPC_FAR ept_map ( [in] handle_t hEpMapper, [in, ptr] UUID * obj, [in, ptr] twr_p_t map_tower, [in, out] ept_lookup_handle_t *entry_handle, [in, range(0, 500)] unsigned32 max_towers, [out] unsigned32 *num_towers, [out,size_is(max_towers),length_is(*num_towers)] TWR_P_T *ITowers, [out] error_status *status ); void ept_lookup_handle_free ( [in] handle_t h, [in, out] ept_lookup_handle_t *entry_handle, [out] error_status *status ); void ept_inq_object ( [in] handle_t hEpMapper, [in] UUID *ept_object, [out] error_status *status ); void ept_mgmt_delete ( [in] handle_t hEpMapper, [in] boolean32 object_speced, [in, ptr] UUID * object, [in, ptr] twr_p_t tower, [out] error_status *status ); void __RPC_FAR ept_map_auth ( [in] handle_t hEpMapper, [in, ptr] UUID * obj, [in, ptr] twr_p_t map_tower, [in, unique] PISID pSID, [in, out] ept_lookup_handle_t *entry_handle, [in, range(0, 500)] unsigned32 max_towers, [out] unsigned32 *num_towers, [out,size_is(max_towers),length_is(*num_towers)] TWR_P_T *ITowers, [out] error_status *status ); } // interface epmp // // LOCALEPMP Interface. // #if !defined(MAC) && !defined(MPPC) [ uuid(0b0a6584-9e0f-11cf-a3cf-00805f68cb1b), version(1.1) ] interface localepmp { cpp_quote("//") cpp_quote("// The maximum size, in bytes, of incoming data for methods in the interface.") cpp_quote("//") cpp_quote("// The largest [in] size is for ept_insert_ex if 500 ept_entry_t's are passed.") cpp_quote("// This would require 500*(64+2000+...) > 500K bytes. We would not expect") cpp_quote("// a legitimate client to send this much. 200K will be enough for at least 100") cpp_quote("// towers.") cpp_quote("//") cpp_quote("#define localepmp_MaxRpcSize (200*1024)") typedef [context_handle] void *HPROCESS; // // Must be called to call the local endpoint mapper at all. // error_status_t OpenEndpointMapper([in] handle_t hServer, [out] HPROCESS *pProcessHandle); // // For machines on networks with port restrictions due to firewalls // we need to centrally (for a system) manage port allocation. // // Regardless of the general policy for the network, applications // either want a "standard" port which is not available from an // external network (system services usually) or want a "restricted" // port because their service needs to be avaiable to both internal // and external users. // The endpoint mapper manages ranges of both kinds of ports and // will return "restricted" (if fRestricted) or "standard" ports // as required by applications. // If *pPort is zero then any port maybe used. // typedef [v1_enum] enum { PORT_INTERNET = 1, PORT_INTRANET, PORT_DEFAULT } PORT_TYPE; error_status_t AllocateReservedIPPort( [in] HPROCESS hProcess, [in] PORT_TYPE DesiredPort, [out] long *pAllocationStatus, [out] unsigned short *pPort); void ept_insert_ex( [in] handle_t hEpMapper, [in, out] ept_cleanup_handle_t *hEpCleanup, [in, range(0, 500)] unsigned32 num_ents, [in, size_is(num_ents)] ept_entry_t entries[], [in] unsigned long replace, [out] error_status *status ); void ept_delete_ex ( [in] handle_t hEpMapper, [in, out] ept_cleanup_handle_t *hEpCleanup, [in, range(0, 500)] unsigned32 num_ents, [in, size_is(num_ents)] ept_entry_t entries[], [out] error_status *status ); } // interface localepmp #endif // !MAC && !MPPC