00001 #ifndef _GPXE_IP6_H 00002 #define _GPXE_IP6_H 00003 00004 /** @file 00005 * 00006 * IP6 protocol 00007 * 00008 */ 00009 00010 FILE_LICENCE ( GPL2_OR_LATER ); 00011 00012 #include <stdint.h> 00013 #include <gpxe/in.h> 00014 00015 /* IP6 constants */ 00016 00017 #define IP6_VERSION 0x6 00018 #define IP6_HOP_LIMIT 255 00019 00020 /** 00021 * I/O buffer contents 00022 * This is duplicated in tcp.h and here. Ideally it should go into iobuf.h 00023 */ 00024 #define MAX_HDR_LEN 100 00025 #define MAX_IOB_LEN 1500 00026 #define MIN_IOB_LEN MAX_HDR_LEN + 100 /* To account for padding by LL */ 00027 00028 #define IP6_EQUAL( in6_addr1, in6_addr2 ) \ 00029 ( memcmp ( ( char* ) &( in6_addr1 ), ( char* ) &( in6_addr2 ),\ 00030 sizeof ( struct in6_addr ) ) == 0 ) 00031 00032 #define IS_UNSPECIFIED( addr ) \ 00033 ( ( (addr).in6_u.u6_addr32[0] == 0x00000000 ) && \ 00034 ( (addr).in6_u.u6_addr32[1] == 0x00000000 ) && \ 00035 ( (addr).in6_u.u6_addr32[2] == 0x00000000 ) && \ 00036 ( (addr).in6_u.u6_addr32[3] == 0x00000000 ) ) 00037 /* IP6 header */ 00038 struct ip6_header { 00039 uint32_t ver_traffic_class_flow_label; 00040 uint16_t payload_len; 00041 uint8_t nxt_hdr; 00042 uint8_t hop_limit; 00043 struct in6_addr src; 00044 struct in6_addr dest; 00045 }; 00046 00047 /* IP6 pseudo header */ 00048 struct ipv6_pseudo_header { 00049 struct in6_addr src; 00050 struct in6_addr dest; 00051 uint8_t zero_padding; 00052 uint8_t nxt_hdr; 00053 uint16_t len; 00054 }; 00055 00056 /* Next header numbers */ 00057 #define IP6_HOPBYHOP 0x00 00058 #define IP6_ROUTING 0x43 00059 #define IP6_FRAGMENT 0x44 00060 #define IP6_AUTHENTICATION 0x51 00061 #define IP6_DEST_OPTS 0x60 00062 #define IP6_ESP 0x50 00063 #define IP6_ICMP6 0x58 00064 #define IP6_NO_HEADER 0x59 00065 00066 struct io_buffer; 00067 struct net_device; 00068 struct net_protocol; 00069 00070 extern struct net_protocol ipv6_protocol; 00071 extern struct tcpip_net_protocol ipv6_tcpip_protocol; 00072 extern char * inet6_ntoa ( struct in6_addr in6 ); 00073 00074 extern int add_ipv6_address ( struct net_device *netdev, 00075 struct in6_addr prefix, int prefix_len, 00076 struct in6_addr address, 00077 struct in6_addr gateway ); 00078 extern void del_ipv6_address ( struct net_device *netdev ); 00079 00080 #endif /* _GPXE_IP6_H */
1.5.7.1