iPXE
portmap.h
Go to the documentation of this file.
1#ifndef _IPXE_PORTMAP_H
2#define _IPXE_PORTMAP_H
3
4#include <stdint.h>
5#include <ipxe/oncrpc.h>
6
7/** @file
8 *
9 * SUN ONC RPC protocol.
10 *
11 */
12
13FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
14
15/** PORTMAP default port */
16#define PORTMAP_PORT 111
17
18/** PORTMAP protocol number */
19#define ONCRPC_PORTMAP 100000
20
21/** PORTMAP version */
22#define PORTMAP_VERS 2
23
24
25/** TCP protocol number */
26#define PORTMAP_PROTO_TCP 6
27/** UDB protocol number */
28#define PORTMAP_PROTO_UDP 17
29
30
31/**
32 * A PORTMAP GETPORT reply
33 *
34 */
36 /** Port returned */
38};
39
40
41/**
42 * Prepare an ONC RPC session to be used as a PORTMAP session
43 *
44 * @v session ONC RPC session
45 * @v credential ONC RPC credential
46 *
47 * The credential parameter must not be NULL, use 'oncrpc_auth_none' if you
48 * don't want a particular scheme to be used.
49 */
50static inline void portmap_init_session ( struct oncrpc_session *session,
51 struct oncrpc_cred *credential) {
52 oncrpc_init_session ( session, credential, &oncrpc_auth_none,
54}
55
56
57int portmap_getport ( struct interface *intf, struct oncrpc_session *session,
58 uint32_t prog, uint32_t vers, uint32_t proto );
59int portmap_get_getport_reply ( struct portmap_getport_reply *getport_reply,
60 struct oncrpc_reply *reply );
61
62
63#endif /* _IPXE_PORTMAP_H */
unsigned int uint32_t
Definition stdint.h:12
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
struct oncrpc_cred oncrpc_auth_none
AUTH NONE authentication flavor.
Definition oncrpc.c:56
void oncrpc_init_session(struct oncrpc_session *session, struct oncrpc_cred *credential, struct oncrpc_cred *verifier, uint32_t prog_name, uint32_t prog_vers)
Prepare an ONC RPC session structure to be used by the ONC RPC layer.
Definition oncrpc.c:115
SUN ONC RPC protocol.
static void portmap_init_session(struct oncrpc_session *session, struct oncrpc_cred *credential)
Prepare an ONC RPC session to be used as a PORTMAP session.
Definition portmap.h:50
#define PORTMAP_VERS
PORTMAP version.
Definition portmap.h:22
int portmap_getport(struct interface *intf, struct oncrpc_session *session, uint32_t prog, uint32_t vers, uint32_t proto)
Send a GETPORT request.
Definition portmap.c:61
#define ONCRPC_PORTMAP
PORTMAP protocol number.
Definition portmap.h:19
int portmap_get_getport_reply(struct portmap_getport_reply *getport_reply, struct oncrpc_reply *reply)
Parse a GETPORT reply.
Definition portmap.c:82
An object interface.
Definition interface.h:125
A PORTMAP GETPORT reply.
Definition portmap.h:35
uint32_t port
Port returned.
Definition portmap.h:37