You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

udp.h 774B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef _GPXE_UDP_H
  2. #define _GPXE_UDP_H
  3. /** @file
  4. *
  5. * UDP protocol
  6. *
  7. * This file defines the gPXE UDP API.
  8. *
  9. */
  10. FILE_LICENCE ( GPL2_OR_LATER );
  11. #include <stddef.h>
  12. #include <gpxe/iobuf.h>
  13. #include <gpxe/tcpip.h>
  14. #include <gpxe/if_ether.h>
  15. struct xfer_interface;
  16. /**
  17. * UDP constants
  18. */
  19. #define UDP_MAX_HLEN 72
  20. #define UDP_MAX_TXIOB ETH_MAX_MTU
  21. #define UDP_MIN_TXIOB ETH_ZLEN
  22. /**
  23. * A UDP header
  24. */
  25. struct udp_header {
  26. /** Source port */
  27. uint16_t src;
  28. /** Destination port */
  29. uint16_t dest;
  30. /** Length */
  31. uint16_t len;
  32. /** Checksum */
  33. uint16_t chksum;
  34. };
  35. extern int udp_open_promisc ( struct xfer_interface *xfer );
  36. extern int udp_open ( struct xfer_interface *xfer, struct sockaddr *peer,
  37. struct sockaddr *local );
  38. #endif /* _GPXE_UDP_H */