iPXE
Functions
route_ipv6.c File Reference

IPv6 routing management. More...

#include <stdio.h>
#include <ipxe/netdevice.h>
#include <ipxe/ipv6.h>
#include <usr/route.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
static void route_ipv6_print (struct net_device *netdev)
 Print IPv6 routing table. More...
 
struct routing_family ipv6_routing_family __routing_family (ROUTING_IPV6)
 IPv6 routing family. More...
 

Detailed Description

IPv6 routing management.

Definition in file route_ipv6.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ route_ipv6_print()

static void route_ipv6_print ( struct net_device netdev)
static

Print IPv6 routing table.

Parameters
netdevNetwork device

Definition at line 42 of file route_ipv6.c.

42  {
43  struct ipv6_miniroute *miniroute;
44 
45  list_for_each_entry ( miniroute, &ipv6_miniroutes, list ) {
46  if ( miniroute->netdev != netdev )
47  continue;
48  printf ( "%s: %s/%d", netdev->name,
49  inet6_ntoa ( &miniroute->address ),
50  miniroute->prefix_len );
51  if ( miniroute->flags & IPV6_HAS_ROUTER )
52  printf ( " gw %s", inet6_ntoa ( &miniroute->router ) );
53  if ( ! ( miniroute->flags & IPV6_HAS_ADDRESS ) )
54  printf ( " (no address)" );
55  if ( ! netdev_is_open ( miniroute->netdev ) )
56  printf ( " (inaccessible)" );
57  printf ( "\n" );
58  }
59 }
int printf(const char *fmt,...)
Write a formatted string to the console.
Definition: vsprintf.c:464
char * inet6_ntoa(const struct in6_addr *in)
Convert IPv6 address to standard notation.
Definition: ipv6.c:894
unsigned int flags
Flags.
Definition: ipv6.h:198
An IPv6 address/routing table entry.
Definition: ipv6.h:180
struct in6_addr router
Router address.
Definition: ipv6.h:194
static int netdev_is_open(struct net_device *netdev)
Check whether or not network device is open.
Definition: netdevice.h:652
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
Definition: list.h:420
static struct net_device * netdev
Definition: gdbudp.c:52
struct list_head list
List of miniroutes.
Definition: ipv6.h:182
struct list_head ipv6_miniroutes
List of IPv6 miniroutes.
Definition: ipv6.c:60
struct net_device * netdev
Network device.
Definition: ipv6.h:185
char name[NETDEV_NAME_LEN]
Name of this network device.
Definition: netdevice.h:358
Routing table entry address is valid.
Definition: ipv6.h:204
Routing table entry router address is valid.
Definition: ipv6.h:206
unsigned int prefix_len
Prefix length.
Definition: ipv6.h:190
struct in6_addr address
IPv6 address (or prefix if no address is defined)
Definition: ipv6.h:188

References ipv6_miniroute::address, ipv6_miniroute::flags, inet6_ntoa(), IPV6_HAS_ADDRESS, IPV6_HAS_ROUTER, ipv6_miniroutes, ipv6_miniroute::list, list_for_each_entry, net_device::name, netdev, ipv6_miniroute::netdev, netdev_is_open(), ipv6_miniroute::prefix_len, printf(), and ipv6_miniroute::router.

◆ __routing_family()

struct routing_family ipv6_routing_family __routing_family ( ROUTING_IPV6  )

IPv6 routing family.