diff options
author | Michael Brown <mcb30@ipxe.org> | 2013-08-26 14:23:54 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2013-09-03 16:30:46 +0100 |
commit | f7f3087cc542d76f19ba6362b0837dcf1baf86b8 (patch) | |
tree | 8d2a920c16a2255f9e9ac57d2b333d8d01edc556 /src/usr | |
parent | 43307b4e39300f6602a975bbb710b443e5fcd2b5 (diff) | |
download | ipxe-f7f3087cc542d76f19ba6362b0837dcf1baf86b8.zip ipxe-f7f3087cc542d76f19ba6362b0837dcf1baf86b8.tar.gz ipxe-f7f3087cc542d76f19ba6362b0837dcf1baf86b8.tar.bz2 |
[ipv6] Replace IPv6 stack
Replace the existing partially-implemented IPv6 stack with a fresh
implementation.
This implementation is not yet complete. The IPv6 transmit and
receive datapaths are functional (including fragment reassembly and
parsing of arbitrary extension headers). NDP neighbour solicitations
and advertisements are supported. ICMPv6 echo is supported.
At present, only link-local addresses may be used, and there is no way
to specify an IPv6 address as part of a URI (either directly or via
a DNS lookup).
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/route_ipv6.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/usr/route_ipv6.c b/src/usr/route_ipv6.c new file mode 100644 index 0000000..8a6fbde --- /dev/null +++ b/src/usr/route_ipv6.c @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2013 Michael Brown <mbrown@fensystems.co.uk>. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +FILE_LICENCE ( GPL2_OR_LATER ); + +#include <stdio.h> +#include <ipxe/netdevice.h> +#include <ipxe/ipv6.h> +#include <usr/route.h> + +/** @file + * + * IPv6 routing management + * + */ + +/** + * Print IPv6 routing table + * + * @v netdev Network device + */ +static void route_ipv6_print ( struct net_device *netdev ) { + struct ipv6_miniroute *miniroute; + + list_for_each_entry ( miniroute, &ipv6_miniroutes, list ) { + if ( miniroute->netdev != netdev ) + continue; + printf ( "%s: %s/%d", netdev->name, + inet6_ntoa ( &miniroute->address ), + miniroute->prefix_len ); + if ( miniroute->has_router ) + printf ( " gw %s", inet6_ntoa ( &miniroute->router ) ); + if ( ! netdev_is_open ( miniroute->netdev ) ) + printf ( " (inaccessible)" ); + printf ( "\n" ); + } +} + +/** IPv6 routing family */ +struct routing_family ipv6_routing_family __routing_family ( ROUTING_IPV6 ) = { + .print = route_ipv6_print, +}; |