Microchip® Advanced Software Framework

nwkRoute.c File Reference

Routing implementation.

Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.

#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include "sysConfig.h"
#include "nwk.h"
#include "nwkTx.h"
#include "nwkFrame.h"
#include "nwkRoute.h"
#include "nwkGroup.h"
#include "nwkCommand.h"
#include "nwkRouteDiscovery.h"

Macros

#define NWK_ROUTE_DEFAULT_RANK   128
 
#define NWK_ROUTE_MAX_RANK   255
 

Functions

NWK_RouteTableEntry_t * NWK_RouteFindEntry (uint16_t dst, uint8_t multicast)
 
void NWK_RouteFreeEntry (NWK_RouteTableEntry_t *entry)
 
NWK_RouteTableEntry_t * NWK_RouteNewEntry (void)
 
uint16_t NWK_RouteNextHop (uint16_t dst, uint8_t multicast)
 
NWK_RouteTableEntry_t * NWK_RouteTable (void)
 
bool nwkRouteErrorReceived (NWK_DataInd_t *ind)
 
void nwkRouteFrame (NwkFrame_t *frame)
 
void nwkRouteFrameReceived (NwkFrame_t *frame)
 
void nwkRouteFrameSent (NwkFrame_t *frame)
 
void nwkRouteInit (void)
 Initializes the Routing module. More...
 
static void nwkRouteNormalizeRanks (void)
 
void nwkRoutePrepareTx (NwkFrame_t *frame)
 
void nwkRouteRemove (uint16_t dst, uint8_t multicast)
 
static void nwkRouteSendRouteError (uint16_t src, uint16_t dst, uint8_t multicast)
 
void nwkRouteUpdateEntry (uint16_t dst, uint8_t multicast, uint16_t nextHop, uint8_t lqi)
 

Variables

static NWK_RouteTableEntry_t nwkRouteTable [NWK_ROUTE_TABLE_SIZE]
 

#define NWK_ROUTE_DEFAULT_RANK   128
#define NWK_ROUTE_MAX_RANK   255

Referenced by nwkRouteFrameSent().

NWK_RouteTableEntry_t* NWK_RouteFindEntry ( uint16_t  dst,
uint8_t  multicast 
)
void NWK_RouteFreeEntry ( NWK_RouteTableEntry_t *  entry)

References NWK_ROUTE_UNKNOWN.

Referenced by nwkRouteFrameSent(), and nwkRouteRemove().

NWK_RouteTableEntry_t* NWK_RouteNewEntry ( void  )
uint16_t NWK_RouteNextHop ( uint16_t  dst,
uint8_t  multicast 
)
NWK_RouteTableEntry_t* NWK_RouteTable ( void  )

References nwkRouteTable.

void nwkRouteInit ( void  )

Initializes the Routing module.

References NWK_ROUTE_TABLE_SIZE, NWK_ROUTE_UNKNOWN, and nwkRouteTable.

Referenced by NWK_Init().

static void nwkRouteNormalizeRanks ( void  )
static

References NWK_ROUTE_TABLE_SIZE, and nwkRouteTable.

Referenced by nwkRouteFrameSent().

void nwkRouteRemove ( uint16_t  dst,
uint8_t  multicast 
)
void nwkRouteUpdateEntry ( uint16_t  dst,
uint8_t  multicast,
uint16_t  nextHop,
uint8_t  lqi 
)