Sergey Pastor / 1

Dependents:   Nucleo

Embed: (wiki syntax)

« Back to documentation index

ndp.h File Reference

ndp.h File Reference

NDP (Neighbor Discovery Protocol) More...

Go to the source code of this file.

Data Structures

struct  NdpQueueItem
 NDP queue item. More...
struct  NdpNeighborCacheEntry
 Neighbor cache entry. More...
struct  NdpDestCacheEntry
 Destination cache entry. More...
struct  NdpContext
 NDP context. More...

Enumerations

enum  NdpOptionType
 

Neighbor Discovery options.

More...
enum  NdpRouterSelPreference
 

Router selection preferences.

More...
enum  NdpState
 

Neighbor cache entry states.

More...

Functions

error_t ndpInit (NetInterface *interface)
 Neighbor cache initialization.
error_t ndpResolve (NetInterface *interface, const Ipv6Addr *ipAddr, MacAddr *macAddr)
 Address resolution using Neighbor Discovery protocol.
error_t ndpEnqueuePacket (NetInterface *srcInterface, NetInterface *destInterface, const Ipv6Addr *ipAddr, NetBuffer *buffer, size_t offset)
 Enqueue an IPv6 packet waiting for address resolution.
void ndpTick (NetInterface *interface)
 NDP timer handler.
void ndpLinkChangeEvent (NetInterface *interface)
 Callback function for link change event.
void ndpProcessRouterAdv (NetInterface *interface, Ipv6PseudoHeader *pseudoHeader, const NetBuffer *buffer, size_t offset, uint8_t hopLimit)
 Router Advertisement message processing.
void ndpProcessNeighborSol (NetInterface *interface, Ipv6PseudoHeader *pseudoHeader, const NetBuffer *buffer, size_t offset, uint8_t hopLimit)
 Neighbor Solicitation message processing.
void ndpProcessNeighborAdv (NetInterface *interface, Ipv6PseudoHeader *pseudoHeader, const NetBuffer *buffer, size_t offset, uint8_t hopLimit)
 Neighbor Advertisement message processing.
void ndpProcessRedirect (NetInterface *interface, Ipv6PseudoHeader *pseudoHeader, const NetBuffer *buffer, size_t offset, uint8_t hopLimit)
 Redirect message processing.
error_t ndpSendRouterSol (NetInterface *interface)
 Send a Router Solicitation message.
error_t ndpSendNeighborSol (NetInterface *interface, const Ipv6Addr *targetIpAddr, bool_t multicast)
 Send a Neighbor Solicitation message.
error_t ndpSendNeighborAdv (NetInterface *interface, const Ipv6Addr *targetIpAddr, const Ipv6Addr *destIpAddr)
 Send a Neighbor Advertisement message.
error_t ndpSendRedirect (NetInterface *interface, const Ipv6Addr *targetAddr, const NetBuffer *ipPacket, size_t ipPacketOffset)
 Send a Redirect message.
void ndpDumpRouterSolMessage (const NdpRouterSolMessage *message)
 Dump Router Solicitation message for debugging purpose.
void ndpDumpRouterAdvMessage (const NdpRouterAdvMessage *message)
 Dump Router Advertisement message for debugging purpose.
void ndpDumpNeighborSolMessage (const NdpNeighborSolMessage *message)
 Dump Neighbor Solicitation message for debugging purpose.
void ndpDumpNeighborAdvMessage (const NdpNeighborAdvMessage *message)
 Dump Neighbor Advertisement message for debugging purpose.
void ndpDumpRedirectMessage (const NdpRedirectMessage *message)
 Dump Redirect message for debugging purpose.

Detailed Description

NDP (Neighbor Discovery Protocol)

License

Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

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 (at your option) 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.

Author:
Oryx Embedded SARL (www.oryx-embedded.com)
Version:
1.7.6

Definition in file ndp.h.


Enumeration Type Documentation

Neighbor Discovery options.

Definition at line 207 of file ndp.h.

Router selection preferences.

Definition at line 226 of file ndp.h.

enum NdpState

Neighbor cache entry states.

Definition at line 239 of file ndp.h.


Function Documentation

void ndpDumpNeighborAdvMessage ( const NdpNeighborAdvMessage *  message )

Dump Neighbor Advertisement message for debugging purpose.

Parameters:
[in]messageNeighbor Advertisement message

Definition at line 1898 of file ndp.c.

void ndpDumpNeighborSolMessage ( const NdpNeighborSolMessage *  message )

Dump Neighbor Solicitation message for debugging purpose.

Parameters:
[in]messageNeighbor Solicitation message

Definition at line 1883 of file ndp.c.

void ndpDumpRedirectMessage ( const NdpRedirectMessage *  message )

Dump Redirect message for debugging purpose.

Parameters:
[in]messageRedirect message

Definition at line 1916 of file ndp.c.

void ndpDumpRouterAdvMessage ( const NdpRouterAdvMessage *  message )

Dump Router Advertisement message for debugging purpose.

Parameters:
[in]messageRouter Advertisement message

Definition at line 1863 of file ndp.c.

void ndpDumpRouterSolMessage ( const NdpRouterSolMessage *  message )

Dump Router Solicitation message for debugging purpose.

Parameters:
[in]messageRouter Solicitation message

Definition at line 1849 of file ndp.c.

error_t ndpEnqueuePacket ( NetInterface *  srcInterface,
NetInterface *  destInterface,
const Ipv6Addr *  ipAddr,
NetBuffer buffer,
size_t  offset 
)

Enqueue an IPv6 packet waiting for address resolution.

Parameters:
[in]srcInterfaceInterface from which the packet has been received
[in]destInterfaceInterface on which the packet should be sent
[in]ipAddrIPv6 address of the destination host
[in]bufferMulti-part buffer containing the packet to be enqueued
[in]offsetOffset to the first byte of the packet
Returns:
Error code

Definition at line 189 of file ndp.c.

error_t ndpInit ( NetInterface *  interface )

Neighbor cache initialization.

Parameters:
[in]interfaceUnderlying network interface
Returns:
Error code

Definition at line 65 of file ndp.c.

void ndpLinkChangeEvent ( NetInterface *  interface )

Callback function for link change event.

Parameters:
[in]interfaceUnderlying network interface

Definition at line 363 of file ndp.c.

void ndpProcessNeighborAdv ( NetInterface *  interface,
Ipv6PseudoHeader *  pseudoHeader,
const NetBuffer buffer,
size_t  offset,
uint8_t  hopLimit 
)

Neighbor Advertisement message processing.

Parameters:
[in]interfaceUnderlying network interface
[in]pseudoHeaderIPv6 pseudo header
[in]bufferMulti-part buffer containing the Neighbor Advertisement message
[in]offsetOffset to the first byte of the message
[in]hopLimitHop Limit field from IPv6 header

Definition at line 910 of file ndp.c.

void ndpProcessNeighborSol ( NetInterface *  interface,
Ipv6PseudoHeader *  pseudoHeader,
const NetBuffer buffer,
size_t  offset,
uint8_t  hopLimit 
)

Neighbor Solicitation message processing.

Parameters:
[in]interfaceUnderlying network interface
[in]pseudoHeaderIPv6 pseudo header
[in]bufferMulti-part buffer containing the Neighbor Solicitation message
[in]offsetOffset to the first byte of the message
[in]hopLimitHop Limit field from IPv6 header

Definition at line 676 of file ndp.c.

void ndpProcessRedirect ( NetInterface *  interface,
Ipv6PseudoHeader *  pseudoHeader,
const NetBuffer buffer,
size_t  offset,
uint8_t  hopLimit 
)

Redirect message processing.

Parameters:
[in]interfaceUnderlying network interface
[in]pseudoHeaderIPv6 pseudo header
[in]bufferMulti-part buffer containing the Redirect message
[in]offsetOffset to the first byte of the message
[in]hopLimitHop Limit field from IPv6 header

Definition at line 1157 of file ndp.c.

void ndpProcessRouterAdv ( NetInterface *  interface,
Ipv6PseudoHeader *  pseudoHeader,
const NetBuffer buffer,
size_t  offset,
uint8_t  hopLimit 
)

Router Advertisement message processing.

Parameters:
[in]interfaceUnderlying network interface
[in]pseudoHeaderIPv6 pseudo header
[in]bufferMulti-part buffer containing the Router Advertisement message
[in]offsetOffset to the first byte of the message
[in]hopLimitHop Limit field from IPv6 header

Definition at line 400 of file ndp.c.

error_t ndpResolve ( NetInterface *  interface,
const Ipv6Addr *  ipAddr,
MacAddr *  macAddr 
)

Address resolution using Neighbor Discovery protocol.

Parameters:
[in]interfaceUnderlying network interface
[in]ipAddrIPv6 address
[in]macAddrPhysical address matching the specified IPv6 address
Returns:
Error code

Definition at line 97 of file ndp.c.

error_t ndpSendNeighborAdv ( NetInterface *  interface,
const Ipv6Addr *  targetIpAddr,
const Ipv6Addr *  destIpAddr 
)

Send a Neighbor Advertisement message.

Parameters:
[in]interfaceUnderlying network interface
[in]targetIpAddrTarget IPv6 address
[in]destIpAddrDestination IPv6 address
Returns:
Error code

Definition at line 1564 of file ndp.c.

error_t ndpSendNeighborSol ( NetInterface *  interface,
const Ipv6Addr *  targetIpAddr,
bool_t  multicast 
)

Send a Neighbor Solicitation message.

Parameters:
[in]interfaceUnderlying network interface
[in]targetIpAddrTarget IPv6 address
[in]multicastUnicast or unicast Neighbor Solicitation message
Returns:
Error code

Definition at line 1454 of file ndp.c.

error_t ndpSendRedirect ( NetInterface *  interface,
const Ipv6Addr *  targetAddr,
const NetBuffer ipPacket,
size_t  ipPacketOffset 
)

Send a Redirect message.

Parameters:
[in]interfaceUnderlying network interface
[in]targetAddrIPv6 address that is a better first hop to use for the destination address
[in]ipPacketMulti-part buffer that holds the IPv6 packet that triggered the sending of the Redirect
[in]ipPacketOffsetOffset to the first byte of the IPv6 packet
Returns:
Error code

Definition at line 1695 of file ndp.c.

error_t ndpSendRouterSol ( NetInterface *  interface )

Send a Router Solicitation message.

Parameters:
[in]interfaceUnderlying network interface
Returns:
Error code

Definition at line 1357 of file ndp.c.

void ndpTick ( NetInterface *  interface )

NDP timer handler.

Parameters:
[in]interfaceUnderlying network interface

Definition at line 273 of file ndp.c.