Embedded Xinu Operating System
An ongoing research project and educational operating system.
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
Functions
Routing

IPv4 routing support. More...

Functions

syscall rtAdd (const struct netaddr *dst, const struct netaddr *gate, const struct netaddr *mask, struct netif *nif)
 
struct rtEntry * rtAlloc (void)
 
syscall rtClear (struct netif *nif)
 
thread rtDaemon (void)
 
syscall rtDefault (const struct netaddr *gate, struct netif *nif)
 
syscall rtInit (void)
 
struct rtEntry * rtLookup (const struct netaddr *addr)
 
syscall rtRecv (struct packet *pkt)
 
syscall rtRemove (const struct netaddr *dst)
 
syscall rtSend (struct packet *pkt)
 

Detailed Description

IPv4 routing support.

Function Documentation

struct rtEntry* rtAlloc ( void  )

Allocates an entry from the route table.

Returns
entry in route table, NULL if all used, SYSERR if error occurs
syscall rtClear ( struct netif *  nif)

Removes all entries for a network interface from the routing table.

Parameters
nifnetwork interface
Returns
OK if entries are removed successfully, otherwise SYSERR
thread rtDaemon ( void  )

Route dameon to route packets

syscall rtDefault ( const struct netaddr *  gate,
struct netif *  nif 
)

Set the default route.

Parameters
gategateway for default route
nifnetwork interface for default route
Returns
OK if added/updated successfully, otherwise SYSERR
syscall rtInit ( void  )

Initialize the route table and route daemon.

Returns
OK if initialization is successful, otherwise SYSERR
struct rtEntry* rtLookup ( const struct netaddr *  addr)

Looks up an entry in the routing table

Parameters
addrthe IP address that needs routing
Returns
a route table entry, NULL if none matches, SYSERR on error
syscall rtRemove ( const struct netaddr *  dst)

Removes any entry based on its destination.

Parameters
dstdestination IP address
Returns
OK if the entry is removed successfully, otherwise SYSERR
syscall rtSend ( struct packet *  pkt)

Attempt to route a packet.

Parameters
pktincoming packet to route
Returns
OK if packet is routed successfully, otherwise SYSERR