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.

ip.h 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #ifndef _GPXE_IP_H
  2. #define _GPXE_IP_H
  3. /** @file
  4. *
  5. * IP protocol
  6. *
  7. */
  8. #include <ip.h>
  9. #include <gpxe/retry.h>
  10. /* IP constants */
  11. #define IP_VER 4
  12. #define IP_MASK_VER 0xf0
  13. #define IP_MASK_HLEN 0x0f
  14. #define IP_MASK_OFFSET 0x1fff
  15. #define IP_MASK_DONOTFRAG 0x4000
  16. #define IP_MASK_MOREFRAGS 0x2000
  17. #define IP_PSHLEN 12
  18. /* IP header defaults */
  19. #define IP_TOS 0
  20. #define IP_TTL 64
  21. #define IP_FRAG_PKB_SIZE 1500
  22. #define IP_FRAG_TIMEOUT 50
  23. /* IP4 pseudo header */
  24. struct ipv4_pseudo_header {
  25. struct in_addr src;
  26. struct in_addr dest;
  27. uint8_t zero_padding;
  28. uint8_t protocol;
  29. uint16_t len;
  30. };
  31. /* Fragment reassembly buffer */
  32. struct frag_buffer {
  33. /* Identification number */
  34. uint16_t ident;
  35. /* Source network address */
  36. struct in_addr src;
  37. /* Destination network address */
  38. struct in_addr dest;
  39. /* Reassembled packet buffer */
  40. struct pk_buff *frag_pkb;
  41. /* Reassembly timer */
  42. struct retry_timer frag_timer;
  43. /* List of fragment reassembly buffers */
  44. struct list_head list;
  45. };
  46. struct pk_buff;
  47. struct net_device;
  48. struct net_protocol;
  49. struct tcpip_protocol;
  50. extern struct net_protocol ipv4_protocol;
  51. extern int add_ipv4_address ( struct net_device *netdev,
  52. struct in_addr address, struct in_addr netmask,
  53. struct in_addr gateway );
  54. extern void del_ipv4_address ( struct net_device *netdev );
  55. #endif /* _GPXE_IP_H */