Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
security-test.c File Reference
#include <assert.h>
#include <pthread.h>
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include "ca821x-posix/ca821x-posix-evbme.h"
#include "ca821x-posix/ca821x-posix.h"
#include "evbme_messages.h"
Include dependency graph for security-test.c:

Classes

struct  M_KeyDescriptor_st
 
struct  inst_priv
 

Macros

#define RED   "\x1b[31m"
 
#define GREEN   "\x1b[32m"
 
#define YELLOW   "\x1b[33m"
 
#define BLUE   "\x1b[34m"
 
#define MAGENTA   "\x1b[35m"
 
#define CYAN   "\x1b[36m"
 
#define BOLDWHITE   "\033[1m\033[37m"
 
#define RESET   "\x1b[0m"
 
#define COLOR_SET(C, X)   C X RESET
 
#define M_PANID   0x5ECC
 
#define M_MSDU_LENGTH   100
 
#define MAX_INSTANCES   5
 
#define TX_PERIOD   ((struct timespec){0, 0})
 
#define CHANNEL   22
 
#define SWAP_COUNTDOWN   100
 
#define NEW_MODE   0
 

Functions

void initInst (struct inst_priv *cur)
 
void drawTableHeader ()
 
void drawTableRow (unsigned int time)
 
int main (int argc, char *argv[])
 

Variables

uint8_t key1 [] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}
 
uint8_t key2 [] = {0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00}
 
uint8_t addr1 [] = {0xBE, 0xEF, 0xEA, 0x7E, 0x50, 0x57, 0xEA, 0x35}
 
uint8_t addr2 [] = {0xFA, 0xCE, 0x0F, 0xFF, 0xFA, 0xCE, 0x17, 0x00}
 
uint16_t saddr1 = 0xBEEF
 
uint16_t saddr2 = 0xFACE
 
int numInsts
 
struct inst_priv insts [MAX_INSTANCES] = {}
 
pthread_mutex_t out_mutex = PTHREAD_MUTEX_INITIALIZER
 

Macro Definition Documentation

◆ BLUE

#define BLUE   "\x1b[34m"

◆ BOLDWHITE

#define BOLDWHITE   "\033[1m\033[37m"

◆ CHANNEL

#define CHANNEL   22

◆ COLOR_SET

#define COLOR_SET (   C,
 
)    C X RESET

◆ CYAN

#define CYAN   "\x1b[36m"

◆ GREEN

#define GREEN   "\x1b[32m"

◆ M_MSDU_LENGTH

#define M_MSDU_LENGTH   100

◆ M_PANID

#define M_PANID   0x5ECC

◆ MAGENTA

#define MAGENTA   "\x1b[35m"

◆ MAX_INSTANCES

#define MAX_INSTANCES   5

◆ NEW_MODE

#define NEW_MODE   0

◆ RED

#define RED   "\x1b[31m"

◆ RESET

#define RESET   "\x1b[0m"

◆ SWAP_COUNTDOWN

#define SWAP_COUNTDOWN   100

◆ TX_PERIOD

#define TX_PERIOD   ((struct timespec){0, 0})

◆ YELLOW

#define YELLOW   "\x1b[33m"

Function Documentation

◆ drawTableHeader()

void drawTableHeader ( )

◆ drawTableRow()

void drawTableRow ( unsigned int  time)

◆ initInst()

void initInst ( struct inst_priv cur)

◆ main()

int main ( int  argc,
char *  argv[] 
)

Variable Documentation

◆ addr1

uint8_t addr1[] = {0xBE, 0xEF, 0xEA, 0x7E, 0x50, 0x57, 0xEA, 0x35}

◆ addr2

uint8_t addr2[] = {0xFA, 0xCE, 0x0F, 0xFF, 0xFA, 0xCE, 0x17, 0x00}

◆ insts

struct inst_priv insts[MAX_INSTANCES] = {}

◆ key1

uint8_t key1[] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}

◆ key2

uint8_t key2[] = {0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00}

◆ numInsts

int numInsts

◆ out_mutex

pthread_mutex_t out_mutex = PTHREAD_MUTEX_INITIALIZER

◆ saddr1

uint16_t saddr1 = 0xBEEF

◆ saddr2

uint16_t saddr2 = 0xFACE