From 403d3325553e7a4caa22b02df0c9331862836251 Mon Sep 17 00:00:00 2001 From: kkrentz Date: Thu, 17 Dec 2015 05:55:13 -0800 Subject: [PATCH] llsec: Make decorated framer configurable --- core/net/llsec/noncoresec/noncoresec.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/core/net/llsec/noncoresec/noncoresec.c b/core/net/llsec/noncoresec/noncoresec.c index c55128336..a14e71e52 100644 --- a/core/net/llsec/noncoresec/noncoresec.c +++ b/core/net/llsec/noncoresec/noncoresec.c @@ -47,7 +47,6 @@ #include "net/llsec/llsec802154.h" #include "net/llsec/ccm-star-packetbuf.h" #include "net/mac/frame802154.h" -#include "net/mac/framer-802154.h" #include "net/netstack.h" #include "net/packetbuf.h" #include "net/nbr-table.h" @@ -55,6 +54,14 @@ #include "lib/ccm-star.h" #include +#ifdef NONCORESEC_CONF_DECORATED_FRAMER +#define DECORATED_FRAMER NONCORESEC_CONF_DECORATED_FRAMER +#else /* NONCORESEC_CONF_DECORATED_FRAMER */ +#define DECORATED_FRAMER framer_802154 +#endif /* NONCORESEC_CONF_DECORATED_FRAMER */ + +extern const struct framer DECORATED_FRAMER; + #ifdef NONCORESEC_CONF_SEC_LVL #define SEC_LVL NONCORESEC_CONF_SEC_LVL #else /* NONCORESEC_CONF_SEC_LVL */ @@ -155,7 +162,7 @@ create(void) int result; add_security_header(); - result = framer_802154.create(); + result = DECORATED_FRAMER.create(); if(result == FRAMER_FAILED) { return result; } @@ -172,7 +179,7 @@ parse(void) const linkaddr_t *sender; struct anti_replay_info* info; - result = framer_802154.parse(); + result = DECORATED_FRAMER.parse(); if(result == FRAMER_FAILED) { return result; } @@ -242,7 +249,7 @@ static int length(void) { add_security_header(); - return framer_802154.length() + MIC_LEN; + return DECORATED_FRAMER.length() + MIC_LEN; } /*---------------------------------------------------------------------------*/ static void