From a2b59eccd72bfca842981488ecc6f32fd7e6feb0 Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Sun, 17 Aug 2014 22:03:07 +0000 Subject: [PATCH] Initial commit FossilOrigin-Name: 703aa1ad65247f68e1fee3a8aec01c44e6dae819b8eaa74cb777e220d1ed1fc9 --- .../cw_readelem_radio_administrative_state.c | 28 +++++++++++++++++++ src/capwap/cw_readelem_statistics_timer.c | 18 ++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 src/capwap/cw_readelem_radio_administrative_state.c create mode 100644 src/capwap/cw_readelem_statistics_timer.c diff --git a/src/capwap/cw_readelem_radio_administrative_state.c b/src/capwap/cw_readelem_radio_administrative_state.c new file mode 100644 index 00000000..dbf216ec --- /dev/null +++ b/src/capwap/cw_readelem_radio_administrative_state.c @@ -0,0 +1,28 @@ + +#include "capwap.h" +#include "cw_log.h" + + + + + + +int cw_readelem_radio_administrative_state(struct radioinfo * radioinfo, int type,uint8_t *msgelem, int len) +{ + if (type != CWMSGELEM_RADIO_ADMINISTRATIVE_STATE) + return 0; + + if (len<2) + return 0; + + if (len!=2){ + cw_dbg(DBG_CW_RFC,"Radio administrative state size != 2, RFC 5415"); + } + + int radioid = msgelem[0]; + + radioid&=0x1f; + + radioinfo[radioid].admin_state=msgelem[1]; + return 1; +} diff --git a/src/capwap/cw_readelem_statistics_timer.c b/src/capwap/cw_readelem_statistics_timer.c new file mode 100644 index 00000000..cc62fc61 --- /dev/null +++ b/src/capwap/cw_readelem_statistics_timer.c @@ -0,0 +1,18 @@ +#include "capwap.h" + +#include "cw_log.h" + +int cw_readelem_statistics_timer(uint16_t *timer, int type, uint8_t * msgelem, int len) +{ + if (type != CWMSGELEM_STATISTICS_TIMER) + return 0; + + if (len!=2){ + cw_dbg(DBG_CW_RFC,"Statistics timer msgelem has wrong size, type=%d,len=%d",type,len); + return 0; + } + *timer=*((uint16_t*)msgelem); + return 1; +} + +