Contiki 3.x
Macros | Functions | Variables
res_routes.c File Reference

Route resource. More...

#include "er-server.h"
#include "rest-engine.h"
#include <inttypes.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include "net/ip/uip.h"
#include "net/ipv6/uip-ds6.h"
#include "net/rpl/rpl.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define MAX_ENTRY_SIZE   12
 Maximum length of an single nbr / route entry, including terminating null byte.
 

Functions

static uint16_t get_hex_ip (uip_ipaddr_t *ip)
 Get last 2 bytes of an IP as a uint16_t that can be hex printed.
 
static void reset_nbr_route ()
 Reset our internal state so that subsequent calls to get_next_nbr / route return the first ones.
 
static bool get_next_nbr_route ()
 Get the next neighbour if there is one, otherwise the next route. More...
 
static bool get_next_nbr ()
 Get the next neighbour if there is one. More...
 
static bool get_next_route ()
 Get the next route if there is one. More...
 
static void res_get_handler (void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
 Get handler for this resource.
 
 RESOURCE (res_routes,"Routes", res_get_handler, NULL, NULL, NULL)
 Route resource.
 

Variables

static uip_ds6_route_troute
 The next route to use. More...
 
static uip_ds6_nbr_tnbr
 The next neighbour to use. More...
 
static bool hasReachedRoutes
 True if all the neighbors have been sent, and we should start sending routes.
 

Detailed Description

Route resource.

Displays the neighbour and route tables of the node. Arthur Fabre

Definition in file res_routes.c.

Function Documentation

bool get_next_nbr ( )
inlinestatic

Get the next neighbour if there is one.

Returns
true if something was received, false otherwise.

Definition at line 156 of file res_routes.c.

References NULL.

Referenced by get_next_nbr_route().

bool get_next_nbr_route ( )
inlinestatic

Get the next neighbour if there is one, otherwise the next route.

Set hasReachedRoutes accordingly.

Returns
true if something was received, false otherwise.

Definition at line 146 of file res_routes.c.

References get_next_nbr(), get_next_route(), and hasReachedRoutes.

Referenced by res_get_handler().

bool get_next_route ( )
inlinestatic

Get the next route if there is one.

Returns
true if something was received, false otherwise.

Definition at line 167 of file res_routes.c.

References NULL.

Referenced by get_next_nbr_route().

Variable Documentation

uip_ds6_nbr_t* nbr
static

The next neighbour to use.

Can be null.

Definition at line 37 of file res_routes.c.

uip_ds6_route_t* route
static

The next route to use.

Can be null.

Definition at line 31 of file res_routes.c.

Referenced by menu_process(), and tcpip_ipv6_output().