From d938a2383c4957ff61c46e8dc8b1e317319afe5a Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Thu, 14 Aug 2014 23:59:15 +0000 Subject: [PATCH] Inital commit. FossilOrigin-Name: 9bd95d5f71fe913decda9950ede7fdf4c4b6ffe85f09e9ff1cfe814cba838807 --- .../cw_readelem_wtp_reboot_statistics.c | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/capwap/cw_readelem_wtp_reboot_statistics.c diff --git a/src/capwap/cw_readelem_wtp_reboot_statistics.c b/src/capwap/cw_readelem_wtp_reboot_statistics.c new file mode 100644 index 00000000..564ddd70 --- /dev/null +++ b/src/capwap/cw_readelem_wtp_reboot_statistics.c @@ -0,0 +1,40 @@ +/* + This file is part of libcapwap. + + libcapwap is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + libcapwap is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Foobar. If not, see . + +*/ + + +#include "capwap.h" +#include "wtpinfo.h" + + +int cw_readelem_wtp_reboot_statistics(struct wtp_reboot_statistics *s, int type,uint8_t *msgelem, int len) +{ + if (type != CWMSGELEM_WTP_REBOOT_STATISTICS) + return 0; + + s->reboot_count=ntohs(*((uint16_t*)(msgelem+0))); + s->ac_initiated_count=ntohs(*((uint16_t*)(msgelem+2))); + s->link_failure_count=ntohs(*((uint16_t*)(msgelem+4))); + s->sw_failure_count=ntohs(*((uint16_t*)(msgelem+6))); + s->hw_failure_count=ntohs(*((uint16_t*)(msgelem+8))); + s->other_failure_count=ntohs(*((uint16_t*)(msgelem+10))); + s->unknown_failure_count=ntohs(*((uint16_t*)(msgelem+12))); + s->last_failure_type=*(msgelem+14); + + return 1; +} +