Microchip® Advanced Software Framework

nwkSecurity.c File Reference

Security routines implementation.

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

#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "sysConfig.h"
#include "sysEncrypt.h"
#include "nwk.h"
#include "nwkTx.h"
#include "nwkFrame.h"
#include "nwkSecurity.h"

Enumerations

enum  {
  NWK_SECURITY_STATE_ENCRYPT_PENDING = 0x30,
  NWK_SECURITY_STATE_DECRYPT_PENDING = 0x31,
  NWK_SECURITY_STATE_PROCESS = 0x32,
  NWK_SECURITY_STATE_WAIT = 0x33,
  NWK_SECURITY_STATE_CONFIRM = 0x34
}
 

Functions

void NWK_SetSecurityKey (uint8_t *key)
 
void nwkSecurityInit (void)
 Initializes the Security module. More...
 
void nwkSecurityProcess (NwkFrame_t *frame, bool encrypt)
 
static bool nwkSecurityProcessMic (void)
 
static void nwkSecurityStart (void)
 
void nwkSecurityTaskHandler (void)
 Security Module task handler. More...
 
void SYS_EncryptConf (void)
 

Variables

static NwkFrame_tnwkSecurityActiveFrame
 
static uint8_t nwkSecurityActiveFrames
 
static bool nwkSecurityEncrypt
 
static uint8_t nwkSecurityOffset
 
static uint8_t nwkSecuritySize
 
static uint32_t nwkSecurityVector [4]
 

anonymous enum
Enumerator
NWK_SECURITY_STATE_ENCRYPT_PENDING 
NWK_SECURITY_STATE_DECRYPT_PENDING 
NWK_SECURITY_STATE_PROCESS 
NWK_SECURITY_STATE_WAIT 
NWK_SECURITY_STATE_CONFIRM 

void NWK_SetSecurityKey ( uint8_t *  key)

References NwkIb_t::key, NWK_SECURITY_KEY_SIZE, and nwkIb.

Referenced by appInit().

void nwkSecurityInit ( void  )

Initializes the Security module.

References nwkSecurityActiveFrames.

Referenced by NWK_Init().

static bool nwkSecurityProcessMic ( void  )
static

NwkFrame_t* nwkSecurityActiveFrame
static
uint8_t nwkSecurityActiveFrames
static
uint8_t nwkSecurityOffset
static
uint8_t nwkSecuritySize
static
uint32_t nwkSecurityVector[4]
static