|
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. | |
| #define | IPV6_MASK_VER 0xf0000000UL |
| IPv6 version mask. | |
| #define | IPV6_HOP_LIMIT 0xff |
| IPv6 maximum hop limit. | |
| #define | IPV6_DEFAULT_PREFIX_LEN 64 |
| IPv6 default prefix length. | |
| #define | IPV6_MAX_PREFIX_LEN 128 |
| IPv6 maximum prefix length. | |
| #define | IPV6_CAN_IGNORE_OPT(type) |
| Test if IPv6 option can be safely ignored. | |
| #define | IPV6_MASK_OFFSET 0xfff8 |
| Fragment offset mask. | |
| #define | IPV6_MASK_MOREFRAGS 0x0001 |
| More fragments. | |
| #define | IPV6_SETTINGS_NAME "link" |
| IPv6 link-local address settings block name. | |
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) | |
| FILE_SECBOOT (PERMITTED) | |
| static int | ipv6_eui64 (struct in6_addr *addr, struct net_device *netdev) |
| Construct local IPv6 address via EUI-64. | |
| static int | ipv6_link_local (struct in6_addr *addr, struct net_device *netdev) |
| Construct link-local address via EUI-64. | |
| static void | ipv6_solicited_node (struct in6_addr *addr, const struct in6_addr *unicast) |
| Construct solicited-node multicast address. | |
| static void | ipv6_all_routers (struct in6_addr *addr) |
| Construct all-routers multicast address. | |
| static unsigned int | ipv6_multicast_scope (const struct in6_addr *addr) |
| Get multicast address scope. | |
| int | ipv6_has_addr (struct net_device *netdev, struct in6_addr *addr) |
| Check if network device has a specific IPv6 address. | |
| 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. | |
| void | ipv6_del_miniroute (struct ipv6_miniroute *miniroute) |
| Delete IPv6 minirouting table entry. | |
| struct ipv6_miniroute * | ipv6_route (unsigned int scope_id, struct in6_addr **dest) |
| Perform IPv6 routing. | |
| 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. | |
| struct net_protocol ipv6_protocol | __net_protocol |
| AoE protocol. | |
IPv6 protocol.
Definition in file ipv6.h.
| #define IPV6_VER 0x60000000UL |
| #define IPV6_MASK_VER 0xf0000000UL |
| #define IPV6_HOP_LIMIT 0xff |
| #define IPV6_DEFAULT_PREFIX_LEN 64 |
IPv6 default prefix length.
Definition at line 30 of file ipv6.h.
Referenced by ipv6_add_miniroute().
| #define IPV6_MAX_PREFIX_LEN 128 |
IPv6 maximum prefix length.
Definition at line 33 of file ipv6.h.
Referenced by dhcpv6_fetch_len6(), ipv6_add_miniroute(), and ipv6_create_routes().
| #define IPV6_CAN_IGNORE_OPT | ( | type | ) |
| #define IPV6_MASK_OFFSET 0xfff8 |
| #define IPV6_MASK_MOREFRAGS 0x0001 |
| #define IPV6_SETTINGS_NAME "link" |
IPv6 link-local address settings block name.
Definition at line 293 of file ipv6.h.
Referenced by ipv6_register_settings().
| enum ipv6_option_type |
IPv6 option types.
| Enumerator | |
|---|---|
| IPV6_OPT_PAD1 | Pad1. |
| IPV6_OPT_PADN | PadN. |
| enum ipv6_header_type |
IPv6 header types.
Definition at line 135 of file ipv6.h.
| enum ipv6_address_scope |
IPv6 address scopes.
Definition at line 163 of file ipv6.h.
| enum ipv6_miniroute_flags |
IPv6 address/routing table entry flags.
| Enumerator | |
|---|---|
| IPV6_HAS_ADDRESS | Routing table entry address is valid. |
| IPV6_HAS_ROUTER | Routing table entry router address is valid. |
Definition at line 203 of file ipv6.h.
| enum ipv6_settings_order |
IPv6 settings sibling order.
| Enumerator | |
|---|---|
| IPV6_ORDER_PREFIX_ONLY | No address. |
| IPV6_ORDER_LINK_LOCAL | Link-local address. |
| IPV6_ORDER_SLAAC | Address assigned via SLAAC. |
| IPV6_ORDER_DHCPV6 | Address assigned via DHCPv6. |
Definition at line 281 of file ipv6.h.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| FILE_SECBOOT | ( | PERMITTED | ) |
|
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 217 of file ipv6.h.
References addr, ll_protocol::eui64, 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 236 of file ipv6.h.
References addr, htons, ipv6_eui64(), and netdev.
Referenced by ipv6_fetch().
Construct solicited-node multicast address.
| addr | Zeroed address to construct |
| unicast | Unicast address |
Definition at line 249 of file ipv6.h.
References addr, htons, and memcpy().
Referenced by ndp_tx_request().
|
inlinestatic |
|
inlinestatic |
|
extern |
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 142 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(), ipv6_miniroute::netdev, and netdev.
Referenced by ipv6_rx(), and ndp_rx_neighbour_solicitation_ll_source().
|
extern |
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 218 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(), ipv6_miniroute::netdev, 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().
|
extern |
Delete IPv6 minirouting table entry.
| miniroute | Routing table entry |
Definition at line 293 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().
|
extern |
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 308 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, ipv6_miniroute::scope, scope, and net_device::scope_id.
Referenced by ipv6_netdev(), ipv6_route_okx(), and ipv6_tx().
|
extern |
|
extern |
|
extern |
List of IPv6 miniroutes.
Definition at line 61 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().
|
extern |