Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

portmap.h 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #ifndef _IPXE_PORTMAP_H
  2. #define _IPXE_PORTMAP_H
  3. #include <stdint.h>
  4. #include <ipxe/oncrpc.h>
  5. /** @file
  6. *
  7. * SUN ONC RPC protocol.
  8. *
  9. */
  10. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  11. /** PORTMAP default port */
  12. #define PORTMAP_PORT 111
  13. /** PORTMAP protocol number */
  14. #define ONCRPC_PORTMAP 100000
  15. /** PORTMAP version */
  16. #define PORTMAP_VERS 2
  17. /** TCP protocol number */
  18. #define PORTMAP_PROTO_TCP 6
  19. /** UDB protocol number */
  20. #define PORTMAP_PROTO_UDP 17
  21. /**
  22. * A PORTMAP GETPORT reply
  23. *
  24. */
  25. struct portmap_getport_reply {
  26. /** Port returned */
  27. uint32_t port;
  28. };
  29. /**
  30. * Prepare an ONC RPC session to be used as a PORTMAP session
  31. *
  32. * @v session ONC RPC session
  33. * @v credential ONC RPC credential
  34. *
  35. * The credential parameter must not be NULL, use 'oncrpc_auth_none' if you
  36. * don't want a particular scheme to be used.
  37. */
  38. static inline void portmap_init_session ( struct oncrpc_session *session,
  39. struct oncrpc_cred *credential) {
  40. oncrpc_init_session ( session, credential, &oncrpc_auth_none,
  41. ONCRPC_PORTMAP, PORTMAP_VERS );
  42. }
  43. int portmap_getport ( struct interface *intf, struct oncrpc_session *session,
  44. uint32_t prog, uint32_t vers, uint32_t proto );
  45. int portmap_get_getport_reply ( struct portmap_getport_reply *getport_reply,
  46. struct oncrpc_reply *reply );
  47. #endif /* _IPXE_PORTMAP_H */