ipv6_routing.c File Reference

IPv6 routing. More...

#include <limits.h>
#include "core/net.h"
#include "core/ip.h"
#include "ipv6/ipv6.h"
#include "ipv6/ipv6_misc.h"
#include "ipv6/ipv6_routing.h"
#include "ipv6/icmpv6.h"
#include "ipv6/ndp.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   IPV6_TRACE_LEVEL
 

Functions

error_t ipv6InitRouting (void)
 Initialize IPv6 routing table. More...
 
error_t ipv6EnableRouting (NetInterface *interface, bool_t enable)
 Enable routing for the specified interface. More...
 
error_t ipv6AddRoute (const Ipv6Addr *prefix, uint_t prefixLen, NetInterface *interface, const Ipv6Addr *nextHop, uint_t metric)
 Add a new entry in the IPv6 routing table. More...
 
error_t ipv6DeleteRoute (const Ipv6Addr *prefix, uint_t prefixLen)
 Remove an entry from the IPv6 routing table. More...
 
error_t ipv6DeleteAllRoutes (void)
 Delete all routes from the IPv6 routing table. More...
 
error_t ipv6ForwardPacket (NetInterface *srcInterface, NetBuffer *ipPacket, size_t ipPacketOffset)
 Forward an IPv6 packet. More...
 

Detailed Description

IPv6 routing.

License

Copyright (C) 2010-2018 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.9.0

Definition in file ipv6_routing.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   IPV6_TRACE_LEVEL

Definition at line 30 of file ipv6_routing.c.

Function Documentation

◆ ipv6AddRoute()

error_t ipv6AddRoute ( const Ipv6Addr prefix,
uint_t  prefixLen,
NetInterface interface,
const Ipv6Addr nextHop,
uint_t  metric 
)

Add a new entry in the IPv6 routing table.

Parameters
[in]prefixNetwork destination
[in]prefixLenLength of the prefix, in bits
[in]interfaceNetwork interface where to forward the packet
[in]nextHopIPv6 address of the next hop
[in]metricMetric value
Returns
Error code

Definition at line 101 of file ipv6_routing.c.

◆ ipv6DeleteAllRoutes()

error_t ipv6DeleteAllRoutes ( void  )

Delete all routes from the IPv6 routing table.

Returns
Error code

Definition at line 243 of file ipv6_routing.c.

◆ ipv6DeleteRoute()

error_t ipv6DeleteRoute ( const Ipv6Addr prefix,
uint_t  prefixLen 
)

Remove an entry from the IPv6 routing table.

Parameters
[in]prefixNetwork destination
[in]prefixLenLength of the prefix, in bits
Returns
Error code

Definition at line 194 of file ipv6_routing.c.

◆ ipv6EnableRouting()

error_t ipv6EnableRouting ( NetInterface interface,
bool_t  enable 
)

Enable routing for the specified interface.

Parameters
[in]interfaceUnderlying network interface
[in]enableWhen the flag is set to TRUE, routing is enabled on the interface and the router can forward packets to or from the interface
Returns
Error code

Definition at line 73 of file ipv6_routing.c.

◆ ipv6ForwardPacket()

error_t ipv6ForwardPacket ( NetInterface srcInterface,
NetBuffer ipPacket,
size_t  ipPacketOffset 
)

Forward an IPv6 packet.

Parameters
[in]srcInterfaceNetwork interface on which the packet was received
[in]ipPacketMulti-part buffer that holds the IPv6 packet to forward
[in]ipPacketOffsetOffset to the first byte of the IPv6 packet
Returns
Error code

Definition at line 265 of file ipv6_routing.c.

◆ ipv6InitRouting()

error_t ipv6InitRouting ( void  )

Initialize IPv6 routing table.

Returns
Error code

Definition at line 55 of file ipv6_routing.c.