functions
import "github.com/TheManticoreProject/Manticore/network/dcerpc/interfaces/e1af8308-5d1f-11c9-91a4-08002b14a0fa/3.0/functions"
Package functions holds the endpoint mapper (ept) method stubs. Each stub depends only on the small ndr.Invoker surface, so it is independent of any concrete client or wire-protocol version.
Index
- Constants
- func EptLookup(rpc ndr.Invoker, inquiryType uint32, object *guid.GUID, ifid *structures.RpcIfID, versOption uint32, entryHandle structures.ContextHandle, maxEnts uint32) (entries []structures.EptEntry, next structures.ContextHandle, status uint32, err error)
- func EptLookupHandleFree(rpc ndr.Invoker, handle structures.ContextHandle) (structures.ContextHandle, error)
- func EptMap(rpc ndr.Invoker, object *guid.GUID, mapTower structures.Tower, maxTowers uint32) ([]structures.Tower, error)
- func Lookup(rpc ndr.Invoker) ([]structures.EptEntry, error)
- func Map(rpc ndr.Invoker, iface guid.GUID, ifMajor, ifMinor uint16) ([]structures.Endpoint, error)
Constants
DefaultMaxEnts is the batch size Lookup requests per ept_lookup call. ept_lookup caps max_ents at 500 ([MS-RPCE] 2.2.1.2.4 range(0,500)); enumeration pages until the entry handle is exhausted regardless of this value.
const DefaultMaxEnts = 500
DefaultMaxTowers is the number of towers Map asks ept_map to return. A handful covers the endpoints a single interface is typically bound to.
const DefaultMaxTowers = 4
func EptLookup
func EptLookup(rpc ndr.Invoker, inquiryType uint32, object *guid.GUID, ifid *structures.RpcIfID, versOption uint32, entryHandle structures.ContextHandle, maxEnts uint32) (entries []structures.EptEntry, next structures.ContextHandle, status uint32, err error)
EptLookup calls ept_lookup (opnum 2) ([C706] Appendix O, [MS-RPCE] 2.2.1.2.4) once, returning a single batch of endpoint-map entries. inquiryType selects what to match (use epm.EptInquiryAllElts to enumerate everything); object and ifid are the optional filters; versOption is the interface-version constraint; entryHandle is null on the first call and the value returned by the previous call thereafter. It returns the batch of entries, the advanced entry handle, and the raw [out] status (the caller decides how to treat ept_s_not_registered); err is non-nil only for transport/decoding failures. Lookup wraps this with the paging loop for the common “enumerate everything” case.
func EptLookupHandleFree
func EptLookupHandleFree(rpc ndr.Invoker, handle structures.ContextHandle) (structures.ContextHandle, error)
EptLookupHandleFree calls ept_lookup_handle_free (opnum 1), releasing a lookup context handle obtained from EptLookup. A full enumeration via Lookup nulls the handle on completion and needs no explicit free; this is for abandoning a partial walk early.
func EptMap
func EptMap(rpc ndr.Invoker, object *guid.GUID, mapTower structures.Tower, maxTowers uint32) ([]structures.Tower, error)
EptMap calls ept_map (opnum 3) ([C706] Appendix O): it asks the endpoint mapper to resolve the map tower to the towers of the matching bound endpoints. object is the optional object UUID (nil for the usual interface lookup); maxTowers caps how many towers the server returns. The decoded result towers are returned; use Tower.Endpoint to extract a transport endpoint, or call Map for the common interface-to-endpoint path.
func Lookup
func Lookup(rpc ndr.Invoker) ([]structures.EptEntry, error)
Lookup enumerates the entire endpoint map by paging ept_lookup to completion. It issues EptInquiryAllElts lookups (no object/interface filter) from a null entry handle, accumulating every returned ept_entry_t until the server returns a null entry handle or reports ept_s_not_registered (no further matches) — both a normal end of enumeration. Each entry’s binding is available via EptEntry.DecodeTower / Tower.Binding. For finer control (a filter, a custom batch size, or one page at a time) call EptLookup directly.
func Map
func Map(rpc ndr.Invoker, iface guid.GUID, ifMajor, ifMinor uint16) ([]structures.Endpoint, error)
Map resolves the ncacn_ip_tcp endpoints bound to the given interface UUID and version by building a TCP map tower and calling ept_map, then extracting the endpoints from the returned towers. It is the common path for discovering the dynamic TCP port a service listens on; for finer control (a non-nil object, a custom tower, or the raw towers) call EptMap directly.