[insert project logo here (125x200px max)]

Navigator

Mailinglists

Please report any errors or ommissions you find to our `Help' mailinglist, or post a message in the Forums.

Copyright and Licensing Information

Snap is (c) Jonathan T. Moore, 1999-2002 and licensed under the GNU General Public License (GPL).

All other parts of Splash are (c) Willem de Bruijn, 2002-2003 and licensed under the BSD Open Source License.

All sourcecode is made publicly available.

Acknowledgement

Splash and the Splash website are hosted by SourceForge.net

SourceForge.net Logo

osi-open source certified logo

Splash - Documentation

SNMP Plus a Lightweight API for SNAP Handling

Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

snap-1.1-wjdb/lib/router.c File Reference

#include <assert.h>
#include <netinet/in.h>
#include <net/if.h>
#include <string.h>
#include "bytecode.h"
#include "d_printf.h"
#include "memalloc.h"
#include "router.h"
#include "proc.h"

Include dependency graph for router.c:

Include dependency graph

Go to the source code of this file.


Data Structures

struct  rtentry

Defines

#define NIPQUAD(addr)

Functions

int get_iface_index (char *iface_name)
void read_ifaces (char *iface_file)
void read_routes (char *route_file)
int nexthop (addr_t dstaddr, struct rt_lookup *retval)

Variables

rtentryroutes = NULL
int num_rt_entries = 0
int num_routes = 0
char ** ifaces = NULL
int num_if_entries = 0
int num_ifaces = 0

Define Documentation

#define NIPQUAD addr   
 

Value:

((unsigned char *)&(addr))[0], \
        ((unsigned char *)&(addr))[1], \
        ((unsigned char *)&(addr))[2], \
        ((unsigned char *)&(addr))[3]

Definition at line 21 of file router.c.


Function Documentation

int get_iface_index char *    iface_name
 

Definition at line 71 of file router.c.

References ifaces, and num_ifaces.

int nexthop addr_t    dstaddr,
struct rt_lookup   retval
 

Definition at line 260 of file router.c.

References addr_t, rt_lookup::hopaddr, rt_lookup::ifidx, num_routes, print_anti_timer, print_timer, rtentry::rt_dst, rtentry::rt_gateway, rtentry::rt_genmask, and rtentry::rt_ifidx.

void read_ifaces char *    iface_file
 

Definition at line 84 of file router.c.

References d_printf(), ifaces, memalloc, num_if_entries, and num_ifaces.

void read_routes char *    route_file
 

Definition at line 154 of file router.c.

References addr_t, d_printf(), memalloc, num_routes, num_rt_entries, proc_gen_fmt(), rtentry::rt_dst, rtentry::rt_flags, rtentry::rt_gateway, rtentry::rt_genmask, rtentry::rt_ifidx, rtentry::rt_irtt, rtentry::rt_metric, rtentry::rt_mtu, rtentry::rt_window, and sprintf_addr().


Variable Documentation

char** ifaces = NULL
 

Definition at line 66 of file router.c.

Referenced by get_iface_index(), and read_ifaces().

int num_if_entries = 0
 

Definition at line 67 of file router.c.

Referenced by read_ifaces().

int num_ifaces = 0
 

Definition at line 68 of file router.c.

Referenced by get_iface_index(), and read_ifaces().

int num_routes = 0
 

Definition at line 62 of file router.c.

Referenced by nexthop(), and read_routes().

int num_rt_entries = 0
 

Definition at line 61 of file router.c.

Referenced by read_routes().

struct rtentry* routes = NULL
 

Definition at line 60 of file router.c.