Files | Data Structures | Macros | Typedefs | Functions
RoutingTable

Interface header for Routing Table. More...

+ Collaboration diagram for RoutingTable:

Files

file  BCDS_RoutingTable.h
 

Data Structures

struct  IncomingPortRoutingTable_Entry_S
 "Port Routing" of incoming UDP packets - important to specify which port is bound to incoming Udp source port: More...
 
struct  PortRoutingTable_Entry_S
 "Routing" of incoming TCP/UDP connections - here it's only important to specify which port is listened to on which interface: More...
 
struct  RoutingTable_Entry_S
 Routing table entry for outgoing IP connections. More...
 

Macros

#define ROUTING_TABLE_DEFAULT_PORT   ((Ip_Port_T) 0)
 
#define ROUTING_TABLE_DEFAULT_ROUTE   ((Ip_Address_T) 0)
 

Typedefs

typedef struct
IncomingPortRoutingTable_Entry_S 
IncomingPortRoutingTable_Entry_T
 
typedef struct
PortRoutingTable_Entry_S 
PortRoutingTable_Entry_T
 
typedef struct RoutingTable_Entry_S RoutingTable_Entry_T
 

Functions

void IncomingPortRoutingTable_DeInit (void)
 Deinitializes the incoming port routing table module. More...
 
Retcode_T IncomingPortRoutingTable_Init (const IncomingPortRoutingTable_Entry_T *incomingPortRoutingTable, uint8_t incomingPortRoutingTableLength)
 Initializes the incoming port routing table. More...
 
bool IncomingPortRoutingTable_IsInit (void)
 Checks if module incoming port routing table was initialized. More...
 
void RoutingTable_DeInit (void)
 Deinitializes the routing table module. More...
 
Retcode_T RoutingTable_Init (const RoutingTable_Entry_T *routingTable, uint8_t routingTableLength, const PortRoutingTable_Entry_T *portRoutingTable, uint8_t portRoutingTableLength)
 Initializes the routing table module. More...
 
bool RoutingTable_IsInit (void)
 Checks if module was initialized. More...
 
Retcode_T RoutingTable_Lookup (const Ip_Address_T destIp, const RoutingTable_Entry_T **entry)
 Finds a matching routing table entry. More...
 
Retcode_T RoutingTable_LookupIncomingPort2Port (const Ip_Port_T incomingPort, Ip_Port_T *port)
 Finds a matching port route fo the incoming udp source port. More...
 
Retcode_T RoutingTable_LookupPort2NetIf (const Ip_Port_T listeningPort, NetIF_Id_T *netif)
 Finds the interface on which we have to listen for a particular UDP port. More...
 

Detailed Description

Interface for a routing table to forward IP packets. This module encapsulates the concrete strategy to find routing table entries.


Data Structure Documentation

struct IncomingPortRoutingTable_Entry_S

Data Fields

Ip_Port_T IncomingUdpSrcPort
 
Ip_Port_T UdpPort
 

Field Documentation

Ip_Port_T IncomingUdpSrcPort

incoming Udp src port on which we route.

Ip_Port_T UdpPort

Udp port on which we can listen.

struct PortRoutingTable_Entry_S

Data Fields

NetIF_Id_T Interface
 
Ip_Port_T UdpPort
 

Field Documentation

NetIF_Id_T Interface

interface to listen on

Ip_Port_T UdpPort

incoming Udp port on which we can listen.

struct RoutingTable_Entry_S

Data Fields

Ip_Address_T Gateway
 
NetIF_Id_T Interface
 
Ip_Address_T Netmask
 
Ip_Address_T NetworkDestination
 

Field Documentation

Ip_Address_T Gateway

Gateway (optional), if network is not directly reachable

NetIF_Id_T Interface

interface to forward IP packet to

Ip_Address_T Netmask

Netmask

Ip_Address_T NetworkDestination

Destination network address, or ROUTING_TABLE_DEFAULT_ROUTE

Macro Definition Documentation

#define ROUTING_TABLE_DEFAULT_PORT   ((Ip_Port_T) 0)

port which always matches

#define ROUTING_TABLE_DEFAULT_ROUTE   ((Ip_Address_T) 0)

network address which always matches

Typedef Documentation

Function Documentation

void IncomingPortRoutingTable_DeInit ( void  )
Retcode_T IncomingPortRoutingTable_Init ( const IncomingPortRoutingTable_Entry_T incomingPortRoutingTable,
uint8_t  incomingPortRoutingTableLength 
)
Note
This method will not copy the supplied incoming port routing table.
Parameters
[in]incomingPortRoutingTablepointer to an array of incoming port routing entries, may be NULL.
[in]incomingPortRoutingTableLengthnumber of incoming port routing table entries, may be 0.
Returns
RETCODE_OK if everything went fine
RETCODE_NULL_POINTER if routingTable is NULL
RETCODE_FAILURE routingTable is initialized already
RETCODE_INVALID_PARAM invalid routing table length parameter
bool IncomingPortRoutingTable_IsInit ( void  )
Returns
obvious
void RoutingTable_DeInit ( void  )
Retcode_T RoutingTable_Init ( const RoutingTable_Entry_T routingTable,
uint8_t  routingTableLength,
const PortRoutingTable_Entry_T portRoutingTable,
uint8_t  portRoutingTableLength 
)
Note
This method will not copy the supplied routing table. Instead it will only keep a copy of the pointer to the table to access it - so it is not advisable to generate the table on the stack.
Parameters
[in]routingTablepointer to an array of routing entries
[in]routingTableLengthnumber of routing table entries, required to be 1 or larger
[in]portRoutingTablepointer to an array of port routing entries, may be NULL.
[in]portRoutingTableLengthnumber of port routing table entries, may be 0.
Returns
RETCODE_OK if everything went fine
RETCODE_NULL_POINTER if routingTable is NULL
RETCODE_FAILURE routingTable is initialized already
RETCODE_INVALID_PARAM invalid configuration parameter
bool RoutingTable_IsInit ( void  )
Returns
obvious
Retcode_T RoutingTable_Lookup ( const Ip_Address_T  destIp,
const RoutingTable_Entry_T **  entry 
)
Parameters
[in]destIpdestination IP address
[out]entrymatching routing table entry
Returns
RETCODE_OK matching routing table entry found
RETCODE_FAILURE no matching routing table entry found
RETCODE_NULL_POINTER if destIp or entry is NULL
RETCODE_INVALID_PARAM destIp is invalid
Retcode_T RoutingTable_LookupIncomingPort2Port ( const Ip_Port_T  incomingPort,
Ip_Port_T port 
)
Parameters
[in]incomingPortsource port number of incomming packet
[out]portport
Returns
RETCODE_OK matching routing table entry found
RETCODE_FAILURE no matching routing table entry found
RETCODE_NULL_POINTER if listeningPort or netif is NULL
Retcode_T RoutingTable_LookupPort2NetIf ( const Ip_Port_T  listeningPort,
NetIF_Id_T netif 
)
Parameters
[in]listeningPorttarget port number
[out]netifNetwork interface id
Returns
RETCODE_OK matching routing table entry found
RETCODE_FAILURE no matching routing table entry found
RETCODE_NULL_POINTER if listeningPort or netif is NULL
RETCODE_INVALID_PARAM listeningPort is invalid

This documentation file has been automatically generated on Fri Oct 4 2019 03:47:39 by doxygen 1.8.8