ip6.h File Reference

IP6 protocol. More...

#include <stdint.h>
#include <gpxe/in.h>

Go to the source code of this file.

Data Structures

struct  ip6_header
struct  ipv6_pseudo_header

Defines

#define IP6_VERSION   0x6
#define IP6_HOP_LIMIT   255
#define MAX_HDR_LEN   100
 I/O buffer contents This is duplicated in tcp.h and here.
#define MAX_IOB_LEN   1500
#define MIN_IOB_LEN   MAX_HDR_LEN + 100
#define IP6_EQUAL(in6_addr1, in6_addr2)
#define IS_UNSPECIFIED(addr)
#define IP6_HOPBYHOP   0x00
#define IP6_ROUTING   0x43
#define IP6_FRAGMENT   0x44
#define IP6_AUTHENTICATION   0x51
#define IP6_DEST_OPTS   0x60
#define IP6_ESP   0x50
#define IP6_ICMP6   0x58
#define IP6_NO_HEADER   0x59

Functions

 FILE_LICENCE (GPL2_OR_LATER)
char * inet6_ntoa (struct in6_addr in6)
 Print a IP6 address as xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx.
int add_ipv6_address (struct net_device *netdev, struct in6_addr prefix, int prefix_len, struct in6_addr address, struct in6_addr gateway)
 Add IPv6 interface.
void del_ipv6_address (struct net_device *netdev)
 Remove IPv6 interface.

Variables

struct net_protocol ipv6_protocol
struct tcpip_net_protocol ipv6_tcpip_protocol


Detailed Description

IP6 protocol.

Definition in file ip6.h.


Define Documentation

#define IP6_VERSION   0x6

Definition at line 17 of file ip6.h.

#define IP6_HOP_LIMIT   255

Definition at line 18 of file ip6.h.

Referenced by ipv6_tx().

#define MAX_HDR_LEN   100

I/O buffer contents This is duplicated in tcp.h and here.

Ideally it should go into iobuf.h

Definition at line 24 of file ip6.h.

Referenced by icmp6_send_solicit(), tcp_xmit(), and tcp_xmit_reset().

#define MAX_IOB_LEN   1500

Definition at line 25 of file ip6.h.

#define MIN_IOB_LEN   MAX_HDR_LEN + 100

Definition at line 26 of file ip6.h.

Referenced by icmp6_send_solicit().

#define IP6_EQUAL ( in6_addr1,
in6_addr2   ) 

Value:

( memcmp ( ( char* ) &( in6_addr1 ), ( char* ) &( in6_addr2 ),\
        sizeof ( struct in6_addr ) ) == 0 )

Definition at line 28 of file ip6.h.

Referenced by add_ipv6_miniroute(), ipv6_tx(), ndp_find_entry(), and ndp_process_advert().

#define IS_UNSPECIFIED ( addr   ) 

Value:

( ( (addr).in6_u.u6_addr32[0] == 0x00000000 ) && \
        ( (addr).in6_u.u6_addr32[1] == 0x00000000 ) && \
        ( (addr).in6_u.u6_addr32[2] == 0x00000000 ) && \
        ( (addr).in6_u.u6_addr32[3] == 0x00000000 ) )

Definition at line 32 of file ip6.h.

Referenced by ipv6_tx().

#define IP6_HOPBYHOP   0x00

Definition at line 57 of file ip6.h.

Referenced by ipv6_process_nxt_hdr().

#define IP6_ROUTING   0x43

Definition at line 58 of file ip6.h.

Referenced by ipv6_process_nxt_hdr().

#define IP6_FRAGMENT   0x44

Definition at line 59 of file ip6.h.

Referenced by ipv6_process_nxt_hdr().

#define IP6_AUTHENTICATION   0x51

Definition at line 60 of file ip6.h.

Referenced by ipv6_process_nxt_hdr().

#define IP6_DEST_OPTS   0x60

Definition at line 61 of file ip6.h.

Referenced by ipv6_process_nxt_hdr().

#define IP6_ESP   0x50

Definition at line 62 of file ip6.h.

Referenced by ipv6_process_nxt_hdr().

#define IP6_ICMP6   0x58

Definition at line 63 of file ip6.h.

Referenced by ipv6_process_nxt_hdr().

#define IP6_NO_HEADER   0x59

Definition at line 64 of file ip6.h.

Referenced by ipv6_process_nxt_hdr().


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

char* inet6_ntoa ( struct in6_addr  in6  ) 

Print a IP6 address as xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx.

Definition at line 355 of file ipv6.c.

References sprintf.

Referenced by add_ndp_entry(), ipv6_dump(), ipv6_ntoa(), ipv6_tx(), and ndp_resolve().

00355                                           {
00356         static char buf[40];
00357         uint16_t *bytes = ( uint16_t* ) &in6;
00358         sprintf ( buf, "%x:%x:%x:%x:%x:%x:%x:%x", bytes[0], bytes[1], bytes[2],
00359                         bytes[3], bytes[4], bytes[5], bytes[6], bytes[7] );
00360         return buf;
00361 }

int add_ipv6_address ( struct net_device netdev,
struct in6_addr  prefix,
int  prefix_len,
struct in6_addr  address,
struct in6_addr  gateway 
)

Add IPv6 interface.

Parameters:
netdev Network device
prefix Destination prefix
address Address of the interface
gateway Gateway address (or ::0 for no gateway)

Definition at line 100 of file ipv6.c.

References add_ipv6_miniroute(), del_ipv6_address(), and ENOMEM.

00102                                                  {
00103         struct ipv6_miniroute *miniroute;
00104 
00105         /* Clear any existing address for this net device */
00106         del_ipv6_address ( netdev );
00107 
00108         /* Add new miniroute */
00109         miniroute = add_ipv6_miniroute ( netdev, prefix, prefix_len, address,
00110                                          gateway );
00111         if ( ! miniroute )
00112                 return -ENOMEM;
00113 
00114         return 0;
00115 }

void del_ipv6_address ( struct net_device netdev  ) 

Remove IPv6 interface.

Parameters:
netdev Network device

Definition at line 122 of file ipv6.c.

References del_ipv6_miniroute(), ipv6_miniroute::list, list_for_each_entry, and ipv6_miniroute::netdev.

Referenced by add_ipv6_address().

00122                                                     {
00123         struct ipv6_miniroute *miniroute;
00124 
00125         list_for_each_entry ( miniroute, &miniroutes, list ) {
00126                 if ( miniroute->netdev == netdev ) {
00127                         del_ipv6_miniroute ( miniroute );
00128                         break;
00129                 }
00130         }
00131 }


Variable Documentation

Definition at line 18 of file ipv6.c.

Referenced by ipv6_tx().


Generated on Tue Apr 6 20:01:51 2010 for gPXE by  doxygen 1.5.7.1