iPXE
|
IPv6 protocol. More...
#include <stdint.h>
#include <string.h>
#include <byteswap.h>
#include <ipxe/in.h>
#include <ipxe/list.h>
#include <ipxe/netdevice.h>
Go to the source code of this file.
Data Structures | |
struct | ipv6_header |
IPv6 header. More... | |
struct | ipv6_extension_header_common |
IPv6 extension header common fields. More... | |
struct | ipv6_option |
IPv6 type-length-value options. More... | |
struct | ipv6_options_header |
IPv6 option-based extension header. More... | |
struct | ipv6_routing_header |
IPv6 routing header. More... | |
struct | ipv6_fragment_header |
IPv6 fragment header. More... | |
union | ipv6_extension_header |
IPv6 extension header. More... | |
struct | ipv6_pseudo_header |
IPv6 pseudo-header. More... | |
struct | ipv6_miniroute |
An IPv6 address/routing table entry. More... | |
Macros | |
#define | IPV6_VER 0x60000000UL |
IPv6 version. More... | |
#define | IPV6_MASK_VER 0xf0000000UL |
IPv6 version mask. More... | |
#define | IPV6_HOP_LIMIT 0xff |
IPv6 maximum hop limit. More... | |
#define | IPV6_DEFAULT_PREFIX_LEN 64 |
IPv6 default prefix length. More... | |
#define | IPV6_MAX_PREFIX_LEN 128 |
IPv6 maximum prefix length. More... | |
#define | IPV6_CAN_IGNORE_OPT(type) ( ( (type) & 0xc0 ) == 0x00 ) |
Test if IPv6 option can be safely ignored. More... | |
#define | IPV6_MASK_OFFSET 0xfff8 |
Fragment offset mask. More... | |
#define | IPV6_MASK_MOREFRAGS 0x0001 |
More fragments. More... | |
#define | IPV6_SETTINGS_NAME "link" |
IPv6 link-local address settings block name. More... | |
Enumerations | |
enum | ipv6_option_type { IPV6_OPT_PAD1 = 0x00, IPV6_OPT_PADN = 0x01 } |
IPv6 option types. More... | |
enum | ipv6_header_type { IPV6_HOPBYHOP = 0, IPV6_ROUTING = 43, IPV6_FRAGMENT = 44, IPV6_NO_HEADER = 59, IPV6_DESTINATION = 60 } |
IPv6 header types. More... | |
enum | ipv6_address_scope { IPV6_SCOPE_INTERFACE_LOCAL = 0x1, IPV6_SCOPE_LINK_LOCAL = 0x2, INV6_SCOPE_ADMIN_LOCAL = 0x4, IPV6_SCOPE_SITE_LOCAL = 0x5, IPV6_SCOPE_ORGANISATION_LOCAL = 0x8, IPV6_SCOPE_GLOBAL = 0xe, IPV6_SCOPE_MAX = 0xf } |
IPv6 address scopes. More... | |
enum | ipv6_miniroute_flags { IPV6_HAS_ADDRESS = 0x0001, IPV6_HAS_ROUTER = 0x0002 } |
IPv6 address/routing table entry flags. More... | |
enum | ipv6_settings_order { IPV6_ORDER_PREFIX_ONLY = -4, IPV6_ORDER_LINK_LOCAL = -3, IPV6_ORDER_SLAAC = -2, IPV6_ORDER_DHCPV6 = -1 } |
IPv6 settings sibling order. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static int | ipv6_eui64 (struct in6_addr *addr, struct net_device *netdev) |
Construct local IPv6 address via EUI-64. More... | |
static int | ipv6_link_local (struct in6_addr *addr, struct net_device *netdev) |
Construct link-local address via EUI-64. More... | |
static void | ipv6_solicited_node (struct in6_addr *addr, const struct in6_addr *unicast) |
Construct solicited-node multicast address. More... | |
static void | ipv6_all_routers (struct in6_addr *addr) |
Construct all-routers multicast address. More... | |
static unsigned int | ipv6_multicast_scope (const struct in6_addr *addr) |
Get multicast address scope. More... | |
int | ipv6_has_addr (struct net_device *netdev, struct in6_addr *addr) |
Check if network device has a specific IPv6 address. More... | |
int | ipv6_add_miniroute (struct net_device *netdev, struct in6_addr *address, unsigned int prefix_len, struct in6_addr *router) |
Add IPv6 routing table entry. More... | |
void | ipv6_del_miniroute (struct ipv6_miniroute *miniroute) |
Delete IPv6 minirouting table entry. More... | |
struct ipv6_miniroute * | ipv6_route (unsigned int scope_id, struct in6_addr **dest) |
Perform IPv6 routing. More... | |
int | parse_ipv6_setting (const struct setting_type *type, const char *value, void *buf, size_t len) |
int | format_ipv6_setting (const struct setting_type *type, const void *raw, size_t raw_len, char *buf, size_t len) |
Variables | |
struct list_head | ipv6_miniroutes |
List of IPv6 miniroutes. More... | |
struct net_protocol ipv6_protocol | __net_protocol |
AoE protocol. More... | |
IPv6 protocol.
Definition in file ipv6.h.
#define IPV6_DEFAULT_PREFIX_LEN 64 |
#define IPV6_SETTINGS_NAME "link" |
enum ipv6_option_type |
enum ipv6_header_type |
enum ipv6_address_scope |
IPv6 address scopes.
Definition at line 162 of file ipv6.h.
enum ipv6_miniroute_flags |
enum ipv6_settings_order |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
Construct local IPv6 address via EUI-64.
addr | Prefix to be completed |
netdev | Network device |
prefix_len | Prefix length, or negative error |
Definition at line 216 of file ipv6.h.
References addr, ll_protocol::eui64, net_device::ll_addr, net_device::ll_protocol, netdev, and rc.
Referenced by ipv6_link_local(), and ndp_prefix_fetch_ip6().
|
inlinestatic |
Construct link-local address via EUI-64.
addr | Zeroed address to construct |
netdev | Network device |
prefix_len | Prefix length, or negative error |
Definition at line 235 of file ipv6.h.
References addr, htons, ipv6_eui64(), and netdev.
Referenced by ipv6_fetch().
|
inlinestatic |
|
inlinestatic |
Construct all-routers multicast address.
addr | Zeroed address to construct |
Definition at line 262 of file ipv6.h.
Referenced by ndp_tx_router_solicitation().
|
inlinestatic |
int ipv6_has_addr | ( | struct net_device * | netdev, |
struct in6_addr * | addr | ||
) |
Check if network device has a specific IPv6 address.
netdev | Network device |
addr | IPv6 address |
has_addr | Network device has this IPv6 address |
Definition at line 141 of file ipv6.c.
References addr, ipv6_miniroute::address, ipv6_miniroute::flags, IPV6_HAS_ADDRESS, ipv6_miniroutes, ipv6_miniroute::list, list_for_each_entry, memcmp(), netdev, and ipv6_miniroute::netdev.
Referenced by ipv6_rx(), and ndp_rx_neighbour_solicitation_ll_source().
int ipv6_add_miniroute | ( | struct net_device * | netdev, |
struct in6_addr * | address, | ||
unsigned int | prefix_len, | ||
struct in6_addr * | router | ||
) |
Add IPv6 routing table entry.
netdev | Network device |
address | IPv6 address (or prefix) |
prefix_len | Prefix length |
router | Router address (if any) |
rc | Return status code |
Definition at line 217 of file ipv6.c.
References address, ipv6_miniroute::address, assert(), ENOMEM, ipv6_miniroute::flags, IPV6_DEFAULT_PREFIX_LEN, ipv6_dump_miniroute(), IPV6_HAS_ADDRESS, IPV6_HAS_ROUTER, IPV6_MAX_PREFIX_LEN, ipv6_miniroute(), ipv6_miniroutes, ipv6_scope(), ipv6_miniroute::list, list_add, list_del, memcpy(), netdev, ipv6_miniroute::netdev, netdev_get(), ipv6_miniroute::prefix_len, ipv6_miniroute::prefix_mask, ipv6_miniroute::router, ipv6_miniroute::scope, and zalloc().
Referenced by ipv6_create_routes(), and ipv6_table_okx().
void ipv6_del_miniroute | ( | struct ipv6_miniroute * | miniroute | ) |
Delete IPv6 minirouting table entry.
miniroute | Routing table entry |
Definition at line 292 of file ipv6.c.
References free, ipv6_miniroute::list, list_del, ipv6_miniroute::netdev, and netdev_put().
Referenced by ipv6_create_all_routes(), and ipv6_table_del().
struct ipv6_miniroute* ipv6_route | ( | unsigned int | scope_id, |
struct in6_addr ** | dest | ||
) |
Perform IPv6 routing.
scope_id | Destination address scope ID (for link-local addresses) |
dest | Final destination address |
dest | Next hop destination address |
miniroute | Routing table entry to use, or NULL if no route |
Definition at line 307 of file ipv6.c.
References dest, ipv6_miniroute::flags, IN6_IS_ADDR_MULTICAST, IPV6_HAS_ADDRESS, IPV6_HAS_ROUTER, ipv6_match_len(), ipv6_miniroutes, ipv6_scope(), IPV6_SCOPE_MAX, ipv6_miniroute::list, list_for_each_entry, ipv6_miniroute::netdev, netdev_is_open(), NULL, ipv6_miniroute::prefix_len, ipv6_miniroute::router, scope, ipv6_miniroute::scope, and net_device::scope_id.
Referenced by ipv6_netdev(), ipv6_route_okx(), and ipv6_tx().
int parse_ipv6_setting | ( | const struct setting_type * | type, |
const char * | value, | ||
void * | buf, | ||
size_t | len | ||
) |
int format_ipv6_setting | ( | const struct setting_type * | type, |
const void * | raw, | ||
size_t | raw_len, | ||
char * | buf, | ||
size_t | len | ||
) |
struct list_head ipv6_miniroutes |
List of IPv6 miniroutes.
Definition at line 60 of file ipv6.c.
Referenced by ipv6_add_miniroute(), ipv6_create_all_routes(), ipv6_has_addr(), ipv6_miniroute(), ipv6_route(), ipv6_route_okx(), ipv6_table_del(), ipv6_table_okx(), and route_ipv6_print().
struct net_protocol ipv6_protocol __net_protocol |