IPv4 routing support.
More...
|
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) |
|
IPv4 routing support.
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
-
- Returns
- OK if entries are removed successfully, otherwise SYSERR
Route dameon to route packets
syscall rtDefault |
( |
const struct netaddr * |
gate, |
|
|
struct netif * |
nif |
|
) |
| |
Set the default route.
- Parameters
-
gate | gateway for default route |
nif | network interface for default route |
- Returns
- OK if added/updated successfully, otherwise SYSERR
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
-
addr | the 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
-
dst | destination IP address |
- Returns
- OK if the entry is removed successfully, otherwise SYSERR
syscall rtSend |
( |
struct packet * |
pkt | ) |
|
Attempt to route a packet.
- Parameters
-
pkt | incoming packet to route |
- Returns
- OK if packet is routed successfully, otherwise SYSERR