All Files Functions Variables Enumerator Macros Groups Pages
Functions | Variables
table.c File Reference

Internal route table. More...

#include "rom.h"

Go to the source code of this file.

Functions

int add_route (struct t_id dest)
 Adds an IPv4 address to the internal routing table at the table's end.
 
int delete_route (struct t_id dest)
 delete_route deletes a destination from table by overwriting it with the last table entry and set this last entry to zero afterwards
 
int ipv4_has_valid_route (__be32 dst_addr)
 ipv4_has_valid_route returns 1 if the given destination address is listed in the table, otherwise 0.
 
void dump_route_table (void)
 dump_route_table dumps the table to the kernel log
 

Variables

static struct t_id route_table [ROUTE_TABLE_SIZE+1]
 

Detailed Description

Internal route table.

Authors
Carsten.Vogel | Mohamad.Sbeiti @paser.info

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. For further information see file COPYING in the top level directory

This work is part of the secure wireless mesh networks framework, which is currently under development by CNI

Definition in file table.c.

Function Documentation

int add_route ( struct t_id  dest)

Adds an IPv4 address to the internal routing table at the table's end.

Parameters
destdestination address
Returns
-1 or 0

Definition at line 42 of file table.c.

References route_table, and ROUTE_TABLE_SIZE.

Referenced by rom_rtadd().

int delete_route ( struct t_id  dest)

delete_route deletes a destination from table by overwriting it with the last table entry and set this last entry to zero afterwards

Parameters
destdestination address
Returns
-1 or 0

Definition at line 74 of file table.c.

References route_table, and ROUTE_TABLE_SIZE.

Referenced by rom_rtdel().

int ipv4_has_valid_route ( __be32  dst_addr)

ipv4_has_valid_route returns 1 if the given destination address is listed in the table, otherwise 0.

Parameters
dst_addrdestination address
Returns
1 or 0

Definition at line 108 of file table.c.

References route_table, and ROUTE_TABLE_SIZE.

Referenced by hook_func().

Variable Documentation

struct t_id route_table[ROUTE_TABLE_SIZE+1]
static

route_table is the internal routing table, which holds all IPv4 addresses from destinations which have a verified route. Verified routes are only accepted by the routing logic using librom. Note that we just save the destinations and not the route itself.

Definition at line 33 of file table.c.

Referenced by add_route(), delete_route(), dump_route_table(), and ipv4_has_valid_route().