Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #ifndef _GPXE_IP6_H
  2. #define _GPXE_IP6_H
  3. /** @file
  4. *
  5. * IP6 protocol
  6. *
  7. */
  8. #include <stdint.h>
  9. #include <gpxe/in.h>
  10. /* IP6 constants */
  11. #define IP6_VERSION 0x6
  12. #define IP6_HOP_LIMIT 255
  13. /**
  14. * I/O buffer contents
  15. * This is duplicated in tcp.h and here. Ideally it should go into iobuf.h
  16. */
  17. #define MAX_HDR_LEN 100
  18. #define MAX_IOB_LEN 1500
  19. #define MIN_IOB_LEN MAX_HDR_LEN + 100 /* To account for padding by LL */
  20. #define IP6_EQUAL( in6_addr1, in6_addr2 ) \
  21. ( memcmp ( ( char* ) &( in6_addr1 ), ( char* ) &( in6_addr2 ),\
  22. sizeof ( struct in6_addr ) ) == 0 )
  23. #define IS_UNSPECIFIED( addr ) \
  24. ( ( (addr).in6_u.u6_addr32[0] == 0x00000000 ) && \
  25. ( (addr).in6_u.u6_addr32[1] == 0x00000000 ) && \
  26. ( (addr).in6_u.u6_addr32[2] == 0x00000000 ) && \
  27. ( (addr).in6_u.u6_addr32[3] == 0x00000000 ) )
  28. /* IP6 header */
  29. struct ip6_header {
  30. uint32_t ver_traffic_class_flow_label;
  31. uint16_t payload_len;
  32. uint8_t nxt_hdr;
  33. uint8_t hop_limit;
  34. struct in6_addr src;
  35. struct in6_addr dest;
  36. };
  37. /* IP6 pseudo header */
  38. struct ipv6_pseudo_header {
  39. struct in6_addr src;
  40. struct in6_addr dest;
  41. uint8_t zero_padding;
  42. uint8_t nxt_hdr;
  43. uint16_t len;
  44. };
  45. /* Next header numbers */
  46. #define IP6_HOPBYHOP 0x00
  47. #define IP6_ROUTING 0x43
  48. #define IP6_FRAGMENT 0x44
  49. #define IP6_AUTHENTICATION 0x51
  50. #define IP6_DEST_OPTS 0x60
  51. #define IP6_ESP 0x50
  52. #define IP6_ICMP6 0x58
  53. #define IP6_NO_HEADER 0x59
  54. struct io_buffer;
  55. struct net_device;
  56. struct net_protocol;
  57. extern struct net_protocol ipv6_protocol;
  58. extern struct tcpip_net_protocol ipv6_tcpip_protocol;
  59. extern char * inet6_ntoa ( struct in6_addr in6 );
  60. extern int add_ipv6_address ( struct net_device *netdev,
  61. struct in6_addr prefix, int prefix_len,
  62. struct in6_addr address,
  63. struct in6_addr gateway );
  64. extern void del_ipv6_address ( struct net_device *netdev );
  65. #endif /* _GPXE_IP6_H */