lwIP
2.1.0
Lightweight IP stack
|
#include "lwip/opt.h"
#include "lwip/nd6.h"
#include "lwip/priv/nd6_priv.h"
#include "lwip/prot/nd6.h"
#include "lwip/prot/icmp6.h"
#include "lwip/pbuf.h"
#include "lwip/mem.h"
#include "lwip/memp.h"
#include "lwip/ip6.h"
#include "lwip/ip6_addr.h"
#include "lwip/inet_chksum.h"
#include "lwip/netif.h"
#include "lwip/icmp6.h"
#include "lwip/mld6.h"
#include "lwip/dhcp6.h"
#include "lwip/ip.h"
#include "lwip/stats.h"
#include "lwip/dns.h"
#include <string.h>
#include "path/to/my/lwip_hooks.h"
Functions | |
void | nd6_input (struct pbuf *p, struct netif *inp) |
void | nd6_tmr (void) |
void | nd6_clear_destination_cache (void) |
struct netif * | nd6_find_route (const ip6_addr_t *ip6addr) |
err_t | nd6_get_next_hop_addr_or_queue (struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr, const u8_t **hwaddrp) |
u16_t | nd6_get_destination_mtu (const ip6_addr_t *ip6addr, struct netif *netif) |
void | nd6_reachability_hint (const ip6_addr_t *ip6addr) |
void | nd6_cleanup_netif (struct netif *netif) |
void | nd6_adjust_mld_membership (struct netif *netif, s8_t addr_idx, u8_t new_state) |
void | nd6_restart_netif (struct netif *netif) |
Neighbor discovery and stateless address autoconfiguration for IPv6. Aims to be compliant with RFC 4861 (Neighbor discovery) and RFC 4862 (Address autoconfiguration).
void nd6_adjust_mld_membership | ( | struct netif * | netif, |
s8_t | addr_idx, | ||
u8_t | new_state | ||
) |
The state of a local IPv6 address entry is about to change. If needed, join or leave the solicited-node multicast group for the address.
netif | The netif that owns the address. |
addr_idx | The index of the address. |
new_state | The new (IP6_ADDR_) state for the address. |
void nd6_cleanup_netif | ( | struct netif * | netif | ) |
Remove all prefix, neighbor_cache and router entries of the specified netif.
netif | points to a network interface |
void nd6_clear_destination_cache | ( | void | ) |
Clear the destination cache.
This operation may be necessary for consistency in the light of changing local addresses and/or use of the gateway hook.
struct netif* nd6_find_route | ( | const ip6_addr_t * | ip6addr | ) |
Find a router-announced route to the given destination. This route may be based on an on-link prefix or a default router.
If a suitable route is found, the returned netif is guaranteed to be in a suitable state (up, link up) to be used for packet transmission.
ip6addr | the destination IPv6 address |
u16_t nd6_get_destination_mtu | ( | const ip6_addr_t * | ip6addr, |
struct netif * | netif | ||
) |
Get the Path MTU for a destination.
ip6addr | the destination address |
netif | the netif on which the packet will be sent |
err_t nd6_get_next_hop_addr_or_queue | ( | struct netif * | netif, |
struct pbuf * | q, | ||
const ip6_addr_t * | ip6addr, | ||
const u8_t ** | hwaddrp | ||
) |
A packet is to be transmitted to a specific IPv6 destination on a specific interface. Check if we can find the hardware address of the next hop to use for the packet. If so, give the hardware address to the caller, which should use it to send the packet right away. Otherwise, enqueue the packet for later transmission while looking up the hardware address, if possible.
As such, this function returns one of three different possible results:
netif | The lwIP network interface on which the IP packet will be sent. |
q | The pbuf(s) containing the IP packet to be sent. |
ip6addr | The destination IPv6 address of the packet. |
hwaddrp | On success, filled with a pointer to a HW address or NULL (meaning the packet has been queued). |
Process an incoming neighbor discovery message
p | the nd packet, p->payload pointing to the icmpv6 header |
inp | the netif on which this packet was received |
void nd6_reachability_hint | ( | const ip6_addr_t * | ip6addr | ) |
Provide the Neighbor discovery process with a hint that a destination is reachable. Called by tcp_receive when ACKs are received or sent (as per RFC). This is useful to avoid sending NS messages every 30 seconds.
ip6addr | the destination address which is know to be reachable by an upper layer protocol (TCP) |
void nd6_restart_netif | ( | struct netif * | netif | ) |
Netif was added, set up, or reconnected (link up)
void nd6_tmr | ( | void | ) |
Periodic timer for Neighbor discovery functions: