mikroSDK Reference Manual
ipv6_routing.h
Go to the documentation of this file.
1
31#ifndef _IPV6_ROUTING_H
32#define _IPV6_ROUTING_H
33
34//Dependencies
35#include "core/net.h"
36#include "ipv6/ipv6.h"
37
38//IPv6 routing support
39#ifndef IPV6_ROUTING_SUPPORT
40 #define IPV6_ROUTING_SUPPORT DISABLED
41#elif (IPV6_ROUTING_SUPPORT != ENABLED && IPV6_ROUTING_SUPPORT != DISABLED)
42 #error IPV6_ROUTING_SUPPORT parameter is not valid
43#endif
44
45//Size of the IPv6 routing table
46#ifndef IPV6_ROUTING_TABLE_SIZE
47 #define IPV6_ROUTING_TABLE_SIZE 8
48#elif (IPV6_ROUTING_TABLE_SIZE < 1)
49 #error IPV6_ROUTING_TABLE_SIZE parameter is not valid
50#endif
51
52//C++ guard
53#ifdef __cplusplus
54extern "C" {
55#endif
56
57
62typedef struct
63{
64 bool_t valid;
65 Ipv6Addr prefix;
66 uint_t prefixLen;
67 NetInterface *interface;
68 Ipv6Addr nextHop;
69 uint_t metric;
71
72
73//IPv6 routing related functions
74error_t ipv6InitRouting(void);
75error_t ipv6EnableRouting(NetInterface *interface, bool_t enable);
76
77error_t ipv6AddRoute(const Ipv6Addr *prefix, uint_t prefixLen,
78 NetInterface *interface, const Ipv6Addr *nextHop, uint_t metric);
79
80error_t ipv6DeleteRoute(const Ipv6Addr *prefix, uint_t prefixLen);
81error_t ipv6DeleteAllRoutes(void);
82
83error_t ipv6ForwardPacket(NetInterface *srcInterface, NetBuffer *ipPacket,
84 size_t ipPacketOffset);
85
86//C++ guard
87#ifdef __cplusplus
88}
89#endif
90
91#endif
error_t
Error codes.
Definition error.h:43
IPv6 (Internet Protocol Version 6)
TCP/IP stack core.
Routing table entry.
Definition ipv6_routing.h:63
uint_t metric
Metric value.
Definition ipv6_routing.h:69
NetInterface * interface
Outgoing network interface.
Definition ipv6_routing.h:67
Ipv6Addr nextHop
Next hop.
Definition ipv6_routing.h:68
Ipv6Addr prefix
Destination.
Definition ipv6_routing.h:65
bool_t valid
Valid entry.
Definition ipv6_routing.h:64
uint_t prefixLen
IPv6 prefix length.
Definition ipv6_routing.h:66
Structure describing a buffer that spans multiple chunks.
Definition net_mem.h:89