10 FILE_LICENCE ( GPL2_OR_LATER
);
14 #include <gpxe/tcpip.h>
15 #include <gpxe/retry.h>
19 #define IP6_VERSION 0x6
20 #define IP6_HOP_LIMIT 255
22 #define IP6_FRAG_IOB_SIZE 2000
23 #define IP6_FRAG_TIMEOUT 50
25 #define IP6_MORE_FRAGMENTS 0x01
29 * This is duplicated in tcp.h and here. Ideally it should go into iobuf.h
31 #define MAX_HDR_LEN 100
32 #define MAX_IOB_LEN 1500
33 #define MIN_IOB_LEN MAX_HDR_LEN + 100 /* To account for padding by LL */
35 #define IP6_EQUAL( in6_addr1, in6_addr2 ) \
36 ( memcmp ( ( char* ) &( in6_addr1 ), ( char* ) &( in6_addr2 ),\
37 sizeof ( struct in6_addr ) ) == 0 )
39 #define IS_UNSPECIFIED( addr ) \
40 ( ( (addr).in6_u.u6_addr32[0] == 0x00000000 ) && \
41 ( (addr).in6_u.u6_addr32[1] == 0x00000000 ) && \
42 ( (addr).in6_u.u6_addr32[2] == 0x00000000 ) && \
43 ( (addr).in6_u.u6_addr32[3] == 0x00000000 ) )
47 uint32_t ver_traffic_class_flow_label
;
55 /* IP6 pseudo header */
56 struct ipv6_pseudo_header
{
64 /* IP6 option header */
70 /* IP6 fragment header */
74 uint16_t offset_flags
;
78 /* Fragment reassembly buffer */
80 /* "Next Header" for the packet. */
82 /* Identification number */
84 /* Source network address */
86 /* Destination network address */
88 /* Reassembled I/O buffer */
89 struct io_buffer
*frag_iob
;
90 /* Reassembly timer */
91 struct retry_timer frag_timer
;
92 /* List of fragment reassembly buffers */
93 struct list_head list
;
96 /* Next header numbers */
97 #define IP6_HOPBYHOP_FIRST 0x00
98 #define IP6_HOPBYHOP 0xFE
100 #define IP6_PADN 0x01
101 #define IP6_ICMP6 0x3A
102 #define IP6_ROUTING 0x2B
103 #define IP6_FRAGMENT 0x2C
104 #define IP6_AUTHENTICATION 0x33
105 #define IP6_DEST_OPTS 0x3C
107 #define IP6_NO_HEADER 0x3B
113 extern struct net_protocol ipv6_protocol
;
114 extern struct tcpip_net_protocol ipv6_tcpip_protocol
;
115 extern char * inet6_ntoa ( struct in6_addr in6
);
116 extern int inet6_aton ( const char *cp
, struct in6_addr
*inp
);
118 void ipv6_generate_eui64 ( uint8_t *out
, uint8_t *ll
);
120 int ipv6_match_prefix ( struct in6_addr
*p1
, struct in6_addr
*p2
, size_t len
);
122 extern int add_ipv6_address ( struct net_device
*netdev
,
123 struct in6_addr prefix
, int prefix_len
,
124 struct in6_addr address
,
125 struct in6_addr gateway
);
126 extern void del_ipv6_address ( struct net_device
*netdev
);
128 extern int ipv6_tx ( struct io_buffer
*iobuf
,
129 struct tcpip_protocol
*tcpip
,
130 struct sockaddr_tcpip
*st_src
,
131 struct sockaddr_tcpip
*st_dest
,
132 struct net_device
*netdev
,
133 uint16_t *trans_csum
);
135 #endif /* _GPXE_IP6_H */