Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / ipxe / src / include / ipxe / portmap.h
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
13 FILE_LICENCE ( GPL2_OR_LATER );
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  */
35 struct portmap_getport_reply {
36         /** Port returned */
37         uint32_t        port;
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  */
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 );
54 }
55
56
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 );
61
62
63 #endif /* _IPXE_PORTMAP_H */