OSDN Git Service

Fix no pic
[uclinux-h8/uClinux-dist.git] / user / sendip / ipv6.h
1 /* ipv6.h
2  */
3 #ifndef _SENDIP_IPV6_H
4 #define _SENDIP_IPV6_H
5
6 /* Pseudo header used for checksumming ICMP, TCP, UDP etc
7  */
8 struct ipv6_pseudo_hdr {
9         struct in6_addr source;
10         struct in6_addr destination;
11         u_int32_t ulp_length;
12         u_int32_t  zero: 24,
13                 nexthdr:  8;
14 };
15
16 /* Header taken from glibc 2.2
17  */
18 typedef struct {
19         union  {
20                 struct ip6_hdrctl {
21                         uint32_t ip6_un1_flow;   /* 24 bits of flow-ID */
22                         uint16_t ip6_un1_plen;   /* payload length */
23                         uint8_t  ip6_un1_nxt;    /* next header */
24                         uint8_t  ip6_un1_hlim;   /* hop limit */
25                 } ip6_un1;
26                 uint8_t ip6_un2_vfc;       /* 4 bits version, 4 bits priority */
27         } ip6_ctlun;
28         struct in6_addr ip6_src;      /* source address */
29         struct in6_addr ip6_dst;      /* destination address */
30 } ipv6_header;
31
32 #define ip6_vfc   ip6_ctlun.ip6_un2_vfc
33 #define ip6_flow  ip6_ctlun.ip6_un1.ip6_un1_flow
34 #define ip6_plen  ip6_ctlun.ip6_un1.ip6_un1_plen
35 #define ip6_nxt   ip6_ctlun.ip6_un1.ip6_un1_nxt
36 #define ip6_hlim  ip6_ctlun.ip6_un1.ip6_un1_hlim
37 #define ip6_hops  ip6_ctlun.ip6_un1.ip6_un1_hlim
38
39 /* Defines for which parts have been modified
40  */
41 #define IPV6_MOD_FLOW     1
42 #define IPV6_MOD_VERSION  1<<1
43 #define IPV6_MOD_PRIORITY 1<<2
44 #define IPV6_MOD_PLEN     1<<3
45 #define IPV6_MOD_HLIM     1<<4
46 #define IPV6_MOD_NXT      1<<5
47 #define IPV6_MOD_SRC      1<<6
48 #define IPV6_MOD_DST      1<<7
49
50 /* Options
51  */
52 sendip_option ipv6_opts[] = {
53         {"f",1,"IPv6 flow ID","32"},
54         {"t",1,"IPv6 traffic class","0"},
55         {"l",1,"IPv6 payload length","Correct"},
56         {"n",1,"IPv6 next header","IPPROTO_NONE"},
57         {"h",1,"IPv6 hop limit","32"},
58         {"v",1,"IP version (you probably don't want to change this"},
59         {"p",1,"IPv6 priority","0"},
60         {"s",1,"IPv6 source address","::1"},
61         {"d",1,"IPv6 destination address","Correct"}
62 };
63
64 #endif  /* _SENDIP_IPV6_H */