1 #ifndef _IPXE_PORTMAP_H
2 #define _IPXE_PORTMAP_H
5 #include <ipxe/oncrpc.h>
9 * SUN ONC RPC protocol.
13 FILE_LICENCE ( GPL2_OR_LATER );
15 /** PORTMAP default port */
16 #define PORTMAP_PORT 111
18 /** PORTMAP protocol number */
19 #define ONCRPC_PORTMAP 100000
21 /** PORTMAP version */
22 #define PORTMAP_VERS 2
25 /** TCP protocol number */
26 #define PORTMAP_PROTO_TCP 6
27 /** UDB protocol number */
28 #define PORTMAP_PROTO_UDP 17
32 * A PORTMAP GETPORT reply
35 struct portmap_getport_reply {
42 * Prepare an ONC RPC session to be used as a PORTMAP session
44 * @v session ONC RPC session
45 * @v credential ONC RPC credential
47 * The credential parameter must not be NULL, use 'oncrpc_auth_none' if you
48 * don't want a particular scheme to be used.
50 static inline void portmap_init_session ( struct oncrpc_session *session,
51 struct oncrpc_cred *credential) {
52 oncrpc_init_session ( session, credential, &oncrpc_auth_none,
53 ONCRPC_PORTMAP, PORTMAP_VERS );
57 int portmap_getport ( struct interface *intf, struct oncrpc_session *session,
58 uint32_t prog, uint32_t vers, uint32_t proto );
59 int portmap_get_getport_reply ( struct portmap_getport_reply *getport_reply,
60 struct oncrpc_reply *reply );
63 #endif /* _IPXE_PORTMAP_H */