ipv6_routing.h File Reference

IPv6 routing. More...

#include "core/net.h"
#include "ipv6/ipv6.h"

Go to the source code of this file.

Data Structures

struct  Ipv6RoutingTableEntry
 Routing table entry. More...
 

Macros

#define IPV6_ROUTING_SUPPORT   DISABLED
 
#define IPV6_ROUTING_TABLE_SIZE   8
 

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

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2024 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
2.4.0

Definition in file ipv6_routing.h.

Macro Definition Documentation

◆ IPV6_ROUTING_SUPPORT

#define IPV6_ROUTING_SUPPORT   DISABLED

Definition at line 40 of file ipv6_routing.h.

◆ IPV6_ROUTING_TABLE_SIZE

#define IPV6_ROUTING_TABLE_SIZE   8

Definition at line 47 of file ipv6_routing.h.

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 103 of file ipv6_routing.c.

◆ ipv6DeleteAllRoutes()

error_t ipv6DeleteAllRoutes ( void  )

Delete all routes from the IPv6 routing table.

Returns
Error code

Definition at line 249 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 200 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 75 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 271 of file ipv6_routing.c.

◆ ipv6InitRouting()

error_t ipv6InitRouting ( void  )

Initialize IPv6 routing table.

Returns
Error code

Definition at line 57 of file ipv6_routing.c.