Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Uip6

Data Structures

struct  Redirected
 
struct  uip_ds6_aaddr
 Anycast address. More...
 
struct  uip_ds6_addr
 Unicast address structure. More...
 
struct  uip_ds6_element
 Generic type for a DS6, to use a common loop though all DS. More...
 
struct  uip_ds6_maddr
 A multicast address. More...
 
struct  uip_ds6_nbr
 An entry in the nbr cache. More...
 
struct  uip_ds6_netif
 Interface structure (contains all the interface variables) More...
 
struct  uip_ds6_prefix
 A prefix list entry. More...
 
struct  uip_icmp6_echo_reply_notification
 
struct  uip_icmp6_error
 ICMPv6 Error message constant part. More...
 
struct  uip_icmp6_input_handler
 
struct  uip_nd6_na
 A neighbor advertisement constant part. More...
 
struct  uip_nd6_ns
 A neighbor solicitation constant part. More...
 
struct  uip_nd6_opt_hdr
 ND option header. More...
 
struct  uip_nd6_opt_mtu
 ND option MTU. More...
 
struct  uip_nd6_opt_prefix_info
 ND option prefix information. More...
 
struct  uip_nd6_opt_redirected_hdr
 
struct  uip_nd6_ra
 A router advertisement constant part. More...
 
struct  uip_nd6_redirect
 A redirect message constant part. More...
 
struct  uip_nd6_rs
 A router solicitation constant part. More...
 

Files

file  rpl-dag.c
 
    Logic for Directed Acyclic Graphs in RPL.

 
file  rpl-ext-header.c
 
    Management of extension headers for ContikiRPL.

 
file  rpl-icmp6.c
 
    ICMP6 I/O for RPL control messages.

 
file  rpl-mrhof.c
 
    The Minimum Rank with Hysteresis Objective Function (MRHOF)

 
file  rpl-of0.c
 
    An implementation of RPL's objective function 0.

 
file  rpl-timers.c
 
    RPL timer management.

 
file  rpl.c
 
    ContikiRPL, an implementation of RPL: IPv6 Routing Protocol
    for Low-Power and Lossy Networks (IETF RFC 6550)

 
file  uip-ds6-nbr.c
 
    IPv6 Neighbor cache (link-layer/IPv6 address mapping)

 
file  uip-ds6-nbr.h
 
    IPv6 Neighbor cache (link-layer/IPv6 address mapping)

 
file  uip-ds6.c
 
    IPv6 data structures handling functions.

 
file  uip-ds6.h
 
    Network interface and stateless autoconfiguration (RFC 4862)

 
file  uip-icmp6.c
 
    ICMPv6 echo request and error messages (RFC 4443)

 
file  uip-icmp6.h
 
    ICMPv6 echo request and error messages (RFC 4443)

 
file  uip-nd6.c
 
    Neighbor discovery (RFC 4861)

 
file  uip-nd6.h
 
    Neighbor discovery (RFC 4861)

 
file  uip6.c
 
    The uIP TCP/IPv6 stack code.

 

Macros

#define _DEBUG_   DEBUG_NONE
 
#define _DEBUG_   DEBUG_NONE
 
#define _DEBUG_   DEBUG_NONE
 
#define _DEBUG_   DEBUG_NONE
 
#define _DEBUG_   DEBUG_NONE
 
#define _DEBUG_   0
 
#define _DEBUG_   DEBUG_NONE
 
#define _DEBUG_   DEBUG_NONE
 
#define _DEBUG_   DEBUG_NONE
 
#define _DEBUG_   0
 
#define _DEBUG_   0
 
#define _DEBUG_   DEBUG_NONE
 
#define ADDR_ANYTYPE   0
 How the address was acquired: Autoconf, DHCP or manually. More...
 
#define ADDR_AUTOCONF   1
 
#define ADDR_DEPRECATED   2
 
#define ADDR_DHCP   2
 
#define ADDR_MANUAL   3
 
#define ADDR_PREFERRED   1
 
#define ADDR_TENTATIVE   0
 Possible states for the an address (RFC 4862) More...
 
#define DEFAULT_RANK_INCREMENT   RPL_MIN_HOPRANKINC
 
#define ETX_ALPHA   90
 
#define ETX_SCALE   100
 
#define FOUND   0
 
#define FREESPACE   1
 
#define LINK_NEIGHBOR_CALLBACK(addr, status, numtx)
 
#define MAX_LINK_METRIC   10
 
#define MAX_PATH_COST   100
 
#define MIN_DIFFERENCE   (RPL_MIN_HOPRANKINC + RPL_MIN_HOPRANKINC / 2)
 
#define NBR_DELAY   3
 
#define NBR_INCOMPLETE   0
 Possible states for the nbr cache entries. More...
 
#define NBR_PROBE   4
 
#define NBR_REACHABLE   1
 
#define NBR_STALE   2
 
#define NEIGHBOR_STATE_CHANGED(n)
 
#define NOSPACE   2
 
#define PARENT_SWITCH_THRESHOLD_DIV   2
 
#define PRINT6ADDR(addr)
 
#define PRINTF(...)
 
#define RPL_DIO_GROUNDED   0x80
 
#define RPL_DIO_MOP_MASK   0x3c
 
#define RPL_DIO_MOP_SHIFT   3
 
#define RPL_DIO_PREFERENCE_MASK   0x07
 
#define RPL_GROUNDED   0
 
#define UIP_DS6_AADDR_NB   UIP_DS6_AADDR_NBS + UIP_DS6_AADDR_NBU
 
#define UIP_DS6_AADDR_NBS   0
 
#define UIP_DS6_AADDR_NBU   0
 
#define UIP_DS6_ADDR_NB   UIP_DS6_ADDR_NBS + UIP_DS6_ADDR_NBU
 
#define UIP_DS6_ADDR_NBS   1
 
#define UIP_DS6_ADDR_NBU   2
 
#define UIP_DS6_DEFRT_NB   UIP_DS6_DEFRT_NBS + UIP_DS6_DEFRT_NBU
 
#define UIP_DS6_DEFRT_NBS   0
 Configuration. More...
 
#define UIP_DS6_DEFRT_NBU   2
 
#define UIP_DS6_LL_NUD   0
 
#define UIP_DS6_MADDR_NB   UIP_DS6_MADDR_NBS + UIP_DS6_MADDR_NBU
 
#define UIP_DS6_MADDR_NBS   1 + UIP_DS6_ADDR_NB /* all nodes + one solicited per unicast */
 
#define UIP_DS6_MADDR_NBU   0
 
#define UIP_DS6_PERIOD   (CLOCK_SECOND/10) /** Period for uip-ds6 periodic task*/
 General DS6 definitions. More...
 
#define UIP_DS6_PREFIX_NB   UIP_DS6_PREFIX_NBS + UIP_DS6_PREFIX_NBU
 
#define UIP_DS6_PREFIX_NBS   1
 
#define UIP_DS6_PREFIX_NBU   2
 
#define UIP_EXT_BUF   ((struct uip_ext_hdr *)&uip_buf[uip_l2_l3_hdr_len])
 
#define UIP_EXT_BUF   ((struct uip_ext_hdr *)&uip_buf[uip_l2_l3_hdr_len])
 
#define UIP_EXT_HDR_OPT_BUF   ((struct uip_ext_hdr_opt *)&uip_buf[uip_l2_l3_hdr_len + uip_ext_opt_offset])
 
#define UIP_EXT_HDR_OPT_PADN_BUF   ((struct uip_ext_hdr_opt_padn *)&uip_buf[uip_l2_l3_hdr_len + uip_ext_opt_offset])
 
#define UIP_EXT_HDR_OPT_RPL_BUF   ((struct uip_ext_hdr_opt_rpl *)&uip_buf[uip_l2_l3_hdr_len + uip_ext_opt_offset])
 
#define UIP_FIRST_EXT_BUF   ((struct uip_ext_hdr *)&uip_buf[UIP_LLIPH_LEN])
 
#define UIP_HBHO_BUF   ((struct uip_hbho_hdr *)&uip_buf[uip_l2_l3_hdr_len])
 
#define UIP_HBHO_NEXT_BUF   ((struct uip_ext_hdr *)&uip_buf[uip_l2_l3_hdr_len + RPL_HOP_BY_HOP_LEN])
 
#define UIP_ICMP6_ECHO_REQUEST_LEN   4
 Echo Request constant part length. More...
 
#define UIP_ICMP6_ERROR_BUF   ((struct uip_icmp6_error *)&uip_buf[uip_l2_l3_icmp_hdr_len])
 
#define UIP_ICMP6_ERROR_LEN   4
 ICMPv6 Error message constant part length. More...
 
#define UIP_ICMP_BUF   ((struct uip_icmp_hdr *)&uip_buf[uip_l2_l3_hdr_len])
 
#define UIP_ICMP_BUF   ((struct uip_icmp_hdr *)&uip_buf[uip_l2_l3_hdr_len])
 
#define UIP_ICMP_PAYLOAD   ((unsigned char *)&uip_buf[uip_l2_l3_icmp_hdr_len])
 
#define UIP_IP_BUF   ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])
 
#define UIP_IP_BUF   ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])
 
#define UIP_IP_BUF   ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])
 
#define UIP_LOG(m)
 
#define UIP_LOG(m)
 
#define UIP_ND6_DEF_MAXDADNS   UIP_ND6_SEND_NA
 Do not try DAD when using EUI-64 as allowed by draft-ietf-6lowpan-nd-15 section 8.2. More...
 
#define UIP_ND6_OPT_HDR_BUF   ((uip_nd6_opt_hdr *)&uip_buf[uip_l2_l3_icmp_hdr_len + nd6_opt_offset])
 Pointer to ND option. More...
 
#define UIP_ND6_OPT_MTU_BUF   ((uip_nd6_opt_mtu *)&uip_buf[uip_l2_l3_icmp_hdr_len + nd6_opt_offset])
 
#define UIP_ND6_OPT_PREFIX_BUF   ((uip_nd6_opt_prefix_info *)&uip_buf[uip_l2_l3_icmp_hdr_len + nd6_opt_offset])
 

Typedefs

typedef uint16_t rpl_path_metric_t
 
typedef struct uip_ds6_aaddr uip_ds6_aaddr_t
 Anycast address. More...
 
typedef struct uip_ds6_addr uip_ds6_addr_t
 Unicast address structure. More...
 
typedef struct uip_ds6_element uip_ds6_element_t
 Generic type for a DS6, to use a common loop though all DS. More...
 
typedef struct uip_ds6_maddr uip_ds6_maddr_t
 A multicast address. More...
 
typedef struct uip_ds6_nbr uip_ds6_nbr_t
 An entry in the nbr cache. More...
 
typedef struct uip_ds6_netif uip_ds6_netif_t
 Interface structure (contains all the interface variables) More...
 
typedef struct uip_ds6_prefix uip_ds6_prefix_t
 A prefix list entry. More...
 
typedef struct uip_icmp6_error uip_icmp6_error
 ICMPv6 Error message constant part. More...
 

Functions

static int acceptable_rank (rpl_dag_t *dag, rpl_rank_t rank)
 
static rpl_dag_tbest_dag (rpl_dag_t *, rpl_dag_t *)
 
static rpl_parent_tbest_parent (rpl_parent_t *, rpl_parent_t *)
 
static rpl_parent_tbest_parent (rpl_dag_t *dag)
 
static rpl_path_metric_t calculate_path_metric (rpl_parent_t *p)
 
static rpl_rank_t calculate_rank (rpl_parent_t *, rpl_rank_t)
 
static void check_prefix (rpl_prefix_t *last_prefix, rpl_prefix_t *new_prefix)
 
static uint16_t chksum (uint16_t sum, const uint8_t *data, uint16_t len)
 
static void dao_ack_input (void)
 
void dao_ack_output (rpl_instance_t *instance, uip_ipaddr_t *dest, uint8_t sequence)
 
static void dao_input (void)
 
void dao_output (rpl_parent_t *parent, uint8_t lifetime)
 
void dao_output_target (rpl_parent_t *parent, uip_ipaddr_t *prefix, uint8_t lifetime)
 
static void dio_input (void)
 
void dio_output (rpl_instance_t *instance, uip_ipaddr_t *uc_addr)
 
static void dis_input (void)
 
void dis_output (uip_ipaddr_t *addr)
 
static void echo_reply_input (void)
 
static void echo_request_input (void)
 
static uint8_t ext_hdr_options_process (void)
 Process the options in Destination and Hop By Hop extension headers. More...
 
static rpl_parent_tfind_parent_any_dag_any_instance (uip_ipaddr_t *addr)
 
static rpl_dag_tfind_parent_dag (rpl_instance_t *instance, uip_ipaddr_t *addr)
 
static uint16_t get16 (uint8_t *buffer, int pos)
 
static uint32_t get32 (uint8_t *buffer, int pos)
 
static rpl_dag_tget_dag (uint8_t instance_id, uip_ipaddr_t *dag_id)
 
static int get_global_addr (uip_ipaddr_t *addr)
 
uint8_t get_match_length (uip_ipaddr_t *src, uip_ipaddr_t *dst)
 Get the number of matching bits of two addresses. More...
 
static void global_repair (uip_ipaddr_t *from, rpl_dag_t *dag, rpl_dio_t *dio)
 
static void handle_dao_timer (void *ptr)
 
static void handle_dio_timer (void *ptr)
 
static void handle_periodic_timer (void *ptr)
 
static uip_icmp6_input_handler_tinput_handler_lookup (uint8_t type, uint8_t icode)
 
 LIST (echo_reply_callback_list)
 
 LIST (input_handler_list)
 
static int lollipop_greater_than (int a, int b)
 
static void nbr_callback (void *ptr)
 
 NBR_TABLE (rpl_parent_t, rpl_parents)
 
 NBR_TABLE_DECLARE (ds6_neighbors)
 
 NBR_TABLE_GLOBAL (uip_ds6_nbr_t, ds6_neighbors)
 
static void neighbor_link_callback (rpl_parent_t *, int, int)
 
static void new_dio_interval (rpl_instance_t *instance)
 
static void nullify_parents (rpl_dag_t *dag, rpl_rank_t minimum_rank)
 
void remove_ext_hdr (void)
 
static void remove_parents (rpl_dag_t *dag, rpl_rank_t minimum_rank)
 
static void reset (rpl_dag_t *)
 
void rpl_add_dag (uip_ipaddr_t *from, rpl_dio_t *dio)
 
rpl_parent_trpl_add_parent (rpl_dag_t *dag, rpl_dio_t *dio, uip_ipaddr_t *addr)
 
uip_ds6_route_trpl_add_route (rpl_dag_t *dag, uip_ipaddr_t *prefix, int prefix_len, uip_ipaddr_t *next_hop)
 
rpl_dag_trpl_alloc_dag (uint8_t instance_id, uip_ipaddr_t *dag_id)
 
rpl_instance_trpl_alloc_instance (uint8_t instance_id)
 
void rpl_cancel_dao (rpl_instance_t *instance)
 
void rpl_dag_init (void)
 
rpl_of_trpl_find_of (rpl_ocp_t ocp)
 
rpl_parent_trpl_find_parent (rpl_dag_t *dag, uip_ipaddr_t *addr)
 
rpl_parent_trpl_find_parent_any_dag (rpl_instance_t *instance, uip_ipaddr_t *addr)
 
void rpl_free_dag (rpl_dag_t *dag)
 
void rpl_free_instance (rpl_instance_t *instance)
 
rpl_dag_trpl_get_any_dag (void)
 
rpl_instance_trpl_get_instance (uint8_t instance_id)
 
enum rpl_mode rpl_get_mode (void)
 Get the RPL mode. More...
 
uip_ipaddr_trpl_get_parent_ipaddr (rpl_parent_t *p)
 
uint16_t rpl_get_parent_link_metric (const uip_lladdr_t *addr)
 
rpl_rank_t rpl_get_parent_rank (uip_lladdr_t *addr)
 
void rpl_icmp6_register_handlers ()
 
void rpl_init (void)
 
void rpl_insert_header (void)
 
uint8_t rpl_invert_header (void)
 
void rpl_ipv6_neighbor_callback (uip_ds6_nbr_t *nbr)
 
void rpl_join_instance (uip_ipaddr_t *from, rpl_dio_t *dio)
 
void rpl_link_neighbor_callback (const linkaddr_t *addr, int status, int numtx)
 
void rpl_local_repair (rpl_instance_t *instance)
 
void rpl_lock_parent (rpl_parent_t *p)
 
void rpl_move_parent (rpl_dag_t *dag_src, rpl_dag_t *dag_dst, rpl_parent_t *parent)
 
void rpl_nullify_parent (rpl_parent_t *parent)
 
void rpl_process_dio (uip_ipaddr_t *from, rpl_dio_t *dio)
 
int rpl_process_parent_event (rpl_instance_t *instance, rpl_parent_t *p)
 
void rpl_purge_routes (void)
 
void rpl_recalculate_ranks (void)
 
void rpl_remove_header (void)
 
void rpl_remove_parent (rpl_parent_t *parent)
 
void rpl_remove_routes (rpl_dag_t *dag)
 
void rpl_remove_routes_by_nexthop (uip_ipaddr_t *nexthop, rpl_dag_t *dag)
 
int rpl_repair_root (uint8_t instance_id)
 
void rpl_reset_dio_timer (rpl_instance_t *instance)
 
void rpl_reset_periodic_timer (void)
 
void rpl_schedule_dao (rpl_instance_t *instance)
 
void rpl_schedule_dao_immediately (rpl_instance_t *instance)
 
rpl_dag_trpl_select_dag (rpl_instance_t *instance, rpl_parent_t *p)
 
rpl_parent_trpl_select_parent (rpl_dag_t *dag)
 
void rpl_set_default_instance (rpl_instance_t *instance)
 
int rpl_set_default_route (rpl_instance_t *instance, uip_ipaddr_t *from)
 
enum rpl_mode rpl_set_mode (enum rpl_mode m)
 Set the RPL mode. More...
 
static void rpl_set_preferred_parent (rpl_dag_t *dag, rpl_parent_t *p)
 
int rpl_set_prefix (rpl_dag_t *dag, uip_ipaddr_t *prefix, unsigned len)
 
rpl_dag_trpl_set_root (uint8_t instance_id, uip_ipaddr_t *dag_id)
 
void rpl_update_header_empty (void)
 
int rpl_update_header_final (uip_ipaddr_t *addr)
 
int rpl_verify_header (int uip_ext_opt_offset)
 
static void schedule_dao (rpl_instance_t *instance, clock_time_t latency)
 
static void set16 (uint8_t *buffer, int pos, uint16_t value)
 
static void set32 (uint8_t *buffer, int pos, uint32_t value)
 
static void set_dao_lifetime_timer (rpl_instance_t *instance)
 
static void set_ip_from_prefix (uip_ipaddr_t *ipaddr, rpl_prefix_t *prefix)
 
static void set_rpl_opt (unsigned uip_ext_opt_offset)
 
static int should_send_dao (rpl_instance_t *instance, rpl_dio_t *dio, rpl_parent_t *p)
 
void uip_appserver_addr_get (uip_ipaddr_t *ipaddr)
 
uint16_t uip_chksum (uint16_t *data, uint16_t len)
 Calculate the Internet checksum over a buffer. More...
 
uip_ds6_aaddr_tuip_ds6_aaddr_add (uip_ipaddr_t *ipaddr)
 
uip_ds6_aaddr_tuip_ds6_aaddr_lookup (uip_ipaddr_t *ipaddr)
 
void uip_ds6_aaddr_rm (uip_ds6_aaddr_t *aaddr)
 
uip_ds6_addr_tuip_ds6_addr_add (uip_ipaddr_t *ipaddr, unsigned long vlifetime, uint8_t type)
 
uip_ds6_addr_tuip_ds6_addr_lookup (uip_ipaddr_t *ipaddr)
 
void uip_ds6_addr_rm (uip_ds6_addr_t *addr)
 
uint32_t uip_ds6_compute_reachable_time (void)
 Compute the reachable time based on base reachable time, see RFC 4861. More...
 
uip_ds6_addr_tuip_ds6_get_global (int8_t state)
 
uip_ds6_nbr_tuip_ds6_get_least_lifetime_neighbor (void)
 
This searches inside the neighbor table for the neighbor that is about to
expire the next.
More...
 
uip_ds6_addr_tuip_ds6_get_link_local (int8_t state)
 
void uip_ds6_init (void)
 Initialize data structures. More...
 
uint8_t uip_ds6_is_addr_onlink (uip_ipaddr_t *ipaddr)
 
void uip_ds6_link_neighbor_callback (int status, int numtx)
 
uint8_t uip_ds6_list_loop (uip_ds6_element_t *list, uint8_t size, uint16_t elementsize, uip_ipaddr_t *ipaddr, uint8_t ipaddrlen, uip_ds6_element_t **out_element)
 Generic loop routine on an abstract data structure, which generalizes all data structures used in DS6. More...
 
uip_ds6_maddr_tuip_ds6_maddr_add (const uip_ipaddr_t *ipaddr)
 
uip_ds6_maddr_tuip_ds6_maddr_lookup (const uip_ipaddr_t *ipaddr)
 
void uip_ds6_maddr_rm (uip_ds6_maddr_t *maddr)
 
uip_ds6_nbr_tuip_ds6_nbr_add (const uip_ipaddr_t *ipaddr, const uip_lladdr_t *lladdr, uint8_t isrouter, uint8_t state)
 Neighbor Cache basic routines. More...
 
const uip_ipaddr_tuip_ds6_nbr_get_ipaddr (const uip_ds6_nbr_t *nbr)
 
const uip_lladdr_tuip_ds6_nbr_get_ll (const uip_ds6_nbr_t *nbr)
 
uip_ipaddr_tuip_ds6_nbr_ipaddr_from_lladdr (const uip_lladdr_t *lladdr)
 
uip_ds6_nbr_tuip_ds6_nbr_ll_lookup (const uip_lladdr_t *lladdr)
 
const uip_lladdr_tuip_ds6_nbr_lladdr_from_ipaddr (const uip_ipaddr_t *ipaddr)
 
uip_ds6_nbr_tuip_ds6_nbr_lookup (const uip_ipaddr_t *ipaddr)
 
int uip_ds6_nbr_num (void)
 
void uip_ds6_nbr_rm (uip_ds6_nbr_t *nbr)
 
void uip_ds6_neighbor_periodic (void)
 
void uip_ds6_neighbors_init (void)
 
void uip_ds6_periodic (void)
 Periodic processing of data structures. More...
 
uip_ds6_prefix_tuip_ds6_prefix_add (uip_ipaddr_t *ipaddr, uint8_t ipaddrlen, unsigned long interval)
 
uip_ds6_prefix_tuip_ds6_prefix_lookup (uip_ipaddr_t *ipaddr, uint8_t ipaddrlen)
 
void uip_ds6_prefix_rm (uip_ds6_prefix_t *prefix)
 
void uip_ds6_select_src (uip_ipaddr_t *src, uip_ipaddr_t *dst)
 Source address selection, see RFC 3484. More...
 
void uip_ds6_send_rs (void)
 Send periodic RS to find router. More...
 
void uip_ds6_set_addr_iid (uip_ipaddr_t *ipaddr, uip_lladdr_t *lladdr)
 set the last 64 bits of an IP address based on the MAC address More...
 
uint32_t uip_htonl (uint32_t val)
 
uint16_t uip_htons (uint16_t val)
 Convert a 16-bit quantity from host byte order to network byte order. More...
 
 UIP_ICMP6_HANDLER (dis_handler, ICMP6_RPL, RPL_CODE_DIS, dis_input)
 
 UIP_ICMP6_HANDLER (dio_handler, ICMP6_RPL, RPL_CODE_DIO, dio_input)
 
 UIP_ICMP6_HANDLER (dao_handler, ICMP6_RPL, RPL_CODE_DAO, dao_input)
 
 UIP_ICMP6_HANDLER (dao_ack_handler, ICMP6_RPL, RPL_CODE_DAO_ACK, dao_ack_input)
 
 UIP_ICMP6_HANDLER (echo_request_handler, ICMP6_ECHO_REQUEST, UIP_ICMP6_HANDLER_CODE_ANY, echo_request_input)
 
 UIP_ICMP6_HANDLER (echo_reply_handler, ICMP6_ECHO_REPLY, UIP_ICMP6_HANDLER_CODE_ANY, echo_reply_input)
 
uint16_t uip_icmp6chksum (void)
 Calculate the ICMP checksum of the packet in uip_buf. More...
 
void uip_init (void)
 uIP initialization function. More...
 
uint16_t uip_ipchksum (void)
 Calculate the IP header checksum of the packet header in uip_buf. More...
 
void uip_process (uint8_t flag)
 process the options within a hop by hop or destination option header More...
 
void uip_send (const void *data, int len)
 Send data on the current connection. More...
 
static void update_metric_container (rpl_instance_t *)
 
static uint16_t upper_layer_chksum (uint8_t proto)
 

Variables

static uint8_t dao_sequence = RPL_LOLLIPOP_INIT
 
rpl_instance_tdefault_instance
 
static uint8_t dio_send_ok
 
rpl_instance_t instance_table [RPL_MAX_INSTANCES]
 
uip_ipaddr_t uip_ds6_nbr::ipaddr
 
uint8_t uip_ds6_nbr::isrouter
 
static uip_ipaddr_t loc_fipaddr
 
static uip_ds6_aaddr_tlocaaddr
 
static uip_ds6_addr_tlocaddr
 
static uip_ds6_maddr_tlocmaddr
 
static uip_ds6_prefix_tlocprefix
 
static enum rpl_mode mode = RPL_MODE_MESH
 
static uint16_t next_dis
 
uint8_t uip_ds6_nbr::nscount
 
static rpl_of_t *const objective_functions [] = {&RPL_OF}
 
static struct ctimer periodic_timer
 
struct stimer uip_ds6_nbr::reachable
 
rpl_of_t rpl_mrhof
 
rpl_of_t RPL_OF
 
rpl_of_t RPL_OF
 
rpl_of_t rpl_of0
 
static uint8_t rscount
 RS timer, to schedule RS sending. More...
 
struct stimer uip_ds6_nbr::sendns
 
uint8_t uip_ds6_nbr::state
 
static uip_ipaddr_t tmp_ipaddr
 temporary IP address More...
 
uip_ds6_netif_t uip_ds6_if
 
struct etimer uip_ds6_timer_periodic
 
struct etimer uip_ds6_timer_periodic
 
struct etimer uip_ds6_timer_rs
 Timer for maintenance of data structures. More...
 
struct etimer uip_ds6_timer_rs
 Timer for maintenance of data structures. More...
 

"DS6" Data structures

number of rs already sent

uip_ds6_netif_t uip_ds6_if
 
uip_ds6_prefix_t uip_ds6_prefix_list [UIP_DS6_PREFIX_NB]
 The single interface. More...
 
uint8_t uip_ds6_addr_size
 Prefix list. More...
 
uint8_t uip_ds6_netif_addr_list_offset
 

Layer 2 variables

uip_lladdr_t uip_lladdr = {{0x00,0x06,0x98,0x00,0x02,0x32}}
 Host L2 address. More...
 

Layer 3 variables

uint8_t * uip_next_hdr
 Type of the next header in IPv6 header or extension headers. More...
 
uint8_t uip_ext_bitmap = 0
 bitmap we use to record which IPv6 headers we have already seen More...
 
uint8_t uip_ext_len = 0
 length of the extension headers read. More...
 
uint8_t uip_ext_opt_offset = 0
 length of the header options read More...
 

Buffer defines

#define FBUF   ((struct uip_tcpip_hdr *)&uip_reassbuf[0])
 
#define UIP_IP_BUF   ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])
 
#define UIP_ICMP_BUF   ((struct uip_icmp_hdr *)&uip_buf[uip_l2_l3_hdr_len])
 
#define UIP_UDP_BUF   ((struct uip_udp_hdr *)&uip_buf[UIP_LLH_LEN + UIP_IPH_LEN])
 
#define UIP_TCP_BUF   ((struct uip_tcp_hdr *)&uip_buf[UIP_LLH_LEN + UIP_IPH_LEN])
 
#define UIP_EXT_BUF   ((struct uip_ext_hdr *)&uip_buf[uip_l2_l3_hdr_len])
 
#define UIP_ROUTING_BUF   ((struct uip_routing_hdr *)&uip_buf[uip_l2_l3_hdr_len])
 
#define UIP_FRAG_BUF   ((struct uip_frag_hdr *)&uip_buf[uip_l2_l3_hdr_len])
 
#define UIP_HBHO_BUF   ((struct uip_hbho_hdr *)&uip_buf[uip_l2_l3_hdr_len])
 
#define UIP_DESTO_BUF   ((struct uip_desto_hdr *)&uip_buf[uip_l2_l3_hdr_len])
 
#define UIP_EXT_HDR_OPT_BUF   ((struct uip_ext_hdr_opt *)&uip_buf[uip_l2_l3_hdr_len + uip_ext_opt_offset])
 
#define UIP_EXT_HDR_OPT_PADN_BUF   ((struct uip_ext_hdr_opt_padn *)&uip_buf[uip_l2_l3_hdr_len + uip_ext_opt_offset])
 
#define UIP_ICMP6_ERROR_BUF   ((struct uip_icmp6_error *)&uip_buf[uip_l2_l3_icmp_hdr_len])
 

Buffer variables

uip_buf_t uip_aligned_buf
 Packet buffer for incoming and outgoing packets. More...
 
void * uip_appdata
 Pointer to the application data in the packet buffer. More...
 
void * uip_sappdata
 
uint16_t uip_len
 The length of the packet in the uip_buf buffer. More...
 
uint16_t uip_slen
 

General variables

uint8_t uip_flags
 
struct uip_connuip_conn
 Pointer to the current TCP connection. More...
 

TCP defines

#define TCP_FIN   0x01
 
#define TCP_SYN   0x02
 
#define TCP_RST   0x04
 
#define TCP_PSH   0x08
 
#define TCP_ACK   0x10
 
#define TCP_URG   0x20
 
#define TCP_CTL   0x3f
 
#define TCP_OPT_END   0 /* End of TCP options list */
 
#define TCP_OPT_NOOP   1 /* "No-operation" TCP option */
 
#define TCP_OPT_MSS   2 /* Maximum segment size TCP option */
 
#define TCP_OPT_MSS_LEN   4 /* Length of TCP MSS option. */
 

Pointers to the header structures.

All pointers except UIP_IP_BUF depend on uip_ext_len, which at packet reception, is the total length of the extension headers.

The pointer to ND6 options header also depends on nd6_opt_offset, which we set in each function.

Care should be taken when manipulating these buffers about the value of these length variables

#define UIP_IP_BUF   ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])
 Pointer to IP header. More...
 
#define UIP_ICMP_BUF   ((struct uip_icmp_hdr *)&uip_buf[uip_l2_l3_hdr_len])
 Pointer to ICMP header. More...
 
#define UIP_ND6_RS_BUF   ((uip_nd6_rs *)&uip_buf[uip_l2_l3_icmp_hdr_len])
 
#define UIP_ND6_RA_BUF   ((uip_nd6_ra *)&uip_buf[uip_l2_l3_icmp_hdr_len])
 
#define UIP_ND6_NS_BUF   ((uip_nd6_ns *)&uip_buf[uip_l2_l3_icmp_hdr_len])
 
#define UIP_ND6_NA_BUF   ((uip_nd6_na *)&uip_buf[uip_l2_l3_icmp_hdr_len])
 

General

#define UIP_ND6_HOP_LIMIT   255
 HOP LIMIT to be used when sending ND messages (255) More...
 
#define UIP_ND6_INFINITE_LIFETIME   0xFFFFFFFF
 INFINITE lifetime. More...
 

RFC 4861 Host constant

#define UIP_ND6_MAX_RTR_SOLICITATION_DELAY   1
 
#define UIP_ND6_RTR_SOLICITATION_INTERVAL   4
 
#define UIP_ND6_MAX_RTR_SOLICITATIONS   3
 

RFC 4861 Router constants

#define UIP_ND6_SEND_RA   1 /* enable/disable RA sending */
 
#define UIP_ND6_SEND_NA   1 /* enable/disable NA sending */
 
#define UIP_ND6_MAX_RA_INTERVAL   600
 
#define UIP_ND6_MIN_RA_INTERVAL   (UIP_ND6_MAX_RA_INTERVAL / 3)
 
#define UIP_ND6_M_FLAG   0
 
#define UIP_ND6_O_FLAG   0
 
#define UIP_ND6_ROUTER_LIFETIME   3 * UIP_ND6_MAX_RA_INTERVAL
 
#define UIP_ND6_MAX_INITIAL_RA_INTERVAL   16 /*seconds*/
 
#define UIP_ND6_MAX_INITIAL_RAS   3 /*transmissions*/
 
#define UIP_ND6_MIN_DELAY_BETWEEN_RAS   3 /*seconds*/
 
#define UIP_ND6_MAX_RA_DELAY_TIME_MS   500 /*milli seconds*/
 

RFC 4861 Node constant

#define UIP_ND6_MAX_MULTICAST_SOLICIT   3
 
#define UIP_ND6_MAX_UNICAST_SOLICIT   3
 
#define UIP_ND6_REACHABLE_TIME   30000
 
#define UIP_ND6_RETRANS_TIMER   1000
 
#define UIP_ND6_DELAY_FIRST_PROBE_TIME   5
 
#define UIP_ND6_MIN_RANDOM_FACTOR(x)   (x / 2)
 
#define UIP_ND6_MAX_RANDOM_FACTOR(x)   ((x) + (x) / 2)
 

ND6 option types

#define UIP_ND6_OPT_SLLAO   1
 
#define UIP_ND6_OPT_TLLAO   2
 
#define UIP_ND6_OPT_PREFIX_INFO   3
 
#define UIP_ND6_OPT_REDIRECTED_HDR   4
 
#define UIP_ND6_OPT_MTU   5
 
#define UIP_ND6_OPT_TYPE_OFFSET   0
 
#define UIP_ND6_OPT_LEN_OFFSET   1
 
#define UIP_ND6_OPT_DATA_OFFSET   2
 

ND6 message length (excluding options)

#define UIP_ND6_NA_LEN   20
 
#define UIP_ND6_NS_LEN   20
 
#define UIP_ND6_RA_LEN   12
 
#define UIP_ND6_RS_LEN   4
 

ND6 option length in bytes

#define UIP_ND6_OPT_HDR_LEN   2
 
#define UIP_ND6_OPT_PREFIX_INFO_LEN   32
 
#define UIP_ND6_OPT_MTU_LEN   8
 
#define UIP_ND6_OPT_LLAO_LEN   8
 length of a ND6 LLAO option for default L2 type (e.g. More...
 

Neighbor Advertisement flags masks

#define UIP_ND6_NA_FLAG_ROUTER   0x80
 
#define UIP_ND6_NA_FLAG_SOLICITED   0x40
 
#define UIP_ND6_NA_FLAG_OVERRIDE   0x20
 
#define UIP_ND6_RA_FLAG_ONLINK   0x80
 
#define UIP_ND6_RA_FLAG_AUTONOMOUS   0x40
 

ND message structures

typedef struct uip_nd6_ns uip_nd6_ns
 A neighbor solicitation constant part. More...
 
typedef struct uip_nd6_na uip_nd6_na
 A neighbor advertisement constant part. More...
 
typedef struct uip_nd6_rs uip_nd6_rs
 A router solicitation constant part. More...
 
typedef struct uip_nd6_ra uip_nd6_ra
 A router advertisement constant part. More...
 
typedef struct uip_nd6_redirect uip_nd6_redirect
 A redirect message constant part. More...
 

ND Option structures

typedef struct uip_nd6_opt_hdr uip_nd6_opt_hdr
 ND option header. More...
 
typedef struct
uip_nd6_opt_prefix_info 
uip_nd6_opt_prefix_info
 ND option prefix information. More...
 
typedef struct uip_nd6_opt_mtu uip_nd6_opt_mtu
 ND option MTU. More...
 
typedef struct
uip_nd6_opt_redirected_hdr 
uip_nd6_opt_redirected_hdr
 

ND Messages Processing and Generation

void uip_nd6_ns_input (void)
 Process a neighbor solicitation. More...
 
void uip_nd6_ns_output (uip_ipaddr_t *src, uip_ipaddr_t *dest, uip_ipaddr_t *tgt)
 Send a neighbor solicitation, send a Neighbor Advertisement. More...
 
void uip_nd6_rs_output (void)
 Send a Router Solicitation. More...
 
void uip_nd6_init (void)
 Initialise the uIP ND core. More...
 

ICMPv6 message types

#define ICMP6_DST_UNREACH   1
 dest unreachable More...
 
#define ICMP6_PACKET_TOO_BIG   2
 packet too big More...
 
#define ICMP6_TIME_EXCEEDED   3
 time exceeded More...
 
#define ICMP6_PARAM_PROB   4
 ip6 header bad More...
 
#define ICMP6_ECHO_REQUEST   128
 Echo request. More...
 
#define ICMP6_ECHO_REPLY   129
 Echo reply. More...
 
#define ICMP6_RS   133
 Router Solicitation. More...
 
#define ICMP6_RA   134
 Router Advertisement. More...
 
#define ICMP6_NS   135
 Neighbor Solicitation. More...
 
#define ICMP6_NA   136
 Neighbor advertisement. More...
 
#define ICMP6_REDIRECT   137
 Redirect. More...
 
#define ICMP6_RPL   155
 RPL. More...
 
#define ICMP6_PRIV_EXP_100   100
 Private Experimentation. More...
 
#define ICMP6_PRIV_EXP_101   101
 Private Experimentation. More...
 
#define ICMP6_PRIV_EXP_200   200
 Private Experimentation. More...
 
#define ICMP6_PRIV_EXP_201   201
 Private Experimentation. More...
 
#define ICMP6_ROLL_TM   ICMP6_PRIV_EXP_200
 ROLL Trickle Multicast. More...
 

ICMPv6 Destination Unreachable message codes

#define ICMP6_DST_UNREACH_NOROUTE   0
 no route to destination More...
 
#define ICMP6_DST_UNREACH_ADMIN   1
 administratively prohibited More...
 
#define ICMP6_DST_UNREACH_NOTNEIGHBOR   2
 not a neighbor(obsolete) More...
 
#define ICMP6_DST_UNREACH_BEYONDSCOPE   2
 beyond scope of source address More...
 
#define ICMP6_DST_UNREACH_ADDR   3
 address unreachable More...
 
#define ICMP6_DST_UNREACH_NOPORT   4
 port unreachable More...
 

ICMPv6 Time Exceeded message codes

#define ICMP6_TIME_EXCEED_TRANSIT   0
 ttl==0 in transit More...
 
#define ICMP6_TIME_EXCEED_REASSEMBLY   1
 ttl==0 in reass More...
 

ICMPv6 Parameter Problem message codes

#define ICMP6_PARAMPROB_HEADER   0
 erroneous header field More...
 
#define ICMP6_PARAMPROB_NEXTHEADER   1
 unrecognized next header More...
 
#define ICMP6_PARAMPROB_OPTION   2
 unrecognized option More...
 

ICMPv6 RFC4443 Message processing and sending

typedef void(* uip_icmp6_echo_reply_callback_t )(uip_ipaddr_t *source, uint8_t ttl, uint8_t *data, uint16_t datalen)
 
typedef struct
uip_icmp6_input_handler 
uip_icmp6_input_handler_t
 
uint8_t uip_icmp6_input (uint8_t type, uint8_t icode)
 Handle an incoming ICMPv6 message. More...
 
void uip_icmp6_register_input_handler (uip_icmp6_input_handler_t *handler)
 Register a handler which can handle a specific ICMPv6 message type. More...
 
void uip_icmp6_error_output (uint8_t type, uint8_t code, uint32_t param)
 Send an icmpv6 error message. More...
 
void uip_icmp6_send (const uip_ipaddr_t *dest, int type, int code, int payload_len)
 Send an icmpv6 message. More...
 
void uip_icmp6_echo_reply_callback_add (struct uip_icmp6_echo_reply_notification *n, uip_icmp6_echo_reply_callback_t c)
 Add a callback function for ping replies. More...
 
void uip_icmp6_echo_reply_callback_rm (struct uip_icmp6_echo_reply_notification *n)
 Remove a callback function for ping replies. More...
 
void uip_icmp6_init (void)
 Initialise the uIP ICMPv6 core. More...
 
#define UIP_ICMP6_INPUT_SUCCESS   0
 
#define UIP_ICMP6_INPUT_ERROR   1
 
#define UIP_ICMP6_HANDLER_CODE_ANY   0xFF /* Handle all codes for this type */
 
#define UIP_ICMP6_HANDLER(name, type, code, func)   static uip_icmp6_input_handler_t name = { NULL, type, code, func }
 

#define _DEBUG_   DEBUG_NONE
#define _DEBUG_   DEBUG_NONE
#define _DEBUG_   DEBUG_NONE
#define _DEBUG_   DEBUG_NONE
#define _DEBUG_   DEBUG_NONE
#define _DEBUG_   0
#define _DEBUG_   DEBUG_NONE
#define _DEBUG_   DEBUG_NONE
#define _DEBUG_   0
#define _DEBUG_   DEBUG_NONE
#define _DEBUG_   0
#define _DEBUG_   DEBUG_NONE
#define ADDR_ANYTYPE   0

How the address was acquired: Autoconf, DHCP or manually.

#define ADDR_AUTOCONF   1
#define ADDR_DEPRECATED   2
#define ADDR_DHCP   2
#define ADDR_MANUAL   3
#define ADDR_TENTATIVE   0

Possible states for the an address (RFC 4862)

Referenced by get_global_addr(), ip64_init(), main(), na_input(), ns_input(), set_global_address(), uip_ds6_addr_add(), and uip_ds6_periodic().

#define DEFAULT_RANK_INCREMENT   RPL_MIN_HOPRANKINC

Referenced by calculate_rank().

#define ETX_ALPHA   90

Referenced by neighbor_link_callback().

#define ETX_SCALE   100

Referenced by neighbor_link_callback().

#define FBUF   ((struct uip_tcpip_hdr *)&uip_reassbuf[0])
#define ICMP6_DST_UNREACH   1

dest unreachable

Referenced by uip_process().

#define ICMP6_DST_UNREACH_ADDR   3

address unreachable

#define ICMP6_DST_UNREACH_ADMIN   1

administratively prohibited

#define ICMP6_DST_UNREACH_BEYONDSCOPE   2

beyond scope of source address

#define ICMP6_DST_UNREACH_NOPORT   4

port unreachable

Referenced by uip_process().

#define ICMP6_DST_UNREACH_NOROUTE   0

no route to destination

#define ICMP6_DST_UNREACH_NOTNEIGHBOR   2

not a neighbor(obsolete)

Referenced by uip_process().

#define ICMP6_ECHO_REPLY   129

Echo reply.

Referenced by echo_request_input().

#define ICMP6_ECHO_REQUEST   128

Echo request.

Referenced by PROCESS_THREAD().

#define ICMP6_NA   136

Neighbor advertisement.

Referenced by ns_input().

#define ICMP6_NS   135

Neighbor Solicitation.

Referenced by uip_nd6_ns_output().

#define ICMP6_PACKET_TOO_BIG   2

packet too big

Referenced by uip_process().

#define ICMP6_PARAM_PROB   4
#define ICMP6_PARAMPROB_HEADER   0

erroneous header field

Referenced by uip_process().

#define ICMP6_PARAMPROB_NEXTHEADER   1

unrecognized next header

Referenced by uip_process().

#define ICMP6_PARAMPROB_OPTION   2

unrecognized option

Referenced by ext_hdr_options_process(), and uip_icmp6_error_output().

#define ICMP6_PRIV_EXP_100   100

Private Experimentation.

#define ICMP6_PRIV_EXP_101   101

Private Experimentation.

#define ICMP6_PRIV_EXP_200   200

Private Experimentation.

#define ICMP6_PRIV_EXP_201   201

Private Experimentation.

#define ICMP6_RA   134

Router Advertisement.

#define ICMP6_REDIRECT   137

Redirect.

#define ICMP6_ROLL_TM   ICMP6_PRIV_EXP_200

ROLL Trickle Multicast.

#define ICMP6_RPL   155
#define ICMP6_RS   133

Router Solicitation.

Referenced by uip_nd6_rs_output().

#define ICMP6_TIME_EXCEED_REASSEMBLY   1

ttl==0 in reass

#define ICMP6_TIME_EXCEED_TRANSIT   0

ttl==0 in transit

Referenced by uip_process().

#define ICMP6_TIME_EXCEEDED   3

time exceeded

Referenced by uip_process().

#define LINK_NEIGHBOR_CALLBACK (   addr,
  status,
  numtx 
)
#define MAX_LINK_METRIC   10

Referenced by neighbor_link_callback().

#define MAX_PATH_COST   100

Referenced by calculate_path_metric().

#define MIN_DIFFERENCE   (RPL_MIN_HOPRANKINC + RPL_MIN_HOPRANKINC / 2)

Referenced by best_parent().

#define NBR_INCOMPLETE   0

Possible states for the nbr cache entries.

Referenced by na_input(), ns_input(), ra_input(), tcpip_ipv6_output(), uip_ds6_defrt_choose(), and uip_ds6_neighbor_periodic().

#define NBR_PROBE   4
#define NEIGHBOR_STATE_CHANGED (   n)

Referenced by uip_ds6_nbr_add(), and uip_ds6_nbr_rm().

#define NOSPACE   2

Referenced by uip_ds6_list_loop().

#define PARENT_SWITCH_THRESHOLD_DIV   2

Referenced by best_parent().

#define PRINT6ADDR (   addr)
#define PRINTF (   ...)
#define RPL_DIO_GROUNDED   0x80

Referenced by dio_input(), and dio_output().

#define RPL_DIO_MOP_MASK   0x3c

Referenced by dio_input().

#define RPL_DIO_MOP_SHIFT   3

Referenced by dio_input(), and dio_output().

#define RPL_DIO_PREFERENCE_MASK   0x07

Referenced by dio_input(), and dio_output().

#define RPL_GROUNDED   0

Referenced by rpl_set_root().

#define TCP_ACK   0x10

Referenced by uip_process().

#define TCP_CTL   0x3f

Referenced by uip_process().

#define TCP_FIN   0x01

Referenced by uip_process().

#define TCP_OPT_END   0 /* End of TCP options list */

Referenced by uip_process().

#define TCP_OPT_MSS   2 /* Maximum segment size TCP option */

Referenced by uip_process().

#define TCP_OPT_MSS_LEN   4 /* Length of TCP MSS option. */

Referenced by uip_process().

#define TCP_OPT_NOOP   1 /* "No-operation" TCP option */

Referenced by uip_process().

#define TCP_PSH   0x08

Referenced by uip_process().

#define TCP_RST   0x04

Referenced by uip_process().

#define TCP_SYN   0x02

Referenced by check_for_tcp_syn(), and uip_process().

#define TCP_URG   0x20

Referenced by uip_process().

#define UIP_DESTO_BUF   ((struct uip_desto_hdr *)&uip_buf[uip_l2_l3_hdr_len])
#define UIP_DS6_AADDR_NBS   0
#define UIP_DS6_AADDR_NBU   0
#define UIP_DS6_ADDR_NBS   1
#define UIP_DS6_ADDR_NBU   2
#define UIP_DS6_DEFRT_NB   UIP_DS6_DEFRT_NBS + UIP_DS6_DEFRT_NBU

Referenced by uip_ds6_init().

#define UIP_DS6_DEFRT_NBS   0

Configuration.

For all tables (Neighbor cache, Prefix List, Routing Table, Default Router List, Unicast address list, multicast address list, anycast address list), we define:

  • the number of elements requested by the user in contiki configuration (name suffixed by _NBU)
  • the number of elements assigned by the system (name suffixed by _NBS)
  • the total number of elements is the sum (name suffixed by _NB)
#define UIP_DS6_DEFRT_NBU   2
#define UIP_DS6_LL_NUD   0
#define UIP_DS6_MADDR_NBS   1 + UIP_DS6_ADDR_NB /* all nodes + one solicited per unicast */
#define UIP_DS6_MADDR_NBU   0
#define UIP_DS6_PERIOD   (CLOCK_SECOND/10) /** Period for uip-ds6 periodic task*/

General DS6 definitions.

Referenced by uip_ds6_init().

#define UIP_DS6_PREFIX_NBS   1
#define UIP_DS6_PREFIX_NBU   2
#define UIP_EXT_BUF   ((struct uip_ext_hdr *)&uip_buf[uip_l2_l3_hdr_len])

Referenced by rpl_remove_header(), and set_rpl_opt().

#define UIP_EXT_BUF   ((struct uip_ext_hdr *)&uip_buf[uip_l2_l3_hdr_len])

Referenced by uip_icmp6_error_output().

#define UIP_EXT_BUF   ((struct uip_ext_hdr *)&uip_buf[uip_l2_l3_hdr_len])
#define UIP_EXT_HDR_OPT_BUF   ((struct uip_ext_hdr_opt *)&uip_buf[uip_l2_l3_hdr_len + uip_ext_opt_offset])

Referenced by ext_hdr_options_process().

#define UIP_EXT_HDR_OPT_PADN_BUF   ((struct uip_ext_hdr_opt_padn *)&uip_buf[uip_l2_l3_hdr_len + uip_ext_opt_offset])
#define UIP_EXT_HDR_OPT_PADN_BUF   ((struct uip_ext_hdr_opt_padn *)&uip_buf[uip_l2_l3_hdr_len + uip_ext_opt_offset])

Referenced by ext_hdr_options_process().

#define UIP_FIRST_EXT_BUF   ((struct uip_ext_hdr *)&uip_buf[UIP_LLIPH_LEN])
#define UIP_FRAG_BUF   ((struct uip_frag_hdr *)&uip_buf[uip_l2_l3_hdr_len])
#define UIP_HBHO_BUF   ((struct uip_hbho_hdr *)&uip_buf[uip_l2_l3_hdr_len])
#define UIP_HBHO_NEXT_BUF   ((struct uip_ext_hdr *)&uip_buf[uip_l2_l3_hdr_len + RPL_HOP_BY_HOP_LEN])

Referenced by rpl_remove_header(), and set_rpl_opt().

#define UIP_ICMP6_ECHO_REQUEST_LEN   4

Echo Request constant part length.

#define UIP_ICMP6_ERROR_BUF   ((struct uip_icmp6_error *)&uip_buf[uip_l2_l3_icmp_hdr_len])

Referenced by uip_icmp6_error_output().

#define UIP_ICMP6_ERROR_BUF   ((struct uip_icmp6_error *)&uip_buf[uip_l2_l3_icmp_hdr_len])
#define UIP_ICMP6_ERROR_LEN   4

ICMPv6 Error message constant part length.

Referenced by uip_icmp6_error_output().

#define UIP_ICMP6_HANDLER (   name,
  type,
  code,
  func 
)    static uip_icmp6_input_handler_t name = { NULL, type, code, func }
#define UIP_ICMP6_HANDLER_CODE_ANY   0xFF /* Handle all codes for this type */

Referenced by input_handler_lookup().

#define UIP_ICMP6_INPUT_ERROR   1

Referenced by uip_icmp6_input(), and uip_process().

#define UIP_ICMP6_INPUT_SUCCESS   0

Referenced by uip_icmp6_input().

#define UIP_ICMP_BUF   ((struct uip_icmp_hdr *)&uip_buf[uip_l2_l3_hdr_len])
#define UIP_ICMP_BUF   ((struct uip_icmp_hdr *)&uip_buf[uip_l2_l3_hdr_len])

Pointer to ICMP header.

Referenced by na_input(), ns_input(), ra_input(), uip_nd6_ns_output(), and uip_nd6_rs_output().

#define UIP_ICMP_BUF   ((struct uip_icmp_hdr *)&uip_buf[uip_l2_l3_hdr_len])

Referenced by uip_process().

#define UIP_ICMP_PAYLOAD   ((unsigned char *)&uip_buf[uip_l2_l3_icmp_hdr_len])
#define UIP_IP_BUF   ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])
#define UIP_IP_BUF   ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])

Pointer to IP header.

Referenced by na_input(), ns_input(), ra_input(), uip_nd6_ns_output(), and uip_nd6_rs_output().

#define UIP_IP_BUF   ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])
#define UIP_LOG (   m)
#define UIP_LOG (   m)

Referenced by uip_process().

#define UIP_ND6_DEF_MAXDADNS   UIP_ND6_SEND_NA

Do not try DAD when using EUI-64 as allowed by draft-ietf-6lowpan-nd-15 section 8.2.

Referenced by uip_ds6_init().

#define UIP_ND6_DELAY_FIRST_PROBE_TIME   5

Referenced by tcpip_ipv6_output().

#define UIP_ND6_HOP_LIMIT   255

HOP LIMIT to be used when sending ND messages (255)

Referenced by na_input(), ns_input(), ra_input(), uip_nd6_ns_output(), and uip_nd6_rs_output().

#define UIP_ND6_INFINITE_LIFETIME   0xFFFFFFFF

INFINITE lifetime.

Referenced by ra_input().

#define UIP_ND6_M_FLAG   0
#define UIP_ND6_MAX_INITIAL_RA_INTERVAL   16 /*seconds*/
#define UIP_ND6_MAX_INITIAL_RAS   3 /*transmissions*/
#define UIP_ND6_MAX_MULTICAST_SOLICIT   3
#define UIP_ND6_MAX_RA_DELAY_TIME_MS   500 /*milli seconds*/
#define UIP_ND6_MAX_RA_INTERVAL   600
#define UIP_ND6_MAX_RANDOM_FACTOR (   x)    ((x) + (x) / 2)
#define UIP_ND6_MAX_RTR_SOLICITATION_DELAY   1

Referenced by uip_ds6_addr_add(), and uip_ds6_init().

#define UIP_ND6_MAX_RTR_SOLICITATIONS   3

Referenced by uip_ds6_send_rs().

#define UIP_ND6_MAX_UNICAST_SOLICIT   3
#define UIP_ND6_MIN_DELAY_BETWEEN_RAS   3 /*seconds*/
#define UIP_ND6_MIN_RA_INTERVAL   (UIP_ND6_MAX_RA_INTERVAL / 3)
#define UIP_ND6_MIN_RANDOM_FACTOR (   x)    (x / 2)
#define UIP_ND6_NA_BUF   ((uip_nd6_na *)&uip_buf[uip_l2_l3_icmp_hdr_len])

Referenced by na_input(), and ns_input().

#define UIP_ND6_NA_FLAG_OVERRIDE   0x20

Referenced by na_input(), and ns_input().

#define UIP_ND6_NA_FLAG_ROUTER   0x80

Referenced by na_input(), and ns_input().

#define UIP_ND6_NA_FLAG_SOLICITED   0x40

Referenced by na_input(), and ns_input().

#define UIP_ND6_NA_LEN   20

Referenced by na_input(), and ns_input().

#define UIP_ND6_NS_BUF   ((uip_nd6_ns *)&uip_buf[uip_l2_l3_icmp_hdr_len])

Referenced by ns_input(), and uip_nd6_ns_output().

#define UIP_ND6_NS_LEN   20

Referenced by ns_input(), and uip_nd6_ns_output().

#define UIP_ND6_O_FLAG   0
#define UIP_ND6_OPT_DATA_OFFSET   2
#define UIP_ND6_OPT_HDR_BUF   ((uip_nd6_opt_hdr *)&uip_buf[uip_l2_l3_icmp_hdr_len + nd6_opt_offset])

Pointer to ND option.

Referenced by na_input(), ns_input(), and ra_input().

#define UIP_ND6_OPT_HDR_LEN   2
#define UIP_ND6_OPT_LEN_OFFSET   1

Referenced by create_llao().

#define UIP_ND6_OPT_LLAO_LEN   8

length of a ND6 LLAO option for default L2 type (e.g.

Ethernet)

Referenced by create_llao(), ns_input(), uip_nd6_ns_output(), and uip_nd6_rs_output().

#define UIP_ND6_OPT_MTU   5

Referenced by ra_input().

#define UIP_ND6_OPT_MTU_BUF   ((uip_nd6_opt_mtu *)&uip_buf[uip_l2_l3_icmp_hdr_len + nd6_opt_offset])
#define UIP_ND6_OPT_MTU_LEN   8
#define UIP_ND6_OPT_PREFIX_BUF   ((uip_nd6_opt_prefix_info *)&uip_buf[uip_l2_l3_icmp_hdr_len + nd6_opt_offset])
#define UIP_ND6_OPT_PREFIX_INFO   3

Referenced by ra_input().

#define UIP_ND6_OPT_PREFIX_INFO_LEN   32
#define UIP_ND6_OPT_REDIRECTED_HDR   4
#define UIP_ND6_OPT_SLLAO   1
#define UIP_ND6_OPT_TLLAO   2

Referenced by na_input(), and ns_input().

#define UIP_ND6_OPT_TYPE_OFFSET   0

Referenced by create_llao().

#define UIP_ND6_RA_BUF   ((uip_nd6_ra *)&uip_buf[uip_l2_l3_icmp_hdr_len])

Referenced by ra_input().

#define UIP_ND6_RA_FLAG_AUTONOMOUS   0x40
#define UIP_ND6_RA_FLAG_ONLINK   0x80

Referenced by ra_input().

#define UIP_ND6_RA_LEN   12

Referenced by ra_input().

#define UIP_ND6_REACHABLE_TIME   30000
#define UIP_ND6_RETRANS_TIMER   1000

Referenced by uip_ds6_init().

#define UIP_ND6_ROUTER_LIFETIME   3 * UIP_ND6_MAX_RA_INTERVAL
#define UIP_ND6_RS_BUF   ((uip_nd6_rs *)&uip_buf[uip_l2_l3_icmp_hdr_len])

Pointers to messages just after icmp header

#define UIP_ND6_RS_LEN   4

Referenced by uip_nd6_rs_output().

#define UIP_ND6_RTR_SOLICITATION_INTERVAL   4

Referenced by uip_ds6_send_rs().

#define UIP_ND6_SEND_NA   1 /* enable/disable NA sending */
#define UIP_ND6_SEND_RA   1 /* enable/disable RA sending */
#define UIP_ROUTING_BUF   ((struct uip_routing_hdr *)&uip_buf[uip_l2_l3_hdr_len])

Referenced by uip_process().

#define UIP_TCP_BUF   ((struct uip_tcp_hdr *)&uip_buf[UIP_LLH_LEN + UIP_IPH_LEN])

Referenced by remove_ext_hdr(), and uip_process().

#define UIP_UDP_BUF   ((struct uip_udp_hdr *)&uip_buf[UIP_LLH_LEN + UIP_IPH_LEN])

Referenced by uip_process().

typedef uint16_t rpl_path_metric_t

Anycast address.

typedef struct uip_ds6_addr uip_ds6_addr_t

Unicast address structure.

Generic type for a DS6, to use a common loop though all DS.

A multicast address.

typedef struct uip_ds6_nbr uip_ds6_nbr_t

An entry in the nbr cache.

Interface structure (contains all the interface variables)

A prefix list entry.

typedef void(* uip_icmp6_echo_reply_callback_t)(uip_ipaddr_t *source, uint8_t ttl, uint8_t *data, uint16_t datalen)

ICMPv6 Error message constant part.

typedef struct uip_nd6_na uip_nd6_na

A neighbor advertisement constant part.

Possible option is: TLLAO

typedef struct uip_nd6_ns uip_nd6_ns

A neighbor solicitation constant part.

Possible option is: SLLAO

ND option header.

ND option MTU.

ND option prefix information.

typedef struct uip_nd6_ra uip_nd6_ra

A router advertisement constant part.

Possible options are: SLLAO, MTU, Prefix Information

A redirect message constant part.

Possible options are: TLLAO, redirected header

typedef struct uip_nd6_rs uip_nd6_rs

A router solicitation constant part.

Possible option is: SLLAO

static int acceptable_rank ( rpl_dag_t dag,
rpl_rank_t  rank 
)
static
static rpl_dag_t * best_dag ( rpl_dag_t d1,
rpl_dag_t d2 
)
static
static uint16_t chksum ( uint16_t  sum,
const uint8_t *  data,
uint16_t  len 
)
static

References data.

Referenced by uip_chksum(), uip_ipchksum(), and upper_layer_chksum().

static void dao_ack_input ( void  )
static
void dao_ack_output ( rpl_instance_t instance,
uip_ipaddr_t dest,
uint8_t  sequence 
)
void dao_output ( rpl_parent_t parent,
uint8_t  lifetime 
)
static void dio_input ( void  )
static

References rpl_metric_container::aggr, buffer, rpl_dio::dag_id, rpl_dio::dag_intdoubl, rpl_dio::dag_intmin, rpl_dio::dag_max_rankinc, rpl_dio::dag_min_hoprankinc, rpl_dio::dag_redund, rpl_dio::default_lifetime, rpl_dio::destination_prefix, rpl_dio::dtsn, rpl_metric_container::metric_object::energy, rpl_metric_object_energy::energy_est, rpl_metric_container::metric_object::etx, rpl_metric_object_energy::flags, rpl_metric_container::flags, rpl_prefix::flags, get16(), get32(), rpl_dio::grounded, i, rpl_dio::instance_id, len, rpl_metric_container::length, rpl_prefix::length, rpl_prefix::lifetime, rpl_dio::lifetime_unit, rpl_dio::mc, rpl_dio::mop, nbr, NBR_REACHABLE, NULL, rpl_metric_container::obj, rpl_of::ocp, rpl_dio::ocp, packetbuf_addr(), PACKETBUF_ADDR_SENDER, rpl_metric_container::prec, rpl_dio::preference, rpl_prefix::prefix, rpl_dio::prefix_info, PRINT6ADDR, PRINTF, PRINTLLADDR, rpl_dio::rank, uip_ds6_nbr::reachable, RPL_DAG_MC_ENERGY, RPL_DAG_MC_ETX, RPL_DAG_MC_NONE, RPL_DEFAULT_LIFETIME, RPL_DEFAULT_LIFETIME_UNIT, RPL_DIO_GROUNDED, RPL_DIO_INTERVAL_DOUBLINGS, RPL_DIO_INTERVAL_MIN, RPL_DIO_MOP_MASK, RPL_DIO_MOP_SHIFT, RPL_DIO_PREFERENCE_MASK, RPL_DIO_REDUNDANCY, RPL_MAX_RANKINC, RPL_MIN_HOPRANKINC, RPL_OPTION_DAG_CONF, RPL_OPTION_DAG_METRIC_CONTAINER, RPL_OPTION_PAD1, RPL_OPTION_PREFIX_INFO, RPL_OPTION_ROUTE_INFO, rpl_process_dio(), RPL_STAT, stimer_set(), rpl_metric_container::type, uip_ds6_nbr_add(), uip_ds6_nbr_lookup(), UIP_ICMP_PAYLOAD, UIP_IP_BUF, uip_ipaddr_copy, uip_l3_icmp_hdr_len, uip_len, UIP_ND6_REACHABLE_TIME, and rpl_dio::version.

static uint8_t ext_hdr_options_process ( void  )
static
static rpl_parent_t* find_parent_any_dag_any_instance ( uip_ipaddr_t addr)
static
static rpl_dag_t* find_parent_dag ( rpl_instance_t instance,
uip_ipaddr_t addr 
)
static
static uint16_t get16 ( uint8_t *  buffer,
int  pos 
)
static

Referenced by dio_input().

static uint32_t get32 ( uint8_t *  buffer,
int  pos 
)
static

Referenced by dio_input().

static rpl_dag_t* get_dag ( uint8_t  instance_id,
uip_ipaddr_t dag_id 
)
static
uint8_t get_match_length ( uip_ipaddr_t src,
uip_ipaddr_t dst 
)

Get the number of matching bits of two addresses.

References j, len, and uip_ip6addr_t::u8.

Referenced by uip_ds6_select_src().

static void handle_periodic_timer ( void *  ptr)
static
static uip_icmp6_input_handler_t* input_handler_lookup ( uint8_t  type,
uint8_t  icode 
)
static
LIST ( echo_reply_callback_list  )
LIST ( input_handler_list  )
static int lollipop_greater_than ( int  a,
int  b 
)
static
static void nbr_callback ( void *  ptr)
static

References rpl_remove_parent().

Referenced by rpl_dag_init().

NBR_TABLE ( rpl_parent_t  ,
rpl_parents   
)
NBR_TABLE_DECLARE ( ds6_neighbors  )
NBR_TABLE_GLOBAL ( uip_ds6_nbr_t  ,
ds6_neighbors   
)
static void neighbor_link_callback ( rpl_parent_t p,
int  status,
int  numtx 
)
static
static void nullify_parents ( rpl_dag_t dag,
rpl_rank_t  minimum_rank 
)
static
void remove_ext_hdr ( void  )
static void remove_parents ( rpl_dag_t dag,
rpl_rank_t  minimum_rank 
)
static
static void reset ( rpl_dag_t dag)
static

References PRINTF.

Referenced by uip_process().

rpl_instance_t* rpl_alloc_instance ( uint8_t  instance_id)
void rpl_cancel_dao ( rpl_instance_t instance)
void rpl_dag_init ( void  )

References nbr_callback(), and nbr_table_register().

Referenced by rpl_init().

rpl_of_t* rpl_find_of ( rpl_ocp_t  ocp)

References i, NULL, and objective_functions.

Referenced by rpl_add_dag(), and rpl_join_instance().

enum rpl_mode rpl_get_mode ( void  )

Get the RPL mode.

Return values
TheRPL mode

References mode.

Referenced by dao_output_target(), schedule_dao(), and set_dao_lifetime_timer().

uint16_t rpl_get_parent_link_metric ( const uip_lladdr_t addr)
rpl_rank_t rpl_get_parent_rank ( uip_lladdr_t addr)
void rpl_icmp6_register_handlers ( void  )

References uip_icmp6_register_input_handler().

Referenced by rpl_init().

void rpl_insert_header ( void  )
void rpl_lock_parent ( rpl_parent_t p)

References nbr_table_lock().

Referenced by dao_input().

void rpl_remove_header ( void  )
void rpl_schedule_dao ( rpl_instance_t instance)
void rpl_schedule_dao_immediately ( rpl_instance_t instance)

References schedule_dao().

Referenced by rpl_set_mode().

rpl_parent_t* rpl_select_parent ( rpl_dag_t dag)
void rpl_set_default_instance ( rpl_instance_t instance)
enum rpl_mode rpl_set_mode ( enum rpl_mode  mode)

Set the RPL mode.

Parameters
modeThe new RPL mode
Return values
Theprevious RPL mode

References default_instance, mode, NULL, PRINTF, rpl_cancel_dao(), RPL_MODE_FEATHER, RPL_MODE_MESH, and rpl_schedule_dao_immediately().

static void set16 ( uint8_t *  buffer,
int  pos,
uint16_t  value 
)
static

Referenced by dio_output().

static void set32 ( uint8_t *  buffer,
int  pos,
uint32_t  value 
)
static

Referenced by dio_output().

static void set_ip_from_prefix ( uip_ipaddr_t ipaddr,
rpl_prefix_t prefix 
)
static
void uip_appserver_addr_get ( uip_ipaddr_t ipaddr)
uint16_t uip_chksum ( uint16_t *  buf,
uint16_t  len 
)

Calculate the Internet checksum over a buffer.

The Internet checksum is the one's complement of the one's complement sum of all 16-bit words in the buffer.

See RFC1071.

Parameters
bufA pointer to the buffer over which the checksum is to be computed.
lenThe length of the buffer over which the checksum is to be computed.
Returns
The Internet checksum of the buffer.

References chksum(), and uip_htons().

Referenced by time_exceeded().

void uip_ds6_aaddr_rm ( uip_ds6_aaddr_t aaddr)

References uip_ds6_aaddr::isused, and NULL.

uint32_t uip_ds6_compute_reachable_time ( void  )

Compute the reachable time based on base reachable time, see RFC 4861.

References uip_ds6_netif::base_reachable_time, random_rand(), UIP_ND6_MAX_RANDOM_FACTOR, and UIP_ND6_MIN_RANDOM_FACTOR.

Referenced by ra_input(), and uip_ds6_init().

uip_ds6_nbr_t * uip_ds6_get_least_lifetime_neighbor ( void  )

This searches inside the neighbor table for the neighbor that is about to
expire the next.

Returns
A reference to the neighbor about to expire the next or NULL if table is empty.

References nbr, nbr_table_head(), nbr_table_next(), NULL, uip_ds6_nbr::reachable, and stimer_remaining().

uint8_t uip_ds6_list_loop ( uip_ds6_element_t list,
uint8_t  size,
uint16_t  elementsize,
uip_ipaddr_t ipaddr,
uint8_t  ipaddrlen,
uip_ds6_element_t **  out_element 
)
uip_ds6_maddr_t* uip_ds6_maddr_lookup ( const uip_ipaddr_t ipaddr)
void uip_ds6_maddr_rm ( uip_ds6_maddr_t maddr)

References uip_ds6_maddr::isused, and NULL.

Referenced by uip_ds6_addr_rm().

const uip_ipaddr_t * uip_ds6_nbr_get_ipaddr ( const uip_ds6_nbr_t nbr)

References uip_ds6_nbr::ipaddr, and NULL.

uip_ipaddr_t * uip_ds6_nbr_ipaddr_from_lladdr ( const uip_lladdr_t lladdr)
uip_ds6_nbr_t * uip_ds6_nbr_ll_lookup ( const uip_lladdr_t lladdr)
const uip_lladdr_t * uip_ds6_nbr_lladdr_from_ipaddr ( const uip_ipaddr_t ipaddr)
int uip_ds6_nbr_num ( void  )
void uip_ds6_neighbors_init ( void  )

References nbr_table_register(), and uip_ds6_nbr_rm().

Referenced by uip_ds6_init().

uip_ds6_prefix_t* uip_ds6_prefix_lookup ( uip_ipaddr_t ipaddr,
uint8_t  ipaddrlen 
)
void uip_ds6_prefix_rm ( uip_ds6_prefix_t prefix)

References uip_ds6_prefix::isused, and NULL.

Referenced by ra_input(), and uip_ds6_periodic().

void uip_ds6_set_addr_iid ( uip_ipaddr_t ipaddr,
uip_lladdr_t lladdr 
)

set the last 64 bits of an IP address based on the MAC address

References uip_ip6addr_t::u8, and UIP_LLADDR_LEN.

Referenced by main(), ra_input(), rpl_link_neighbor_callback(), set_global_address(), set_ip_from_prefix(), uip_ds6_init(), uncompress_addr(), and uncompress_hdr_hc1().

uint16_t uip_htons ( uint16_t  val)

Convert a 16-bit quantity from host byte order to network byte order.

This function is primarily used for converting variables from host byte order to network byte order. For converting constants to network byte order, use the UIP_HTONS() macro instead.

References UIP_HTONS.

Referenced by appcall(), ip64_4to6(), ip64_6to4(), ip64_addrmap_lookup(), ipv4_checksum(), ipv4_transport_checksum(), ipv6_transport_checksum(), make_tcp_stats(), PROCESS_THREAD(), receiver(), send_msg(), tcp_socket_connect(), tcp_socket_listen(), tcp_socket_unlisten(), uip_chksum(), uip_ipchksum(), upper_layer_chksum(), and websocket_http_client_get().

void uip_icmp6_echo_reply_callback_add ( struct uip_icmp6_echo_reply_notification n,
uip_icmp6_echo_reply_callback_t  c 
)

Add a callback function for ping replies.

Parameters
nA struct uip_icmp6_echo_reply_notification that must have been allocated by the caller
cA pointer to the callback function to be called
        This function adds a callback function to the list of
        callback functions that are called when an ICMP echo
        reply (ping reply) is received. This is used when
        implementing a ping protocol: attach a callback
        function to the ping reply, then send out a ping packet
        with uip_icmp6_send().

        The caller must have statically allocated a struct
        uip_icmp6_echo_reply_notification to hold the internal
        state of the callback function.

        When a ping reply packet is received, all registered
        callback functions are called. The callback functions
        must not modify the contents of the uIP buffer.

References c, uip_icmp6_echo_reply_notification::callback, list_add(), and NULL.

Referenced by PROCESS_THREAD().

void uip_icmp6_echo_reply_callback_rm ( struct uip_icmp6_echo_reply_notification n)

Remove a callback function for ping replies.

Parameters
nA struct uip_icmp6_echo_reply_notification that must have been previously added with uip_icmp6_echo_reply_callback_add()
        This function removes a callback function from the list of
        callback functions that are called when an ICMP echo
        reply (ping reply) is received.

References list_remove().

void uip_icmp6_error_output ( uint8_t  type,
uint8_t  code,
uint32_t  param 
)
UIP_ICMP6_HANDLER ( dis_handler  ,
ICMP6_RPL  ,
RPL_CODE_DIS  ,
dis_input   
)
UIP_ICMP6_HANDLER ( dio_handler  ,
ICMP6_RPL  ,
RPL_CODE_DIO  ,
dio_input   
)
UIP_ICMP6_HANDLER ( dao_handler  ,
ICMP6_RPL  ,
RPL_CODE_DAO  ,
dao_input   
)
UIP_ICMP6_HANDLER ( dao_ack_handler  ,
ICMP6_RPL  ,
RPL_CODE_DAO_ACK  ,
dao_ack_input   
)
UIP_ICMP6_HANDLER ( echo_request_handler  ,
ICMP6_ECHO_REQUEST  ,
UIP_ICMP6_HANDLER_CODE_ANY  ,
echo_request_input   
)
UIP_ICMP6_HANDLER ( echo_reply_handler  ,
ICMP6_ECHO_REPLY  ,
UIP_ICMP6_HANDLER_CODE_ANY  ,
echo_reply_input   
)
void uip_icmp6_init ( )

Initialise the uIP ICMPv6 core.

References uip_icmp6_register_input_handler().

Referenced by uip_init().

uint8_t uip_icmp6_input ( uint8_t  type,
uint8_t  icode 
)

Handle an incoming ICMPv6 message.

Parameters
typeThe ICMPv6 message type
icodeThe ICMPv6 message code
Returns
Success: UIP_ICMP6_INPUT_SUCCESS, Error: UIP_ICMP6_INPUT_ERROR

Generic handler for unknown ICMPv6 types. It will lookup for a registered function capable of handing this message type. The function must have first been registered with uip_icmp6_register_input_handler. The function is in charge of setting uip_len to 0, otherwise the uIPv6 core will attempt to send whatever remains in the UIP_IP_BUF.

A return value of UIP_ICMP6_INPUT_ERROR means that a handler could not be invoked. This is most likely because the ICMPv6 type does not have a valid handler associated with it.

UIP_ICMP6_INPUT_SUCCESS signifies that a handler was found for this ICMPv6 type and that it was invoked. It does NOT provide any indication whatsoever regarding whether the handler itself succeeded.

References uip_icmp6_input_handler::handler, input_handler_lookup(), NULL, UIP_ICMP6_INPUT_ERROR, and UIP_ICMP6_INPUT_SUCCESS.

Referenced by uip_process().

void uip_icmp6_register_input_handler ( uip_icmp6_input_handler_t handler)

Register a handler which can handle a specific ICMPv6 message type.

Parameters
handlerA pointer to the handler

References list_add().

Referenced by rpl_icmp6_register_handlers(), uip_icmp6_init(), and uip_nd6_init().

void uip_icmp6_send ( const uip_ipaddr_t dest,
int  type,
int  code,
int  payload_len 
)

Send an icmpv6 message.

Parameters
destdestination address of the message
typetype of the message
codeof the message
payload_lenlength of the payload

References uip_ds6_netif::cur_hop_limit, tcpip_ipv6_output(), uip_ds6_if, uip_ds6_select_src(), uip_icmp6chksum(), UIP_ICMP_BUF, UIP_ICMPH_LEN, UIP_IP_BUF, UIP_IPH_LEN, uip_len, and UIP_PROTO_ICMP6.

Referenced by dao_ack_output(), dao_input(), dao_output_target(), dio_output(), dis_output(), and PROCESS_THREAD().

uint16_t uip_icmp6chksum ( void  )

Calculate the ICMP checksum of the packet in uip_buf.

Returns
The ICMP checksum of the ICMP packet in uip_buf

References UIP_PROTO_ICMP6, and upper_layer_chksum().

Referenced by echo_request_input(), ns_input(), uip_icmp6_error_output(), uip_icmp6_send(), uip_nd6_ns_output(), uip_nd6_rs_output(), and uip_process().

void uip_init ( void  )

uIP initialization function.

This function should be called at boot up to initialize the uIP TCP/IP stack.

References c, uip_mcast6_driver::init, uip_udp_conn::lport, UIP_CLOSED, UIP_CONNS, uip_ds6_init(), uip_icmp6_init(), UIP_LISTENPORTS, UIP_MCAST6, uip_nd6_init(), UIP_UDP_CONNS, and uip_udp_conns.

Referenced by PROCESS_THREAD().

uint16_t uip_ipchksum ( void  )

Calculate the IP header checksum of the packet header in uip_buf.

The IP header checksum is the Internet checksum of the 20 bytes of the IP header.

Returns
The IP header checksum of the IP header in the uip_buf buffer.

References chksum(), PRINTF, uip_buf, uip_htons(), UIP_IPH_LEN, and UIP_LLH_LEN.

Referenced by PROCESS_THREAD(), time_exceeded(), and uip_split_output().

void uip_nd6_init ( void  )

Initialise the uIP ND core.

References uip_icmp6_register_input_handler().

Referenced by uip_init().

void uip_nd6_ns_input ( void  )

Process a neighbor solicitation.

The NS can be received in 3 cases (procedures):

  • sender is performing DAD (ip src = unspecified, no SLLAO option)
  • sender is performing NUD (ip dst = unicast)
  • sender is performing address resolution (ip dest = solicited node mcast address)

We do:

  • if the tgt belongs to me, reply, otherwise ignore
  • if i was performing DAD for the same address, two cases: – I already sent a NS, hence I win – I did not send a NS yet, hence I lose

If we need to send a NA in response (i.e. the NS was done for NUD, or address resolution, or DAD and there is a conflict), we do it in this function: set src, dst, tgt address in the three cases, then for all cases set the rest, including SLLAO

void uip_nd6_ns_output ( uip_ipaddr_t src,
uip_ipaddr_t dest,
uip_ipaddr_t tgt 
)

Send a neighbor solicitation, send a Neighbor Advertisement.

Parameters
srcpointer to the src of the NS if known
destpointer to ip address to send the NS, for DAD or ADDR Resol, MUST be NULL, for NUD, must be correct unicast dest
tgtpointer to ip address to fill the target address field, must not be NULL
  • RFC 4861, 7.2.2 : "If the source address of the packet prompting the solicitation is the same as one of the addresses assigned to the outgoing interface, that address SHOULD be placed in the IP Source Address of the outgoing solicitation. Otherwise, any one of the addresses assigned to the interface should be used." This is why we have a src ip address as argument. If NULL, we will do src address selection, otherwise we use the argument.
  • we check if it is a NS for Address resolution or NUD, if yes we include a SLLAO option, otherwise no.

References create_llao(), ICMP6_NS, NULL, PRINT6ADDR, PRINTF, uip_buf, uip_create_solicited_node, uip_create_unspecified, uip_ds6_is_my_addr, uip_ds6_select_src(), uip_ext_len, uip_icmp6chksum(), UIP_ICMP_BUF, UIP_ICMPH_LEN, UIP_IP_BUF, uip_ipaddr_copy, UIP_IPH_LEN, uip_is_addr_unspecified, uip_l2_l3_icmp_hdr_len, uip_len, UIP_ND6_HOP_LIMIT, UIP_ND6_NS_BUF, UIP_ND6_NS_LEN, UIP_ND6_OPT_LLAO_LEN, UIP_ND6_OPT_SLLAO, UIP_PROTO_ICMP6, and UIP_STAT.

Referenced by tcpip_ipv6_output(), and uip_ds6_neighbor_periodic().

void uip_nd6_rs_output ( void  )

Send a Router Solicitation.

src is chosen through the uip_netif_select_src function. If src is unspecified (i.e. we do not have a preferred address yet), then we do not put a SLLAO option (MUST NOT in RFC 4861). Otherwise we do.

RS message format, possible option is SLLAO, MUST NOT be included if source = unspecified SHOULD be included otherwise

References create_llao(), ICMP6_RS, PRINT6ADDR, PRINTF, uip_buf, uip_create_linklocal_allrouters_mcast, uip_ds6_select_src(), uip_icmp6chksum(), UIP_ICMP_BUF, UIP_ICMPH_LEN, UIP_IP_BUF, uip_is_addr_unspecified, uip_l2_l3_icmp_hdr_len, uip_l3_icmp_hdr_len, uip_len, UIP_ND6_HOP_LIMIT, UIP_ND6_OPT_LLAO_LEN, UIP_ND6_OPT_SLLAO, UIP_ND6_RS_LEN, UIP_PROTO_ICMP6, and UIP_STAT.

Referenced by uip_ds6_send_rs().

void uip_process ( uint8_t  flag)

process the options within a hop by hop or destination option header

Return values
0,:nothing to send,
1,:drop pkt
2,:ICMP error message to send

References c, uip_ds6_netif::cur_hop_limit, ext_hdr_options_process(), ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_NOPORT, ICMP6_DST_UNREACH_NOTNEIGHBOR, ICMP6_PACKET_TOO_BIG, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, ICMP6_PARAMPROB_NEXTHEADER, ICMP6_TIME_EXCEED_TRANSIT, ICMP6_TIME_EXCEEDED, uip_mcast6_driver::in, uip_conn::initialmss, uip_conn::len, uip_conn::lport, uip_udp_conn::lport, uip_conn::mss, uip_conn::nrtx, NULL, PRINT6ADDR, PRINTF, uip_conn::rcv_nxt, remove_ext_hdr(), reset(), uip_conn::ripaddr, uip_udp_conn::ripaddr, rpl_insert_header(), rpl_update_header_empty(), uip_conn::rport, uip_udp_conn::rport, uip_conn::rto, uip_conn::sa, send(), uip_conn::snd_nxt, uip_conn::sv, TCP_ACK, TCP_CTL, TCP_FIN, TCP_OPT_END, TCP_OPT_MSS, TCP_OPT_MSS_LEN, TCP_OPT_NOOP, TCP_PSH, TCP_RST, TCP_SYN, TCP_URG, uip_conn::tcpstateflags, uip_conn::timer, uip_udp_conn::ttl, UIP_ABORT, UIP_ACKDATA, uip_add32(), UIP_APPCALL, uip_appdata, uip_buf, UIP_CLOSE, UIP_CLOSED, UIP_CLOSING, uip_conn, UIP_CONNECTED, UIP_CONNS, uip_ds6_if, uip_ds6_is_addr_onlink(), uip_ds6_is_my_addr, uip_ds6_is_my_maddr, uip_ds6_select_src(), UIP_ESTABLISHED, uip_ext_bitmap, UIP_EXT_BUF, UIP_EXT_HDR_BITMAP_DESTO1, UIP_EXT_HDR_BITMAP_DESTO2, UIP_EXT_HDR_BITMAP_HBHO, UIP_EXT_HDR_BITMAP_ROUTING, uip_ext_len, UIP_FIN_WAIT_1, UIP_FIN_WAIT_2, uip_flags, UIP_HTONS, UIP_ICMP6_APPCALL, uip_icmp6_error_output(), uip_icmp6_input(), UIP_ICMP6_INPUT_ERROR, uip_icmp6chksum(), UIP_ICMP_BUF, UIP_IP_BUF, uip_ipaddr_cmp, uip_ipaddr_copy, UIP_IPH_LEN, UIP_IPTCPH_LEN, UIP_IPUDPH_LEN, uip_is_addr_link_local, uip_is_addr_loopback, uip_is_addr_mcast, uip_is_addr_mcast_routable, uip_is_addr_unspecified, UIP_LAST_ACK, uip_len, UIP_LINK_MTU, UIP_LISTENPORTS, UIP_LLH_LEN, UIP_LOG, UIP_MAXRTX, UIP_MAXSYNRTX, UIP_MCAST6, UIP_MCAST6_ACCEPT, UIP_NEWDATA, uip_next_hdr, uip_outstanding, UIP_POLL, UIP_POLL_REQUEST, UIP_PROTO_DESTO, UIP_PROTO_FRAG, UIP_PROTO_HBHO, UIP_PROTO_ICMP6, UIP_PROTO_NONE, UIP_PROTO_ROUTING, UIP_PROTO_TCP, UIP_PROTO_UDP, UIP_RECEIVE_WINDOW, UIP_REXMIT, UIP_ROUTING_BUF, UIP_RTO, uip_sappdata, uip_slen, UIP_STAT, UIP_STOPPED, UIP_SYN_RCVD, UIP_SYN_SENT, UIP_TCP_BUF, UIP_TCP_MSS, uip_tcpchksum(), UIP_TCPH_LEN, UIP_TCPIP_HLEN, UIP_TIME_WAIT, UIP_TIME_WAIT_TIMEOUT, UIP_TIMEDOUT, UIP_TIMER, UIP_TS_MASK, UIP_UDP_APPCALL, UIP_UDP_BUF, uip_udp_conn, UIP_UDP_CONNS, uip_udp_conns, UIP_UDP_SEND_CONN, uip_udpchksum(), and UIP_UDPH_LEN.

Referenced by uip_udp_packet_send().

void uip_send ( const void *  data,
int  len 
)

Send data on the current connection.

This function is used to send out a single segment of TCP data. Only applications that have been invoked by uIP for event processing can send data.

The amount of data that actually is sent out after a call to this function is determined by the maximum amount of data TCP allows. uIP will automatically crop the data so that only the appropriate amount of data is sent. The function uip_mss() can be used to query uIP for the amount of data that actually will be sent.

Note
This function does not guarantee that the sent data will arrive at the destination. If the data is lost in the network, the application will be invoked with the uip_rexmit() event being set. The application will then have to resend the data using this function.
Parameters
dataA pointer to the data which is to be sent.
lenThe maximum amount of data bytes to be sent.

References MIN, NULL, uip_buf, UIP_BUFSIZE, UIP_LLH_LEN, uip_sappdata, uip_slen, and UIP_TCPIP_HLEN.

Referenced by data_is_sent_and_acked(), PT_THREAD(), send_discover(), send_request(), and senddata().

static void update_metric_container ( rpl_instance_t instance)
static
static uint16_t upper_layer_chksum ( uint8_t  proto)
static

uint8_t dao_sequence = RPL_LOLLIPOP_INIT
static

Referenced by dao_output_target().

uint8_t dio_send_ok
static
uint8_t uip_ds6_nbr::isrouter

Referenced by na_input(), ra_input(), and uip_ds6_nbr_add().

uip_ipaddr_t loc_fipaddr
static
uip_ds6_aaddr_t* locaaddr
static
uip_ds6_maddr_t* locmaddr
static
uip_ds6_prefix_t* locprefix
static

Referenced by uip_ds6_prefix_lookup().

uint16_t next_dis
static
uint8_t uip_ds6_nbr::nscount
rpl_of_t* const objective_functions[] = {&RPL_OF}
static

Referenced by rpl_find_of().

struct ctimer periodic_timer
static
rpl_of_t rpl_mrhof
Initial value:
= {
1
}
static void reset(rpl_dag_t *)
Definition: rpl-mrhof.c:107
static rpl_rank_t calculate_rank(rpl_parent_t *, rpl_rank_t)
Definition: rpl-mrhof.c:137
static rpl_parent_t * best_parent(rpl_parent_t *, rpl_parent_t *)
Definition: rpl-mrhof.c:181
static void update_metric_container(rpl_instance_t *)
Definition: rpl-mrhof.c:213
static void neighbor_link_callback(rpl_parent_t *, int, int)
Definition: rpl-mrhof.c:113
static rpl_dag_t * best_dag(rpl_dag_t *, rpl_dag_t *)
Definition: rpl-mrhof.c:167
rpl_of_t RPL_OF
rpl_of_t RPL_OF
rpl_of_t rpl_of0
Initial value:
= {
0
}
static void update_metric_container(rpl_instance_t *)
Definition: rpl-of0.c:158
static void reset(rpl_dag_t *)
Definition: rpl-of0.c:68
#define NULL
Definition: def.h:47
static rpl_dag_t * best_dag(rpl_dag_t *, rpl_dag_t *)
Definition: rpl-of0.c:98
static rpl_parent_t * best_parent(rpl_parent_t *, rpl_parent_t *)
Definition: rpl-of0.c:124
static rpl_rank_t calculate_rank(rpl_parent_t *, rpl_rank_t)
Definition: rpl-of0.c:74
uint8_t rscount
static

RS timer, to schedule RS sending.

Referenced by uip_ds6_send_rs().

struct stimer uip_ds6_nbr::sendns
uip_ipaddr_t tmp_ipaddr
static

temporary IP address

uip_buf_t uip_aligned_buf

Packet buffer for incoming and outgoing packets.

struct uip_conn* uip_conn

Pointer to the current TCP connection.

The uip_conn pointer can be used to access the current TCP connection.

Referenced by uip_process().

uint8_t uip_ds6_addr_size

Prefix list.

Referenced by uip_ds6_init().

uip_ds6_netif_t uip_ds6_if
uint8_t uip_ds6_netif_addr_list_offset

Referenced by uip_ds6_init().

uip_ds6_prefix_t uip_ds6_prefix_list[UIP_DS6_PREFIX_NB]

The single interface.

struct etimer uip_ds6_timer_periodic
struct etimer uip_ds6_timer_periodic
struct etimer uip_ds6_timer_rs

Timer for maintenance of data structures.

Referenced by eventhandler(), uip_ds6_init(), and uip_ds6_send_rs().

struct etimer uip_ds6_timer_rs

Timer for maintenance of data structures.

Referenced by eventhandler(), uip_ds6_init(), and uip_ds6_send_rs().

uint8_t uip_ext_bitmap = 0

bitmap we use to record which IPv6 headers we have already seen

Referenced by uip_process().

uint8_t uip_ext_opt_offset = 0
uint8_t uip_flags

Referenced by uip_process().

uint16_t uip_len

The length of the packet in the uip_buf buffer.

The global variable uip_len holds the length of the packet in the uip_buf buffer.

When the network device driver calls the uIP input function, uip_len should be set to the length of the packet in the uip_buf buffer.

When sending packets, the device driver should use the contents of the uip_len variable to determine the length of the outgoing packet.

Referenced by dao_ack_input(), dao_input(), dio_input(), dis_input(), echo_reply_input(), echo_request_input(), eventhandler(), handle_incoming_rreq(), input(), input_callback(), interface_output(), ip64_eth_interface_input(), na_input(), ns_input(), output(), packet_input(), PROCESS_THREAD(), ra_input(), recv_data(), remove_ext_hdr(), rpl_remove_header(), rpl_update_header_empty(), set_rpl_opt(), slip_send(), slipdev_send(), tcpip_input(), tcpip_ipv6_output(), time_exceeded(), uip_arp_arpin(), uip_arp_out(), uip_ds6_neighbor_periodic(), uip_ds6_periodic(), uip_fw_forward(), uip_fw_output(), uip_icmp6_error_output(), uip_icmp6_send(), uip_nd6_ns_output(), uip_nd6_rs_output(), uip_over_mesh_send(), uip_process(), uip_split_output(), and uip_udp_packet_send().

uint8_t* uip_next_hdr

Type of the next header in IPv6 header or extension headers.

Can be the next header field in the IPv6 header or in an extension header. When doing fragment reassembly, we must change the value of the next header field in the header before the fragmentation header, hence we need a pointer to this field.

Referenced by uip_process().

void* uip_sappdata

Referenced by uip_process(), and uip_send().

uint16_t uip_slen