# route.h File Reference

`#include <sys/socket.h>`

Include dependency graph for route.h:

## Data Structures
struct | rtentry
## Defines
#define | _ROUTE_H 1
## Typedefs
typedef struct rtentry | rtentry_t
## Enumerations
enum | RouteCmdsEnum { ADDROUTE = 30, DELETEROUTE, READROUTE }
## Functions
int16_t | routecntl (uint16_t cmd, int16_t rtindex, rtentry_t *rtentry)
int16_t | num_rtentries ()
| A system call to get the number of valid route entries in the routing table.

## Define Documentation

#define _ROUTE_H 1

## Typedef Documentation

typedef struct rtentry rtentry_t

## Enumeration Type Documentation

enum RouteCmdsEnum

Commands for routecntl().

Enumerator:

  ADDROUTE |
  DELETEROUTE |
  READROUTE |

## Function Documentation

int16_t num_rtentries | ( |  | ) |

A system call to get the number of valid route entries in the routing table.

Precondition:
  Do not call this inside the interrupt handler context.

Postcondition:
  If successful, return the number of routes.

Returns:
  number of valid route entries in the routing table

int16_t routecntl | ( | uint16_t | cmd,
|  | int16_t | rtindex,
|  | rtentry_t * | rtentry |
| ) |  |  |

A system call to get and configure the routing table. If successful, the routes in the route table can be extracted or changed.

Parameters:

  `[in]` | cmd | See commands RouteCmdsEnum ADDROUTE to add a static route entry DELETEROUTE to delete a static route entry READROUTE read the route entry, indexed by rtindex, into rtentry
  `[in]` | rtindex | index to the route table
  `[in,out]` | rtentry | contains the entry of the routing table to be set to or extracted from the table

Returns:
  0 if succeed and -1 if fail and errno is set appropriately.

Errors:
  EINVAL if invalid parameters are passed

  ESIZE if index is larger than table size