From 1caf8d1ef9171994cb61492dddc6d1618146b8ce Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Tue, 7 Apr 2015 05:53:35 +0000 Subject: [PATCH] Not needed anymore FossilOrigin-Name: 3da1e976b5e27b351c9ae756fcf18316e5dcfc7fa9f7233278e2341a40fb09aa --- src/capwap/cwmsg_addelem_result_code.c | 10 ---- src/capwap/cwmsg_addelem_wtp_board_data.c | 56 ----------------------- src/capwap/process_msgelems.c | 53 --------------------- 3 files changed, 119 deletions(-) delete mode 100644 src/capwap/cwmsg_addelem_result_code.c delete mode 100644 src/capwap/cwmsg_addelem_wtp_board_data.c delete mode 100644 src/capwap/process_msgelems.c diff --git a/src/capwap/cwmsg_addelem_result_code.c b/src/capwap/cwmsg_addelem_result_code.c deleted file mode 100644 index 001687d0..00000000 --- a/src/capwap/cwmsg_addelem_result_code.c +++ /dev/null @@ -1,10 +0,0 @@ - -#include "capwap.h" - -void cwmsg_addelem_result_code(struct cwmsg *msg,int rc) -{ - uint8_t c[4]; - *((uint32_t*)c)= htonl(rc); - cwmsg_addelem(msg,CW_ELEM_RESULT_CODE,c,4); -} - diff --git a/src/capwap/cwmsg_addelem_wtp_board_data.c b/src/capwap/cwmsg_addelem_wtp_board_data.c deleted file mode 100644 index 5b461466..00000000 --- a/src/capwap/cwmsg_addelem_wtp_board_data.c +++ /dev/null @@ -1,56 +0,0 @@ - -#include -#include - -#include "capwap.h" -#include "bstr.h" - - -static int add_board_data_subelem(uint8_t *msg,int type, bstr_t data) -{ - if (!data) - return 0; - - - int l = bstr_len(data); - *((uint32_t *) (msg)) = htonl(type << 16 | l); - memcpy(msg + 4, bstr_data(data), l); - return l+4; - -} - - -void cwmsg_addelem_wtp_board_data(struct cwmsg *cwmsg, struct wtpinfo *wtpinfo) -{ - uint8_t msg[1024]; - - /* vendor identifier */ - *((uint32_t *) msg) = htonl(wtpinfo->vendor_id); - - int len = 4; - - /* mandatory sub-elements */ - - - len += add_board_data_subelem(msg+len,CWBOARDDATA_MODELNO,wtpinfo->model_no); - - len += add_board_data_subelem(msg+len,CWBOARDDATA_SERIALNO,wtpinfo->serial_no); - - - /* other sub-elements */ - - len += add_board_data_subelem(msg+len,CWBOARDDATA_BOARDID,wtpinfo->board_id); - - len += add_board_data_subelem(msg+len,CWBOARDDATA_REVISION,wtpinfo->board_revision); - - - - if (wtpinfo->macaddress) { - *((uint32_t *) (msg + len)) = - htonl(CWBOARDDATA_MACADDRESS << 16 | wtpinfo->macaddress_len); - memcpy(msg + len + 4, wtpinfo->macaddress, wtpinfo->macaddress_len); - len += wtpinfo->macaddress_len + 4; - } - - cwmsg_addelem(cwmsg, CW_ELEM_WTP_BOARD_DATA, msg, len); -} diff --git a/src/capwap/process_msgelems.c b/src/capwap/process_msgelems.c deleted file mode 100644 index 688c00dd..00000000 --- a/src/capwap/process_msgelems.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - 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" - -/* - * for each capwap message element in msgelems call the callback function - */ -int process_msgelems(uint8_t * msgelems, int len, - int (*callback)(void*,int,uint8_t*,int),void *arg ) -{ -// printf("NUNU %08X\n",msgelems); - - uint32_t val; - int type; - int elen; - int i=0; - do { - val = ntohl(*(uint32_t*)(msgelems+i)); - type=(val>>16) & 0xFFFF; - elen = val & 0xffff; - if (i+elen+4>len) { -// printf("Error AAA"); -// exit(88); - return 0; - } - - callback(arg,type,msgelems+i+4,elen); -// process_joinmsgelem(wtpman,msgelems+i+4,type,elen); -// printf("type %d, len %d\n",type,elen); - i+=elen+4; -// printf("I %d, len %d\n",i,len); - - } while (i