iPXE
Data Structures | Defines | Functions | Variables
ipv6_test.c File Reference

IPv6 tests. More...

#include <stdint.h>
#include <string.h>
#include <byteswap.h>
#include <ipxe/ipv6.h>
#include <ipxe/test.h>

Go to the source code of this file.

Data Structures

struct  ipv6_test_route
 An IPv6 test routing table entry. More...
struct  ipv6_test_table
 An IPv6 test routing table. More...

Defines

#define IPV6(...)   { __VA_ARGS__ }
 Define inline IPv6 address.
#define TABLE(name,...)
 Define a test routing table.
#define inet6_ntoa_ok(addr, text)
#define inet6_aton_ok(text, addr)
#define inet6_aton_fail_ok(text)   inet6_aton_fail_okx ( text, __FILE__, __LINE__ )
#define ipv6_table_ok(table)   ipv6_table_okx ( table, __FILE__, __LINE__ )
#define ipv6_route_ok(table, dest, src, next)   ipv6_route_okx ( table, dest, src, next, __FILE__, __LINE__ )

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 TABLE (table_link_local,{"fe80::69ff:fe50:5845", 64, NULL})
 Routing table with only a link-local address.
 TABLE (table_normal,{"fe80::69ff:fe50:5845", 64, NULL},{"2001:db8:3::1", 64,"fe80::1"})
 Routing table with a global address.
 TABLE (table_multi,{"fe80::69ff:fe50:5845", 64, NULL},{"2001:db8:3::1", 64,"fe80::1"},{"2001:db8:5::1", 64, NULL},{"2001:db8:42::1", 64,"fe80::2"},{"fd44:9112:6442::69ff:fe50:5845", 64,"fe80::1"},{"fd70:6ba9:50ae::69ff:fe50:5845", 64,"fe80::3"})
 Routing table with multiple addresses and routers.
static void inet6_ntoa_okx (const struct in6_addr *addr, const char *text, const char *file, unsigned int line)
 Report an inet6_ntoa() test result.
static void inet6_aton_okx (const char *text, const struct in6_addr *addr, const char *file, unsigned int line)
 Report an inet6_aton() test result.
static void inet6_aton_fail_okx (const char *text, const char *file, unsigned int line)
 Report an inet6_aton() failure test result.
static void ipv6_table_okx (struct ipv6_test_table *table, const char *file, unsigned int line)
 Create test routing table.
static void ipv6_route_okx (struct ipv6_test_table *table, const char *dest, const char *src, const char *next, const char *file, unsigned int line)
 Report an ipv6_route() test result.
static void ipv6_table_del (struct ipv6_test_table *table)
 Destroy test routing table.
static void ipv6_test_exec (void)
 Perform IPv6 self-tests.

Variables

static struct in6_addr sample_unspecified
 The unspecified IPv6 address.
static struct in6_addr sample_link_local
 A sample link-local IPv6 address.
static struct in6_addr sample_site_local
 A sample site-local IPv6 address.
static struct in6_addr sample_ula
 A sample ULA IPv6 address.
static struct in6_addr sample_global
 A sample global IPv6 address.
static struct in6_addr sample_multicast
 A sample multicast IPv6 address.
static struct net_device ipv6_test_netdev
 Dummy network device used for routing tests.
struct self_test ipv6_test __self_test
 IPv6 self-test.

Detailed Description

IPv6 tests.

Definition in file ipv6_test.c.


Define Documentation

#define IPV6 (   ...)    { __VA_ARGS__ }

Define inline IPv6 address.

Definition at line 42 of file ipv6_test.c.

Referenced by ipv6_test_exec().

#define TABLE (   name,
  ... 
)
Value:
static const struct ipv6_test_route name ## _routes[] = {       \
                __VA_ARGS__                                             \
        };                                                              \
        static struct ipv6_test_table name = {                          \
                .routes = name ## _routes,                              \
                .count = ( sizeof ( name ## _routes ) /                 \
                           sizeof ( name ## _routes[0] ) ),             \
                .list = LIST_HEAD_INIT ( name.list ),                   \
        };

Define a test routing table.

Definition at line 65 of file ipv6_test.c.

#define inet6_ntoa_ok (   addr,
  text 
)
Value:
do {                            \
        static const struct in6_addr in = {                             \
                .s6_addr = addr,                                        \
        };                                                              \
        inet6_ntoa_okx ( &in, text, __FILE__, __LINE__ );               \
        } while ( 0 )

Definition at line 158 of file ipv6_test.c.

Referenced by ipv6_test_exec().

#define inet6_aton_ok (   text,
  addr 
)
Value:
do {                            \
        static const struct in6_addr in = {                             \
                .s6_addr = addr,                                        \
        };                                                              \
        inet6_aton_okx ( text, &in, __FILE__, __LINE__ );               \
        } while ( 0 )

Definition at line 182 of file ipv6_test.c.

Referenced by ipv6_test_exec().

#define inet6_aton_fail_ok (   text)    inet6_aton_fail_okx ( text, __FILE__, __LINE__ )

Definition at line 202 of file ipv6_test.c.

Referenced by ipv6_test_exec().

#define ipv6_table_ok (   table)    ipv6_table_okx ( table, __FILE__, __LINE__ )

Definition at line 253 of file ipv6_test.c.

Referenced by ipv6_test_exec().

#define ipv6_route_ok (   table,
  dest,
  src,
  next 
)    ipv6_route_okx ( table, dest, src, next, __FILE__, __LINE__ )

Definition at line 321 of file ipv6_test.c.

Referenced by ipv6_test_exec().


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
TABLE ( table_link_local  )

Routing table with only a link-local address.

TABLE ( table_normal  )

Routing table with a global address.

TABLE ( table_multi  )

Routing table with multiple addresses and routers.

static void inet6_ntoa_okx ( const struct in6_addr addr,
const char *  text,
const char *  file,
unsigned int  line 
) [static]

Report an inet6_ntoa() test result.

Parameters:
addrIPv6 address
textExpected textual representation
fileTest code file
lineTest code line

Definition at line 145 of file ipv6_test.c.

References DBG, inet6_ntoa(), ntohs, okx, and strcmp().

                                                                   {
        char *actual;

        actual = inet6_ntoa ( addr );
        DBG ( "inet6_ntoa ( %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x ) "
              "= %s\n", ntohs ( addr->s6_addr16[0] ),
              ntohs ( addr->s6_addr16[1] ), ntohs ( addr->s6_addr16[2] ),
              ntohs ( addr->s6_addr16[3] ), ntohs ( addr->s6_addr16[4] ),
              ntohs ( addr->s6_addr16[5] ), ntohs ( addr->s6_addr16[6] ),
              ntohs ( addr->s6_addr16[7] ), actual );
        okx ( strcmp ( actual, text ) == 0, file, line );
}
static void inet6_aton_okx ( const char *  text,
const struct in6_addr addr,
const char *  file,
unsigned int  line 
) [static]

Report an inet6_aton() test result.

Parameters:
textTextual representation
addrExpected IPv6 address
fileTest code file
lineTest code line

Definition at line 173 of file ipv6_test.c.

References DBG, inet6_aton(), inet6_ntoa(), memcmp(), and okx.

                                                                   {
        struct in6_addr actual;

        okx ( inet6_aton ( text, &actual ) == 0, file, line );
        DBG ( "inet6_aton ( \"%s\" ) = %s\n", text, inet6_ntoa ( &actual ) );
        okx ( memcmp ( &actual, addr, sizeof ( actual ) ) == 0,
              file, line );
}
static void inet6_aton_fail_okx ( const char *  text,
const char *  file,
unsigned int  line 
) [static]

Report an inet6_aton() failure test result.

Parameters:
textTextual representation
fileTest code file
lineTest code line

Definition at line 196 of file ipv6_test.c.

References inet6_aton(), and okx.

                                                      {
        struct in6_addr dummy;

        okx ( inet6_aton ( text, &dummy ) != 0, file, line );
}
static void ipv6_table_okx ( struct ipv6_test_table table,
const char *  file,
unsigned int  line 
) [static]

Create test routing table.

Parameters:
tableTest routing table
fileTest code file
lineTest code line

Definition at line 212 of file ipv6_test.c.

References ipv6_test_route::address, ipv6_test_table::count, inet6_aton(), INIT_LIST_HEAD, ipv6_add_miniroute(), ipv6_miniroutes, ipv6_test_table::list, list_empty, list_splice, list_splice_init, NULL, okx, ipv6_test_route::prefix_len, route(), ipv6_test_route::router, and ipv6_test_table::routes.

                                                 {
        const struct ipv6_test_route *route;
        struct in6_addr address;
        struct in6_addr router;
        struct list_head saved;
        unsigned int i;

        /* Sanity check */
        okx ( list_empty ( &table->list ), file, line );

        /* Save existing routing table */
        INIT_LIST_HEAD ( &saved );
        list_splice_init ( &ipv6_miniroutes, &saved );

        /* Construct routing table */
        for ( i = 0 ; i < table->count ; i++ ) {

                /* Parse address and router (if applicable) */
                route = &table->routes[i];
                okx ( inet6_aton ( route->address, &address ) == 0,
                      file, line );
                if ( route->router ) {
                        okx ( inet6_aton ( route->router, &router ) == 0,
                              file, line );
                }

                /* Add routing table entry */
                okx ( ipv6_add_miniroute ( &ipv6_test_netdev, &address,
                                           route->prefix_len,
                                           ( route->router ?
                                             &router : NULL ) ) == 0,
                      file, line );
        }

        /* Save constructed routing table */
        list_splice_init ( &ipv6_miniroutes, &table->list );

        /* Restore original routing table */
        list_splice ( &saved, &ipv6_miniroutes );
}
static void ipv6_route_okx ( struct ipv6_test_table table,
const char *  dest,
const char *  src,
const char *  next,
const char *  file,
unsigned int  line 
) [static]

Report an ipv6_route() test result.

Parameters:
tableTest routing table
destDestination address
srcExpected source address, or NULL to expect failure
nextExpected next hop address, or NULL to expect destination
fileTest code file
lineTest code line

Definition at line 266 of file ipv6_test.c.

References ipv6_miniroute::address, DBG, net_device::index, inet6_aton(), inet6_ntoa(), INIT_LIST_HEAD, ipv6_miniroutes, ipv6_route(), ipv6_test_table::list, list_splice, list_splice_init, memcmp(), memcpy(), NULL, and okx.

                                                                   {
        struct in6_addr in_dest;
        struct in6_addr in_src;
        struct in6_addr in_next;
        struct in6_addr *actual;
        struct ipv6_miniroute *miniroute;
        struct list_head saved;

        /* Switch to test routing table */
        INIT_LIST_HEAD ( &saved );
        list_splice_init ( &ipv6_miniroutes, &saved );
        list_splice_init ( &table->list, &ipv6_miniroutes );

        /* Parse addresses */
        okx ( inet6_aton ( dest, &in_dest ) == 0, file, line );
        if ( src )
                okx ( inet6_aton ( src, &in_src ) == 0, file, line );
        if ( next ) {
                okx ( inet6_aton ( next, &in_next ) == 0, file, line );
        } else {
                memcpy ( &in_next, &in_dest, sizeof ( in_next ) );
        }

        /* Perform routing */
        actual = &in_dest;
        miniroute = ipv6_route ( ipv6_test_netdev.index, &actual );

        /* Validate result */
        if ( src ) {

                /* Check that a route was found */
                okx ( miniroute != NULL, file, line );
                DBG ( "ipv6_route ( %s ) = %s", dest, inet6_ntoa ( actual ) );
                DBG ( " from %s\n", inet6_ntoa ( &miniroute->address ) );

                /* Check that expected source address was used */
                okx ( memcmp ( &miniroute->address, &in_src,
                               sizeof ( in_src ) ) == 0, file, line );

                /* Check that expected next hop address was used */
                okx ( memcmp ( actual, &in_next, sizeof ( *actual ) ) == 0,
                      file, line );

        } else {

                /* Routing is expected to fail */
                okx ( miniroute == NULL, file, line );
        }

        /* Restore original routing table */
        list_splice_init ( &ipv6_miniroutes, &table->list );
        list_splice ( &saved, &ipv6_miniroutes );
}
static void ipv6_table_del ( struct ipv6_test_table table) [static]

Destroy test routing table.

Parameters:
tableTest routing table

Definition at line 329 of file ipv6_test.c.

References INIT_LIST_HEAD, ipv6_del_miniroute(), ipv6_miniroutes, ipv6_test_table::list, list_for_each_entry_safe, list_splice, and list_splice_init.

Referenced by ipv6_test_exec().

                                                             {
        struct ipv6_miniroute *miniroute;
        struct ipv6_miniroute *tmp;
        struct list_head saved;

        /* Switch to test routing table */
        INIT_LIST_HEAD ( &saved );
        list_splice_init ( &ipv6_miniroutes, &saved );
        list_splice_init ( &table->list, &ipv6_miniroutes );

        /* Delete all existing routes */
        list_for_each_entry_safe ( miniroute, tmp, &ipv6_miniroutes, list )
                ipv6_del_miniroute ( miniroute );

        /* Restore original routing table */
        list_splice ( &saved, &ipv6_miniroutes );
}
static void ipv6_test_exec ( void  ) [static]

Perform IPv6 self-tests.

Routing table with a global address

Routing table with multiple addresses and routers

Definition at line 351 of file ipv6_test.c.

References IN6_IS_ADDR_LINKLOCAL, IN6_IS_ADDR_MULTICAST, IN6_IS_ADDR_SITELOCAL, IN6_IS_ADDR_ULA, IN6_IS_ADDR_UNSPECIFIED, inet6_aton_fail_ok, inet6_aton_ok, inet6_ntoa_ok, IPV6, ipv6_route_ok, ipv6_table_del(), ipv6_table_ok, NULL, and ok.

                                    {

        /* Address testing macros */
        ok (   IN6_IS_ADDR_UNSPECIFIED ( &sample_unspecified ) );
        ok ( ! IN6_IS_ADDR_UNSPECIFIED ( &sample_link_local ) );
        ok ( ! IN6_IS_ADDR_UNSPECIFIED ( &sample_site_local ) );
        ok ( ! IN6_IS_ADDR_UNSPECIFIED ( &sample_ula ) );
        ok ( ! IN6_IS_ADDR_UNSPECIFIED ( &sample_global ) );
        ok ( ! IN6_IS_ADDR_UNSPECIFIED ( &sample_multicast ) );
        ok ( ! IN6_IS_ADDR_MULTICAST ( &sample_unspecified ) );
        ok ( ! IN6_IS_ADDR_MULTICAST ( &sample_link_local ) );
        ok ( ! IN6_IS_ADDR_MULTICAST ( &sample_site_local ) );
        ok ( ! IN6_IS_ADDR_MULTICAST ( &sample_ula ) );
        ok ( ! IN6_IS_ADDR_MULTICAST ( &sample_global ) );
        ok (   IN6_IS_ADDR_MULTICAST ( &sample_multicast ) );
        ok ( ! IN6_IS_ADDR_LINKLOCAL ( &sample_unspecified ) );
        ok (   IN6_IS_ADDR_LINKLOCAL ( &sample_link_local ) );
        ok ( ! IN6_IS_ADDR_LINKLOCAL ( &sample_site_local ) );
        ok ( ! IN6_IS_ADDR_LINKLOCAL ( &sample_ula ) );
        ok ( ! IN6_IS_ADDR_LINKLOCAL ( &sample_global ) );
        ok ( ! IN6_IS_ADDR_LINKLOCAL ( &sample_multicast ) );
        ok ( ! IN6_IS_ADDR_SITELOCAL ( &sample_unspecified ) );
        ok ( ! IN6_IS_ADDR_SITELOCAL ( &sample_link_local ) );
        ok (   IN6_IS_ADDR_SITELOCAL ( &sample_site_local ) );
        ok ( ! IN6_IS_ADDR_SITELOCAL ( &sample_ula ) );
        ok ( ! IN6_IS_ADDR_SITELOCAL ( &sample_global ) );
        ok ( ! IN6_IS_ADDR_SITELOCAL ( &sample_multicast ) );
        ok ( ! IN6_IS_ADDR_ULA ( &sample_unspecified ) );
        ok ( ! IN6_IS_ADDR_ULA ( &sample_link_local ) );
        ok ( ! IN6_IS_ADDR_ULA ( &sample_site_local ) );
        ok (   IN6_IS_ADDR_ULA ( &sample_ula ) );
        ok ( ! IN6_IS_ADDR_ULA ( &sample_global ) );
        ok ( ! IN6_IS_ADDR_ULA ( &sample_multicast ) );

        /* inet6_ntoa() tests */
        inet6_ntoa_ok ( IPV6 ( 0x20, 0x01, 0x0b, 0xa8, 0x00, 0x00, 0x01, 0xd4,
                               0x00, 0x00, 0x00, 0x00, 0x69, 0x50, 0x58, 0x45 ),
                        "2001:ba8:0:1d4::6950:5845" );
        /* No zeros */
        inet6_ntoa_ok ( IPV6 ( 0x20, 0x01, 0x0d, 0xb8, 0x00, 0x01, 0x00, 0x01,
                               0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01 ),
                        "2001:db8:1:1:1:1:1:1" );
        /* Run of zeros */
        inet6_ntoa_ok ( IPV6 ( 0x20, 0x01, 0x0d, 0xb8, 0x00, 0x00, 0x00, 0x00,
                               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 ),
                        "2001:db8::1" );
        /* No "::" for single zero */
        inet6_ntoa_ok ( IPV6 ( 0x20, 0x01, 0x0d, 0xb8, 0x00, 0x00, 0x00, 0x01,
                               0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01 ),
                        "2001:db8:0:1:1:1:1:1" );
        /* Use "::" for longest run of zeros */
        inet6_ntoa_ok ( IPV6 ( 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
                               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 ),
                        "2001:0:0:1::1" );
        /* Use "::" for leftmost equal-length run of zeros */
        inet6_ntoa_ok ( IPV6 ( 0x20, 0x01, 0x0d, 0xb8, 0x00, 0x00, 0x00, 0x00,
                               0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 ),
                        "2001:db8::1:0:0:1" );
        /* Trailing run of zeros */
        inet6_ntoa_ok ( IPV6 ( 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ),
                        "fe80::" );
        /* Leading run of zeros */
        inet6_ntoa_ok ( IPV6 ( 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 ),
                        "::1" );
        /* All zeros */
        inet6_ntoa_ok ( IPV6 ( 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ),
                        "::" );
        /* Maximum length */
        inet6_ntoa_ok ( IPV6 ( 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
                               0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ),
                        "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" );

        /* inet6_aton() tests */
        inet6_aton_ok ( "2001:ba8:0:1d4::6950:5845",
                        IPV6 ( 0x20, 0x01, 0x0b, 0xa8, 0x00, 0x00, 0x01, 0xd4,
                               0x00, 0x00, 0x00, 0x00, 0x69, 0x50, 0x58, 0x45));
        /* No zeros */
        inet6_aton_ok ( "2001:db8:1:1:1:1:1:1",
                        IPV6 ( 0x20, 0x01, 0x0d, 0xb8, 0x00, 0x01, 0x00, 0x01,
                               0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01));
        /* All intervening zeros */
        inet6_aton_ok ( "fe80::1",
                        IPV6 ( 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01));
        /* Trailing run of zeros */
        inet6_aton_ok ( "fe80::",
                        IPV6 ( 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00));
        /* Leading run of zeros */
        inet6_aton_ok ( "::1",
                        IPV6 ( 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01));
        /* All zeros */
        inet6_aton_ok ( "::",
                        IPV6 ( 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                               0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00));

        /* inet6_aton() failure tests */
        inet6_aton_fail_ok ( "20012:ba8:0:1d4::6950:5845" );
        inet6_aton_fail_ok ( "200z:ba8:0:1d4::6950:5845" );
        inet6_aton_fail_ok ( "2001.ba8:0:1d4::6950:5845" );
        inet6_aton_fail_ok ( "2001:db8:1:1:1:1:1" );
        inet6_aton_fail_ok ( "2001:db8:1:1:1:1:1:1:2" );
        inet6_aton_fail_ok ( "2001:db8::1::2" );
        inet6_aton_fail_ok ( "2001:ba8:0:1d4:::6950:5845" );
        inet6_aton_fail_ok ( ":::" );

        /* Create test routing tables */
        ipv6_table_ok ( &table_link_local );
        ipv6_table_ok ( &table_normal );
        ipv6_table_ok ( &table_multi );

        /* Routing table with only a link-local address */
        ipv6_route_ok ( &table_link_local, "fe80::1",
                        "fe80::69ff:fe50:5845", NULL );
        ipv6_route_ok ( &table_link_local, "2001:db8:1::1",
                        NULL, NULL );
        ipv6_route_ok ( &table_link_local, "ff02::1",
                        "fe80::69ff:fe50:5845", NULL );

        /** Routing table with a global address */
        ipv6_route_ok ( &table_normal, "fe80::1",
                        "fe80::69ff:fe50:5845", NULL );
        ipv6_route_ok ( &table_normal, "2001:db8:3::42",
                        "2001:db8:3::1", NULL );
        ipv6_route_ok ( &table_normal, "2001:ba8:0:1d4::6950:5845",
                        "2001:db8:3::1", "fe80::1" );
        ipv6_route_ok ( &table_normal, "ff02::1",
                        "fe80::69ff:fe50:5845", NULL );
        ipv6_route_ok ( &table_normal, "ff0e::1",
                        "2001:db8:3::1", NULL );

        /** Routing table with multiple addresses and routers */
        ipv6_route_ok ( &table_multi, "fe80::1",
                        "fe80::69ff:fe50:5845", NULL );
        ipv6_route_ok ( &table_multi, "2001:db8:3::17",
                        "2001:db8:3::1", NULL );
        ipv6_route_ok ( &table_multi, "2001:db8:5::92",
                        "2001:db8:5::1", NULL );
        ipv6_route_ok ( &table_multi, "2001:db8:42::17",
                        "2001:db8:42::1", NULL );
        ipv6_route_ok ( &table_multi, "2001:db8:5:1::17",
                        "2001:db8:3::1", "fe80::1" );
        ipv6_route_ok ( &table_multi, "fd44:9112:6442::1",
                        "fd44:9112:6442::69ff:fe50:5845", NULL );
        ipv6_route_ok ( &table_multi, "fd70:6ba9:50ae::1",
                        "fd70:6ba9:50ae::69ff:fe50:5845", NULL );
        ipv6_route_ok ( &table_multi, "fd40::3",
                        "fd44:9112:6442::69ff:fe50:5845", "fe80::1" );
        ipv6_route_ok ( &table_multi, "fd70::2",
                        "fd70:6ba9:50ae::69ff:fe50:5845", "fe80::3" );
        ipv6_route_ok ( &table_multi, "ff02::1",
                        "fe80::69ff:fe50:5845", NULL );

        /* Destroy test routing tables */
        ipv6_table_del ( &table_link_local );
        ipv6_table_del ( &table_normal );
        ipv6_table_del ( &table_multi );
}

Variable Documentation

struct in6_addr sample_unspecified [static]
Initial value:
 {
        .s6_addr = IPV6 ( 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ),
}

The unspecified IPv6 address.

Definition at line 77 of file ipv6_test.c.

struct in6_addr sample_link_local [static]
Initial value:
 {
        .s6_addr = IPV6 ( 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                          0x00, 0x00, 0x69, 0xff, 0xfe, 0x50, 0x58, 0x45 ),
}

A sample link-local IPv6 address.

Definition at line 83 of file ipv6_test.c.

struct in6_addr sample_site_local [static]
Initial value:
 {
        .s6_addr = IPV6 ( 0xfe, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 ),
}

A sample site-local IPv6 address.

Definition at line 89 of file ipv6_test.c.

struct in6_addr sample_ula [static]
Initial value:
 {
        .s6_addr = IPV6 ( 0xfd, 0x44, 0x91, 0x12, 0x64, 0x42, 0x00, 0x00,
                          0x00, 0x00, 0x69, 0xff, 0xfe, 0x50, 0x58, 0x45 ),
}

A sample ULA IPv6 address.

Definition at line 95 of file ipv6_test.c.

struct in6_addr sample_global [static]
Initial value:
 {
        .s6_addr = IPV6 ( 0x20, 0x01, 0x0b, 0xa8, 0x00, 0x00, 0x01, 0xd4,
                          0x00, 0x00, 0x00, 0x00, 0x69, 0x50, 0x58, 0x45 ),
}

A sample global IPv6 address.

Definition at line 101 of file ipv6_test.c.

struct in6_addr sample_multicast [static]
Initial value:
 {
        .s6_addr = IPV6 ( 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 ),
}

A sample multicast IPv6 address.

Definition at line 107 of file ipv6_test.c.

struct net_device ipv6_test_netdev [static]
Initial value:
 {
        .refcnt = REF_INIT ( ref_no_free ),
        .index = 42,
        .state = NETDEV_OPEN,
}

Dummy network device used for routing tests.

Definition at line 113 of file ipv6_test.c.

struct self_test ipv6_test __self_test
Initial value:
 {
        .name = "ipv6",
        .exec = ipv6_test_exec,
}

IPv6 self-test.

Definition at line 515 of file ipv6_test.c.