iPXE
portmap.h
Go to the documentation of this file.
00001 #ifndef _IPXE_PORTMAP_H
00002 #define _IPXE_PORTMAP_H
00003 
00004 #include <stdint.h>
00005 #include <ipxe/oncrpc.h>
00006 
00007 /** @file
00008  *
00009  * SUN ONC RPC protocol.
00010  *
00011  */
00012 
00013 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00014 
00015 /** PORTMAP default port */
00016 #define PORTMAP_PORT   111
00017 
00018 /** PORTMAP protocol number */
00019 #define ONCRPC_PORTMAP 100000
00020 
00021 /** PORTMAP version */
00022 #define PORTMAP_VERS   2
00023 
00024 
00025 /** TCP protocol number */
00026 #define PORTMAP_PROTO_TCP 6
00027 /** UDB protocol number */
00028 #define PORTMAP_PROTO_UDP 17
00029 
00030 
00031 /**
00032  * A PORTMAP GETPORT reply
00033  *
00034  */
00035 struct portmap_getport_reply {
00036         /** Port returned */
00037         uint32_t        port;
00038 };
00039 
00040 
00041 /**
00042  * Prepare an ONC RPC session to be used as a PORTMAP session
00043  *
00044  * @v session           ONC RPC session
00045  * @v credential        ONC RPC credential
00046  *
00047  * The credential parameter must not be NULL, use 'oncrpc_auth_none' if you
00048  * don't want a particular scheme to be used.
00049  */
00050 static inline void portmap_init_session ( struct oncrpc_session *session,
00051                                           struct oncrpc_cred *credential) {
00052         oncrpc_init_session ( session, credential, &oncrpc_auth_none,
00053                               ONCRPC_PORTMAP, PORTMAP_VERS );
00054 }
00055 
00056 
00057 int portmap_getport ( struct interface *intf, struct oncrpc_session *session,
00058                       uint32_t prog, uint32_t vers, uint32_t proto );
00059 int portmap_get_getport_reply ( struct portmap_getport_reply *getport_reply,
00060                                 struct oncrpc_reply *reply );
00061 
00062 
00063 #endif /* _IPXE_PORTMAP_H */