PageRenderTime 48ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/uClinux-dist/user/sendip/ipv6.h

https://bitbucket.org/__wp__/mb-linux-msli
C Header | 64 lines | 48 code | 6 blank | 10 comment | 0 complexity | dec2916fdab3677156a69e84e637de01 MD5 | raw file
Possible License(s): AGPL-3.0, GPL-2.0, LGPL-2.0, MPL-2.0, ISC, BSD-3-Clause, LGPL-2.1, MPL-2.0-no-copyleft-exception, 0BSD, CC-BY-SA-3.0, GPL-3.0, LGPL-3.0, AGPL-1.0, Unlicense
  1. /* ipv6.h
  2. */
  3. #ifndef _SENDIP_IPV6_H
  4. #define _SENDIP_IPV6_H
  5. /* Pseudo header used for checksumming ICMP, TCP, UDP etc
  6. */
  7. struct ipv6_pseudo_hdr {
  8. struct in6_addr source;
  9. struct in6_addr destination;
  10. u_int32_t ulp_length;
  11. u_int32_t zero: 24,
  12. nexthdr: 8;
  13. };
  14. /* Header taken from glibc 2.2
  15. */
  16. typedef struct {
  17. union {
  18. struct ip6_hdrctl {
  19. uint32_t ip6_un1_flow; /* 24 bits of flow-ID */
  20. uint16_t ip6_un1_plen; /* payload length */
  21. uint8_t ip6_un1_nxt; /* next header */
  22. uint8_t ip6_un1_hlim; /* hop limit */
  23. } ip6_un1;
  24. uint8_t ip6_un2_vfc; /* 4 bits version, 4 bits priority */
  25. } ip6_ctlun;
  26. struct in6_addr ip6_src; /* source address */
  27. struct in6_addr ip6_dst; /* destination address */
  28. } ipv6_header;
  29. #define ip6_vfc ip6_ctlun.ip6_un2_vfc
  30. #define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow
  31. #define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen
  32. #define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt
  33. #define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim
  34. #define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim
  35. /* Defines for which parts have been modified
  36. */
  37. #define IPV6_MOD_FLOW 1
  38. #define IPV6_MOD_VERSION 1<<1
  39. #define IPV6_MOD_PRIORITY 1<<2
  40. #define IPV6_MOD_PLEN 1<<3
  41. #define IPV6_MOD_HLIM 1<<4
  42. #define IPV6_MOD_NXT 1<<5
  43. #define IPV6_MOD_SRC 1<<6
  44. #define IPV6_MOD_DST 1<<7
  45. /* Options
  46. */
  47. sendip_option ipv6_opts[] = {
  48. {"f",1,"IPv6 flow ID","32"},
  49. {"t",1,"IPv6 traffic class","0"},
  50. {"l",1,"IPv6 payload length","Correct"},
  51. {"n",1,"IPv6 next header","IPPROTO_NONE"},
  52. {"h",1,"IPv6 hop limit","32"},
  53. {"v",1,"IP version (you probably don't want to change this"},
  54. {"p",1,"IPv6 priority","0"},
  55. {"s",1,"IPv6 source address","::1"},
  56. {"d",1,"IPv6 destination address","Correct"}
  57. };
  58. #endif /* _SENDIP_IPV6_H */