diff --git a/actube.workspace b/actube.workspace
index e0162c79..b8870938 100644
--- a/actube.workspace
+++ b/actube.workspace
@@ -3,9 +3,9 @@
-
+
-
+
diff --git a/libcw.project b/libcw.project
index 6ae58eb3..baa570e3 100644
--- a/libcw.project
+++ b/libcw.project
@@ -8,7 +8,6 @@
-
@@ -36,22 +35,17 @@
-
-
-
-
-
@@ -78,7 +72,6 @@
-
@@ -93,11 +86,9 @@
-
-
@@ -117,13 +108,10 @@
-
-
-
@@ -141,18 +129,12 @@
-
-
-
-
-
-
@@ -199,7 +181,6 @@
-
@@ -208,10 +189,6 @@
-
-
-
-
@@ -239,11 +216,8 @@
-
-
-
@@ -263,9 +237,7 @@
-
-
@@ -276,7 +248,6 @@
-
diff --git a/src/cw/acpriolist.c b/src/cw/acpriolist.c
index 1ed1b91a..4b2e96fa 100644
--- a/src/cw/acpriolist.c
+++ b/src/cw/acpriolist.c
@@ -25,7 +25,7 @@
#include "acpriolist.h"
-
+/*
static int acprio_cmp(const void *x1, const void *x2)
{
cw_acprio_t * p1 = (cw_acprio_t*)x1;
@@ -44,6 +44,7 @@ static void acprio_del(void *d)
free(d);
}
+
const struct mbag_typedef mbag_type_acprio = {
"acprio",acprio_del
};
@@ -81,4 +82,4 @@ int cw_acpriolist_get(cw_acpriolist_t l, char * acname){
return pf->prio;
}
-
+ */
diff --git a/src/cw/acpriolist.h b/src/cw/acpriolist.h
index 56d3fa54..0fe4e2c9 100644
--- a/src/cw/acpriolist.h
+++ b/src/cw/acpriolist.h
@@ -2,7 +2,7 @@
#define __ACIPRIORITYLIST_H
#include "mavl.h"
-#include "mbag.h"
+
/**
* Used to store AC Name With Priority elements.
diff --git a/src/cw/action.c b/src/cw/action.c
deleted file mode 100644
index dc2cff37..00000000
--- a/src/cw/action.c
+++ /dev/null
@@ -1,333 +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 .
-
-*/
-
-/**
- * @file
- * @brief Implementation of methods for actionlists.
- */
-
-#include "mbag.h"
-#include
-#include
-
-#include "action.h"
-
-/* ---------------------------------------------
- * cw_actionlist_in stuff
- */
-
-
-static int cw_action_in_cmp(const void *elem1, const void *elem2)
-{
- struct cw_action_in *e1 = (struct cw_action_in *) elem1;
- struct cw_action_in *e2 = (struct cw_action_in *) elem2;
- int r;
-
- r = e1->capwap_state - e2->capwap_state;
- if (r != 0)
- return r;
-
- r = e1->msg_id - e2->msg_id;
- if (r != 0)
- return r;
-
- r = e1->elem_id - e2->elem_id;
- if (r != 0)
- return r;
-
- r = e1->vendor_id - e2->vendor_id;
- if (r != 0)
- return r;
-
- r = e1->proto - e2->proto;
- if (r != 0)
- return r;
-
- return 0;
-}
-
-/**
- * Create an action list for incomming messages
- * @return the create list or NULL if an error has occured
- */
-cw_actionlist_in_t cw_actionlist_in_create()
-{
- return mavl_create(cw_action_in_cmp, free,1312);
-}
-
-/**
- * Add an element to an "in-list"
- * @param t action list to elem to
- * @param a element to add
- * @rturn a pointer to the added element
- */
-cw_action_in_t *cw_actionlist_in_add(cw_actionlist_in_t t, struct cw_action_in * a)
-{
- int s = sizeof(struct cw_action_in);
-
- void *r = mavl_replace_data(t, a, s);
- if (r)
- return r;
-
- void *an = malloc(s);
- if (!an)
- return NULL;
-
- memcpy(an, a, s);
- return mavl_add(t, an,NULL);
-}
-
-/**
- * Get an element from an actionlist_in
- * @param t action list
- * @param a element to search for
- * @return the elemen or NULL if not found
- */
-struct cw_action_in *cw_actionlist_in_get(cw_actionlist_in_t t, struct cw_action_in *a)
-{
- return mavl_get(t, a);
-}
-
-
-/**
- * Register actions in an action list for incommin messages
- * @param t action list, where messaes will be registered
- * @param actions an array of actions to reggister
- * @return the number of registred actions
- */
-int cw_actionlist_in_register_actions(cw_actionlist_in_t t, cw_action_in_t * actions)
-{
- int n=0;
- while (actions->capwap_state) {
- cw_action_in_t *rc = cw_actionlist_in_add(t, actions);
- if (!rc)
- return 0;
- actions++;
- n++;
- }
- return n;
-}
-
-/* ---------------------------------------------
- * cw_actionlist_out stuff
- */
-
-
-
-struct outelem{
- uint32_t msg_id;
- mlist_t * mlist;
-};
-
-
-static int mout_cmp(void *elem1,void *elem2)
-{
-
- struct cw_action_out *e1 = (struct cw_action_out *) elem1;
- struct cw_action_out *e2 = (struct cw_action_out *) elem2;
- int r;
-
- r = e1->msg_id - e2->msg_id;
- if (r )
- return r;
-
- r = e1->elem_id - e2->elem_id;
- if (r )
- return r;
-
-
- r = e1->vendor_id - e2->vendor_id;
- if (r )
- return r;
-
- if (e1->item_id == e2->item_id)
- return 0;
-
- if (e1->item_id && e2->item_id)
- return strcmp(e1->item_id,e2->item_id);
-
- return 1;
-}
-
-
-
-struct outelem * cw_actionlist_mout_create(int msg_id)
-{
-/* struct outelem * o = malloc(sizeof(struct outelem));
- if (!o)
- return NULL;
-
- o->mlist= mlist_create(mout_cmp);
- if (!o->mlist){
- free(o);
- return NULL;
- }
- o->msg_id=msg_id;
- return o;
-*/
-}
-
-static struct outelem * cw_actionlist_out_get_outelem(cw_actionlist_out_t t, int msg_id)
-{
- struct outelem search;
- search.msg_id=msg_id;
- return mavl_get(t,&search);
-}
-
-
-
-/*
- * Compare function for actionlist_out_t lists
- */
-static int cw_action_out_cmp(const void *elem1, const void *elem2)
-{
- struct outelem *e1 = (struct outelem *) elem1;
- struct outelem *e2 = (struct outelem *) elem2;
- return e1->msg_id - e2->msg_id;
-}
-
-
-
-/**
- * Add an element to an actionlist_out
- * @param t action list
- * @param a element to add
- */
-cw_action_out_t *cw_actionlist_out_add(cw_actionlist_out_t t, struct cw_action_out * a)
-{
- struct outelem * o = cw_actionlist_out_get_outelem(t,a->msg_id);
-
-
- if (!o){
- o = cw_actionlist_mout_create(a->msg_id);
- if (!o) {
- return NULL;
- }
- mavl_add(t,o,NULL);
- }
-
- struct mlistelem * e = mlist_replace(o->mlist,a);
- if (!e)
- e = mlist_append(o->mlist,a);
-
- if (e)
- return a;
-
- return 0;
-}
-
-
-/**
- * Register actions in an action list for incommin messages
- * @param t action list, where messaes will be registered
- * @param actions an array of actions to reggister
- * @return the number of registred actions
- */
-
-int cw_actionlist_out_register_actions(cw_actionlist_out_t t, cw_action_out_t * actions)
-{
- int n=0;
- while (actions->msg_id != 0) {
- cw_action_out_t *rc = cw_actionlist_out_add(t, actions);
- if (rc == 0)
- return 0;
- actions++;
- n++;
- }
- return n;
-}
-
-
-
-/**
- * Add an action to an action
- * @param t actionlist
- * @param a action to add
- * @param s size of element to add
- * @return pointer to added element or NULL if an error has opccured
- */
-void *cw_actionlist_add(struct mavl *t, void *a, size_t s)
-{
-
- void *r = mavl_replace_data(t, a, s); //sizeof(struct cw_action_in));
- if (r) {
- return r;
- }
-
- void *an = malloc(s);
- if (!an)
- return NULL;
-
- memcpy(an, a, s);
- return mavl_add(t, an,NULL);
-
-}
-
-
-/**
- * Create an action list for outgoing message lements
- * @return the created action list or NULL if an erro has occured.
- */
-cw_actionlist_out_t cw_actionlist_out_create()
-{
- return mavl_create(cw_action_out_cmp, free,1312);
-}
-
-
-
-mlist_t * cw_actionlist_out_get(cw_actionlist_out_t t,int msg_id)
-{
- struct outelem *o = cw_actionlist_out_get_outelem(t,msg_id);
- if (!o)
- return NULL;
- return o->mlist;
-}
-
-
-
-
-
-
-/* misc stuff */
-
-
-cw_action_fun_t cw_set_msg_end_callback(struct cw_actiondef *actions,
- int capwap_state,int msg_id, cw_action_fun_t callback)
-{
- cw_action_in_t as;
- as.capwap_state = capwap_state;
- as.msg_id = msg_id;
- as.vendor_id = 0;
- as.elem_id = 0;
- as.proto = 0;
-
- cw_action_in_t *af;
-
-
- af = cw_actionlist_in_get(actions->in, &as);
- if (!af)
- return NULL;
-
- cw_action_fun_t old = af->end;
- af->end =callback;
- return old;
-
-}
-
-
-
diff --git a/src/cw/action.h b/src/cw/action.h
deleted file mode 100644
index dac0d00f..00000000
--- a/src/cw/action.h
+++ /dev/null
@@ -1,203 +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 .
-
-*/
-
-/**
- * @file
- * @brief CAPWAP ACtions Header
- * @defgroup ACTION CAPWAP/LWAPP Actions
- * @{
- */
-#ifndef __ACTION_H
-#define __ACTION_H
-
-#include
-
-#include "mavl.h"
-#include "conn.h"
-/*#include "mbag.h"*/
-#include "strheap.h"
-#include "intavltree.h"
-#include "item.h"
-#include "mlist.h"
-
-
-struct conn;
-
-
-
-/**
- * @file action.h
- * @brief Header for actions
- */
-
-
-#define CW_ACTION_PROTO_CAPWAP 0
-#define CW_ACTION_PROTO_LWAPP 1
-
-
-
-
-/**
- * @defgroup ACTION Action
- * @{
- */
-
-
-
-/**
- * Definition of an action for incomming messages
- */
-struct cw_action_in{
- uint32_t vendor_id;
- uint8_t proto;
- uint8_t capwap_state;
- uint32_t msg_id;
- uint16_t elem_id;
- int (*start)(struct conn *conn,struct cw_action_in *a,uint8_t*data,int len,struct sockaddr *from);
- int (*end)(struct conn *conn,struct cw_action_in *a,uint8_t*elem,int len,struct sockaddr *from);
- const struct mbag_typedef * itemtype;
- const char * item_id;
- uint16_t min_len;
- uint16_t max_len;
- uint8_t mand;
-};
-
-
-/** a handy type for incomming actions */
-typedef struct cw_action_in cw_action_in_t;
-
-/** Definition of an action list for incomming messages */
-typedef mavl_t cw_actionlist_in_t;
-
-
-extern cw_actionlist_in_t cw_actionlist_in_create();
-extern cw_action_in_t * cw_actionlist_in_get(cw_actionlist_in_t t,cw_action_in_t *a);
-
-/*
-//extern cw_action_in_t * cw_actionlist_in_add(cw_actionlist_in_t t,cw_action_in_t *a);
-*/
-extern int cw_actionlist_in_register_actions(cw_actionlist_in_t t,cw_action_in_t * actions);
-
-
-
-/**
- * Definitioni of an action foroutgoing messages
- * */
-struct cw_action_out{
- uint32_t msg_id;
- const char * item_id;
- uint32_t vendor_id;
- uint16_t elem_id;
-
- int (*init)(struct conn * conn, struct cw_action_out *a, uint8_t * dst);
- int (*out)(struct conn * conn, struct cw_action_out *a, uint8_t * dst);
- struct mbag_item *(*get)(struct conn *conn,struct cw_action_out *a);
- uint8_t mand;
- struct mbag_typedef * itemtype;
- void *defval;
-};
-
-
-typedef struct cw_action_out cw_action_out_t;
-typedef struct mavl *cw_actionlist_out_t;
-
-
-extern cw_actionlist_out_t cw_actionlist_out_create();
-extern int cw_actionlist_out_register_actions(cw_actionlist_out_t t,cw_action_out_t * actions);
-mlist_t * cw_actionlist_out_get(cw_actionlist_out_t,int msg_id);
-
-/*
-//extern cw_action_out_t * cw_actionlist_out_add(cw_actionlist_out_t t, struct cw_action_out * a);
-*/
-
-/**
- * @}
- */
-
-
-
-
-
-
-
-
-
-extern cw_actionlist_out_t cw_actionlist_out_create();
-extern cw_action_out_t * cw_actionlist_out_add(cw_actionlist_out_t t, struct cw_action_out * a);
-extern int cw_actionlist_out_register_actions(cw_actionlist_out_t t,cw_action_out_t * actions);
-
-/**
- * Definition CAPWAP modes
- */
-enum capwapmodes {
- /** Auto -- means auto detect the CAPWAP mode and
- it set as soon as possible */
- CW_MODE_AUTO,
- /** Standard CAPWAP mode as specified in RFC 5415 */
- CW_MODE_CAPWAP,
- /** Cisco specific CAPWAP */
- CW_MODE_CISCO,
- /** CIPWAP, a mix of standard CAPWAP and some
- Cisco extension */
- CW_MODE_CIPWAP,
- /** Zyxel */
- CW_MODE_ZYXEL,
- /** Lancom */
- CW_MODE_LANCOM,
- /** Fortinet */
- CW_MODE_FORTINET
-};
-
-
-
-
-
-
-struct cw_actiondef{
- cw_actionlist_in_t in;
- cw_actionlist_out_t out;
- cw_strheap_t strmsg;
- cw_strheap_t strelem;
- cw_itemdefheap_t items;
- cw_itemdefheap_t radioitems;
-
- mlist_t * mout;
-
- /** Supported Wireless Binding IDs (WBID) */
- struct avltree * wbids;
-};
-
-
-
-extern struct outelem * cw_actionlist_out_get_mlist(cw_actionlist_out_t t, int msg_id);
-
-
-typedef int(*cw_action_fun_t)(struct conn *,struct cw_action_in *,uint8_t*,int,struct sockaddr *);
-
-
-cw_action_fun_t cw_set_msg_end_callback(struct cw_actiondef * actions,
- int capwap_state,int msg_id, cw_action_fun_t callback);
-
-
-#define cw_actionlist_get_node(t,a) avltree_get_node(t,a)
-
-/**@}*/
-
-#endif
-
-
diff --git a/src/cw/capwap.h b/src/cw/capwap.h
index cf78cc8b..7e9ba1ec 100644
--- a/src/cw/capwap.h
+++ b/src/cw/capwap.h
@@ -27,7 +27,7 @@
#include
-#include "mbag.h"
+
#include
#include
diff --git a/src/cw/capwap80211.h b/src/cw/capwap80211.h
index 8948d8fa..df29ccbe 100644
--- a/src/cw/capwap80211.h
+++ b/src/cw/capwap80211.h
@@ -121,9 +121,10 @@ struct cw_wlan {
*/
-#include "action.h"
+/*
int cw_out_radio_infos(struct conn *conn, struct cw_action_out *a, uint8_t * dst);
+*/
/*
//extern int cw_register_actions_capwap_80211_wtp(struct cw_actiondef *def);
diff --git a/src/cw/capwap80211_items.c b/src/cw/capwap80211_items.c
deleted file mode 100644
index 54c39a84..00000000
--- a/src/cw/capwap80211_items.c
+++ /dev/null
@@ -1,63 +0,0 @@
-#include "mbag.h"
-#include "item.h"
-#include "capwap80211_items.h"
-#include "capwap80211_types.h"
-
-
-
-const char CW_RADIOITEM80211_SUPPORTED_RATES[]="802.11 supported_rates";
-const char CW_RADIOITEM80211_WTP_RADIO_INFORMATION[]="802.11 radio_info";
-const char CW_RADIOITEM80211_RATE_SET[]="802.11 rate set";
-
-/* MAC Operation Items */
-const char CW_RADIOITEM80211_RTS_THRESHOLD[]="rts_threshold";
-const char CW_RADIOITEM80211_FRAGMENTATION_THRESHOLD[]="fragmentation_threshold";
-const char CW_RADIOITEM80211_SHORT_RETRY[]="short_retry";
-const char CW_RADIOITEM80211_LONG_RETRY[]="long_retry";
-const char CW_RADIOITEM80211_TX_MSDU_LIFETIME[]="tx_msdu_lifetime";
-const char CW_RADIOITEM80211_RX_MSDU_LIFETIME[]="rx_msdu_lifetime";
-
-/* Radio Config Items */
-const char CW_RADIOITEM80211_SHORT_PREAMBLE[]="short_preamble";
-const char CW_RADIOITEM80211_NUM_BSS_IDS[]="num_bss_ids";
-const char CW_RADIOITEM80211_DTIM_PERIOD[]="dtim_period";
-const char CW_RADIOITEM80211_BSSID[]="bssid";
-const char CW_RADIOITEM80211_BEACON_PERIOD[]="beacon_period";
-const char CW_RADIOITEM80211_COUNTRY_STRING[]="country_string";
-
-
-struct cw_itemdef capwap80211_itemdefs[] = {
-
- {CW_ITEM_NONE}
-
-};
-
-
-
-
-
-
-struct cw_itemdef capwap80211_radioitemdefs[] = {
-
- {CW_RADIOITEM80211_SUPPORTED_RATES,CW_ITEM_NONE,CAPWAP80211_TYPE_RATESET},
- {CW_RADIOITEM80211_RATE_SET,CW_ITEM_NONE,CAPWAP80211_TYPE_RATESET},
- {CW_RADIOITEM80211_WTP_RADIO_INFORMATION,CW_ITEM_NONE,MTYPE_DWORD},
-
- /* MAC Operation */
- {CW_RADIOITEM80211_RTS_THRESHOLD,CW_ITEM_NONE,MBAG_WORD},
- {CW_RADIOITEM80211_SHORT_RETRY,CW_ITEM_NONE,MBAG_BYTE},
- {CW_RADIOITEM80211_LONG_RETRY,CW_ITEM_NONE,MBAG_BYTE},
- {CW_RADIOITEM80211_FRAGMENTATION_THRESHOLD,CW_ITEM_NONE,MBAG_WORD},
- {CW_RADIOITEM80211_TX_MSDU_LIFETIME,CW_ITEM_NONE,MTYPE_DWORD},
- {CW_RADIOITEM80211_RX_MSDU_LIFETIME,CW_ITEM_NONE,MTYPE_DWORD},
-
- /* Radio Config Items */
- {CW_RADIOITEM80211_SHORT_PREAMBLE,CW_ITEM_NONE,MBAG_BYTE},
- {CW_RADIOITEM80211_NUM_BSS_IDS,CW_ITEM_NONE,MBAG_BYTE},
- {CW_RADIOITEM80211_DTIM_PERIOD,CW_ITEM_NONE,MBAG_BYTE},
- {CW_RADIOITEM80211_BSSID,CW_ITEM_NONE,MBAG_DATA},
- {CW_RADIOITEM80211_BEACON_PERIOD,CW_ITEM_NONE,MBAG_WORD},
- {CW_RADIOITEM80211_COUNTRY_STRING,CW_ITEM_NONE,MBAG_BSTR16},
-
- {CW_ITEM_NONE}
-};
diff --git a/src/cw/capwap80211_items.h b/src/cw/capwap80211_items.h
deleted file mode 100644
index 2fe931fe..00000000
--- a/src/cw/capwap80211_items.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef __CAPWAP80211_ITEMS_H
-#define __CAPWAP80211_ITEMS_H
-
-#include "item.h"
-
-extern const char CW_RADIOITEM80211_SUPPORTED_RATES[];
-extern const char CW_RADIOITEM80211_RATE_SET[];
-extern const char CW_RADIOITEM80211_WTP_RADIO_INFORMATION[];
-
-extern struct cw_itemdef capwap80211_itemdefs[];
-extern struct cw_itemdef capwap80211_radioitemdefs[];
-
-
-/* MAC Operation Items */
-extern const char CW_RADIOITEM80211_RTS_THRESHOLD[];
-extern const char CW_RADIOITEM80211_FRAGMENTATION_THRESHOLD[];
-extern const char CW_RADIOITEM80211_SHORT_RETRY[];
-extern const char CW_RADIOITEM80211_LONG_RETRY[];
-extern const char CW_RADIOITEM80211_TX_MSDU_LIFETIME[];
-extern const char CW_RADIOITEM80211_RX_MSDU_LIFETIME[];
-
-/* Radio Config Items */
-extern const char CW_RADIOITEM80211_SHORT_PREAMBLE[];
-extern const char CW_RADIOITEM80211_NUM_BSS_IDS[];
-extern const char CW_RADIOITEM80211_DTIM_PERIOD[];
-extern const char CW_RADIOITEM80211_BSSID[];
-extern const char CW_RADIOITEM80211_BEACON_PERIOD[];
-extern const char CW_RADIOITEM80211_COUNTRY_STRING[];
-
-
-#endif
-
diff --git a/src/cw/capwap80211_type_rateset.c b/src/cw/capwap80211_type_rateset.c
index f04d881a..d20a3af8 100644
--- a/src/cw/capwap80211_type_rateset.c
+++ b/src/cw/capwap80211_type_rateset.c
@@ -5,7 +5,7 @@
-
+/*
static int to_str(void *item,char *dst)
{
@@ -123,3 +123,4 @@ const struct mbag_typedef capwap80211_type_rateset = {
.get = get,
.put = put
};
+*/
diff --git a/src/cw/capwap80211_types.h b/src/cw/capwap80211_types.h
index fd29ad2e..42dd5c95 100644
--- a/src/cw/capwap80211_types.h
+++ b/src/cw/capwap80211_types.h
@@ -1,10 +1,11 @@
#ifndef __CAPWAP80211_TYPES_H
#define __CAPWAP80211_TYPES_H
-#include "mbag.h"
+/*
extern const struct mbag_typedef capwap80211_type_rateset;
#define CAPWAP80211_TYPE_RATESET (&capwap80211_type_rateset)
+*/
-#endif
+#endif
\ No newline at end of file
diff --git a/src/cw/capwap_action_helpers.c b/src/cw/capwap_action_helpers.c
index e55969fc..6a4d3152 100644
--- a/src/cw/capwap_action_helpers.c
+++ b/src/cw/capwap_action_helpers.c
@@ -1,9 +1,9 @@
-#include "mbag.h"
-#include "action.h"
+
+
#include "capwap.h"
-
+/*
int cw_in_set_state_none(struct conn *conn,struct cw_action_in * a,uint8_t *data,int len)
{
@@ -60,3 +60,4 @@ struct mbag_item * cw_out_get_session_id(struct conn *conn,struct cw_action_out
return mbag_set_bstrn(conn->local,CW_ITEM_SESSION_ID,session_id,slen);
}
+*/
\ No newline at end of file
diff --git a/src/cw/capwap_actions.h b/src/cw/capwap_actions.h
deleted file mode 100644
index 8b7932c5..00000000
--- a/src/cw/capwap_actions.h
+++ /dev/null
@@ -1,196 +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 .
-
-*/
-
-#ifndef __CAPWAP_ACTIONS_H
-#define __CAPWAP_ACTIONS_H
-
-
-#include "capwap.h"
-#include "capwap_items.h"
-
-
-#define CW_ACTION_IN_LOCATION_DATA \
- CW_ELEM_LOCATION_DATA, /* Element ID*/ \
- cw_in_generic, 0, /* start/end callback */ \
- MBAG_STR, /* Type of element */ \
- CW_ITEM_LOCATION_DATA, /* ID to use store */ \
- 1, 1024 /* min/max length */
-
-
-#define CW_ACTION_IN_WTP_NAME \
- CW_ELEM_WTP_NAME, /* Element ID*/ \
- cw_in_generic, 0, /* start/end callback */ \
- MBAG_STR, /* Type of element */ \
- CW_ITEM_WTP_NAME, /* ID to use store */ \
- 1, 1024 /* min/max length */
-
-#define CW_ACTION_IN_SESSION_ID \
- CW_ELEM_SESSION_ID, /* Element ID*/ \
- cw_in_generic, 0, /* start/end callback */ \
- MBAG_BSTR, /* Type of element */ \
- CW_ITEM_SESSION_ID, /* ID to use store */ \
- 16, 16 /* min/max length */
-
-#define CW_ACTION_IN_IMAGE_IDENTIFIER \
- CW_ELEM_IMAGE_IDENTIFIER, /* Element ID*/ \
- cw_in_generic, 0, /* start/end callback */ \
- MBAG_VENDORSTR, /* Type of element */ \
- CW_ITEM_IMAGE_IDENTIFIER, /* ID to use store */ \
- 5, 4096 /* min/max length */
-
-#define CW_ACTION_IN_AC_NAME \
- CW_ELEM_AC_NAME, /* Element ID*/ \
- cw_in_generic, 0, /* start/end callback */ \
- MBAG_STR, /* Type of element */ \
- CW_ITEM_AC_NAME, /* ID to use store */ \
- 1, 512 /* min/max length */
-
-#define CW_ACTION_IN_STATISTICS_TIMER \
- CW_ELEM_STATISTICS_TIMER, /* Element ID*/ \
- cw_in_generic, 0, /* start/end callback */ \
- MBAG_WORD, /* Type of element */ \
- CW_ITEM_STATISTICS_TIMER, /* ID to use store */ \
- 2, 2 /* min/max length */
-
-#define CW_ACTION_IN_WTP_REBOOT_STATISTICS \
- CW_ELEM_WTP_REBOOT_STATISTICS, /* Element ID*/ \
- cw_in_generic, 0, /* start/end callback */ \
- MBAG_DATA, /* Type of element */ \
- CW_ITEM_WTP_REBOOT_STATISTICS, /* ID to use store */ \
- 15, 15 /* min/max length */
-
-
-#define CW_ACTION_IN_WTP_FRAME_TUNNEL_MODE \
- CW_ELEM_WTP_FRAME_TUNNEL_MODE, /* Element ID*/ \
- cw_in_generic, 0, /* start/end callback */ \
- MBAG_BYTE, /* Type of element */ \
- CW_ITEM_WTP_FRAME_TUNNEL_MODE, /* ID to use store */ \
- 1, 1 /* min/max length */
-
-
-#define CW_ACTION_IN_WTP_MAC_TYPE \
- CW_ELEM_WTP_MAC_TYPE, /* Element ID*/ \
- cw_in_generic, 0, /* start/end callback */ \
- MBAG_BYTE, /* Type of element */ \
- CW_ITEM_WTP_MAC_TYPE, /* ID to use store */ \
- 1, 1 /* min/max length */
-
-#define CW_ACTION_IN_VENDOR_SPECIFIC_PAYLOAD \
- CW_ELEM_VENDOR_SPECIFIC_PAYLOAD, /* Element ID */ \
- cw_in_vendor_specific_payload,0, /* start/end callback*/ \
- 0, \
- 0, \
- 0,0
-
-#define CW_ACTION_IN_WTP_BOARD_DATA \
- CW_ELEM_WTP_BOARD_DATA, /* Element ID */ \
- cw_in_wtp_board_data, 0, /* start/end callback */ \
- 0, \
- CW_ITEM_WTP_BOARD_DATA, \
- 0,0
-
-#define CW_ACTION_IN_WTP_DESCRIPTOR \
- CW_ELEM_WTP_DESCRIPTOR, /* Element ID */ \
- cw_in_wtp_descriptor, 0, /* start/end callback */ \
- 0, \
- CW_ITEM_WTP_DESCRIPTOR, \
- 0,0
-
-
-#define CW_ACTION_IN_CAPWAP_CONTROL_IPV4_ADDRESS \
- CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS, /* Element ID*/ \
- cw_in_capwap_control_ip_address, 0, /* start/end callback */ \
- MBAG_AVLTREE, /* Type of element */ \
- CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST, /* ID to use store */ \
- 6, 6 /* min/max length */
-
-#define CW_ACTION_IN_CAPWAP_CONTROL_IPV6_ADDRESS \
- CW_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS, /* Element ID*/ \
- cw_in_capwap_control_ip_address, 0, /* start/end callback */ \
- MBAG_AVLTREE, /* Type of element */ \
- CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST, /* ID to use store */ \
- 18,18 /* min/max length */
-
-
-
-#define CW_ACTION_IN_AC_DESCRIPTOR \
- CW_ELEM_AC_DESCRIPTOR, /* Element ID*/ \
- cw_in_ac_descriptor, 0, /* start/end callback */ \
- MBAG_DATA, /* Type of element */ \
- CW_ITEM_AC_DESCRIPTOR, /* ID to use store */ \
- 12, 8192 /* min/max length */
-
-
-#define CW_ACTION_IN_RESULT_CODE \
- CW_ELEM_RESULT_CODE, /* Element ID*/ \
- cw_in_generic, 0, /* start/end callback */ \
- MBAG_DWORD, /* Type of element */ \
- CW_ITEM_RESULT_CODE, /* ID to use store */ \
- 4, 4 /* min/max length */
-
-#define CW_ACTION_IN_CAPWAP_TIMERS \
- CW_ELEM_CAPWAP_TIMERS, /* Element ID*/ \
- cw_in_generic, 0, /* start/end callback */ \
- MBAG_WORD, /* Type of element */ \
- CW_ITEM_CAPWAP_TIMERS, /* ID to use store */ \
- 2, 2 /* min/max length */
-
-#define CW_ACTION_IN_IDLE_TIMEOUT \
- CW_ELEM_IDLE_TIMEOUT, /* Element ID*/ \
- cw_in_generic, 0, /* start/end callback */ \
- MBAG_DWORD, /* Type of element */ \
- CW_ITEM_IDLE_TIMEOUT, /* ID to use store */ \
- 4, 4 /* min/max length */
-
-
-#define CW_ACTION_IN_AC_NAME_WITH_PRIORITY \
- CW_ELEM_IDLE_TIMEOUT, /* Element ID*/ \
- cw_in_generic, 0, /* start/end callback */ \
- MBAG_DWORD, /* Type of element */ \
- CW_ITEM_IDLE_TIMEOUT, /* ID to use store */ \
- 4, 4 /* min/max length */
-
-
-
-#define CW_ACTION_IN_RADIO_ADMINISTRATIVE_STATE \
- CW_ELEM_RADIO_ADMINISTRATIVE_STATE, /* Element ID*/ \
- cw_in_radio_administrative_state, 0, /* start/end callback */ \
- MBAG_DWORD, /* Type of element */ \
- 0, /* ID to use store */ \
- 4, 4 /* min/max length */
-
-#define CW_ACTION_IN_RADIO_ADMINISTRATIVE_STATE_WTP \
- CW_ELEM_RADIO_ADMINISTRATIVE_STATE, /* Element ID*/ \
- cw_in_radio_administrative_state_wtp, 0, /* start/end callback */ \
- MBAG_DWORD, /* Type of element */ \
- 0, /* ID to use store */ \
- 4, 4 /* min/max length */
-
-
-
-
-#define CW_ACTION_IN_MAXIMUM_MESSAGE_LENGTH \
- CW_ELEM_MAXIMUM_MESSAGE_LENGTH, /* Element ID*/ \
- cw_in_generic, 0, /* start/end callback */ \
- MBAG_WORD, /* Type of element */ \
- CW_ITEM_MAXIMUM_MESSAGE_LENGTH, /* ID to use store */ \
- 2, 2 /* min/max length */
-
-
-
-#endif
diff --git a/src/cw/capwap_inline.c b/src/cw/capwap_inline.c
index 624007c4..e15ca83d 100644
--- a/src/cw/capwap_inline.c
+++ b/src/cw/capwap_inline.c
@@ -1,4 +1,4 @@
-#include "mbag.h"
+
#include "capwap.h"
diff --git a/src/cw/capwap_items.c b/src/cw/capwap_items.c
deleted file mode 100644
index b3a15344..00000000
--- a/src/cw/capwap_items.c
+++ /dev/null
@@ -1,180 +0,0 @@
-#include "mbag.h"
-#include "item.h"
-
-#include "capwap_items.h"
-
-
-const char CW_ITEM_CAPWAP_TRANSPORT_PROTOCOL[]="capwap_transport_protocol";
-const char CW_ITEM_IDLE_TIMEOUT[]="idle_timeout";
-const char CW_ITEM_DISCOVERY_TYPE[]="discovery_type";
-const char CW_ITEM_WTP_NAME[]="wtp_name";
-const char CW_ITEM_ECN_SUPPORT[]="ecn_support";
-const char CW_ITEM_WTP_FALLBACK[]="wtp_fallback";
-
-
-
-const char CW_ITEM_WTP_MAC_TYPE[]="wtp_mac_type";
-const char CW_ITEM_WTP_FRAME_TUNNEL_MODE[]="wtp_frame_tunnel_mode";
-const char CW_ITEM_WTP_RADIOS_IN_USE[]="max_radios";
-const char CW_ITEM_WTP_MAX_RADIOS[]="radios_in_use";
-
-/*
-const char CW_ITEM_WTP_HARDWARE_VENDOR=
-*/
-
-const char CW_ITEM_WTP_HARDWARE_VERSION[]="wtp_hardware_version";
-const char CW_ITEM_WTP_SOFTWARE_VERSION[]="wtp_software_version";
-const char CW_ITEM_WTP_BOOT_VERSION[]="wtp_boot_version";
-const char CW_ITEM_WTP_OTHER_VERSION[]="wtp_other_version";
-
-/*
-const char CW_ITEM_WTP_SOFTWARE_VENDOR,
-*/
-
-/*
-const char CW_ITEM_WTP_BOOTLOADER_VENDOR,
-*/
-const char CW_ITEM_WTP_BOOTLOADER_VERSION[]="wtp_bootloader_version";
-/*
-const char CW_ITEM_WTP_OTHERSOFTWARE_VENDOR,
-const char CW_ITEM_WTP_OTHERSOFTWARE_VERSION,
-*/
-const char CW_ITEM_WTP_BOARD_DATA[]="wtp_board_data";
-const char CW_ITEM_WTP_DESCRIPTOR[]="0wtp_descriptor";
-const char CW_ITEM_CAPWAP_TIMERS[]="capwap_timers";
-
-const char CW_ITEM_AC_NAME[]="ac_name";
-const char CW_ITEM_AC_DESCRIPTOR[]="ac_descriptor";
-const char CW_ITEM_RESULT_CODE[]="result_code";
-const char CW_ITEM_AC_STATUS[]="ac_status";
-
-const char CW_ITEM_AC_HARDWARE_VERSION[]="ac_hardware_version";
-const char CW_ITEM_AC_SOFTWARE_VERSION[]="ac_software_version";
-
-const char CW_ITEM_AC_IP_LIST[]="ac_ip_list";
-const char CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST[]="capwap_ctrl_ip_addr";
-const char CW_ITEM_CAPWAP_LOCAL_IP_ADDRESS[]="capwap_local_ip_addr";
-
-const char CW_ITEM_LOCATION_DATA[]="location_data";
-const char CW_ITEM_SESSION_ID[]="session_id";
-
-const char CW_ITEM_AC_TIMESTAMP[]="ac_timestamp";
-const char CW_ITEM_STATISTICS_TIMER[]="statistics_timer";
-const char CW_ITEM_WTP_REBOOT_STATISTICS[]="wtp_reboot_statistics";
-const char CW_ITEM_IMAGE_IDENTIFIER[]="image_identifier";
-//const char CW_ITEM_AC_HASH_VALUE[]="ac_hash_value";
-
-const char CW_ITEM_AC_NAME_WITH_PRIORITY[]="ac_name_with_priority";
-const char CW_ITEM_MAXIMUM_MESSAGE_LENGTH[]="maximum_message_length";
-
-
- /* CIPWAP and Cisco */
-//const char CW_ITEM_WTP_GROUP_NAME[]="wtp_group_name";
-
-
- /* Other Items */
-const char CW_ITEM_AC_IMAGE_DIR[]="ac_img_dir"; /* Path where WTP images are stored */
-const char CW_ITEM_IMAGE_FILENAME[]="img_filename"; /* Full path of image filename */
-const char CW_ITEM_DISCOVERIES[]="discoveries";
-
- /** FILE handle for uploading and downloading images */
-const char CW_ITEM_IMAGE_FILEHANDLE[]="image_file_handle";
-
-const char CW_ITEM_RADIO_CFG[]="radio_cfg";
-
-const char CW_ITEM_CISCO_BOARD_DATA_OPTIONS[]="cisco_board_data_options";
-const char CW_ITEM_RADIOS[]="radios";
-const char CW_ITEM_RADIO_OPER_STATE[]="radio_oper_state";
-
-
-const char CW_ITEM_WTP_BOARD_VENDOR[]="vendor_id";
-const char CW_ITEM_WTP_BOARD_MODELNO[]="model_no";
-const char CW_ITEM_WTP_BOARD_MACADDRESS[]="wtp_board_macaddress";
-const char CW_ITEM_WTP_BOARD_ID[]="wtp_board_id";
-const char CW_ITEM_WTP_BOARD_REVISION[]="wtp_board_revision";
-const char CW_ITEM_WTP_BOARD_SERIALNO[]="serial_no";
-const char CW_ITEM_RADIO_INFOS[]="radio_infos";
-
-//const char CW_ITEM_XY[]="wtp_name";
-
-
-struct cw_itemdef capwap_itemdefs[] = {
-
- {CW_ITEM_WTP_NAME,CW_ITEM_NONE,MBAG_STR},
- {CW_ITEM_WTP_MAC_TYPE,CW_ITEM_NONE,MBAG_BYTE},
- {CW_ITEM_WTP_FRAME_TUNNEL_MODE,CW_ITEM_NONE,MBAG_BYTE},
- {CW_ITEM_WTP_FALLBACK,CW_ITEM_NONE,MBAG_BYTE},
-
-
- /* Reboot Statistics */
- {CW_ITEM_WTP_REBOOT_STATISTICS,CW_ITEM_NONE,MBAG_MBAG},
- {CW_ITEM_WTP_REBOOT_STATISTICS,CW_ITEM_REBOOT_COUNT,MBAG_WORD},
- {CW_ITEM_WTP_REBOOT_STATISTICS,CW_ITEM_REBOOT_AC_INITIATED_COUNT,MBAG_WORD},
- {CW_ITEM_WTP_REBOOT_STATISTICS,CW_ITEM_REBOOT_LINK_FAILURE_COUNT,MBAG_WORD},
- {CW_ITEM_WTP_REBOOT_STATISTICS,CW_ITEM_REBOOT_SW_FAILURE_COUNT,MBAG_WORD},
- {CW_ITEM_WTP_REBOOT_STATISTICS,CW_ITEM_REBOOT_HW_FAILURE_COUNT,MBAG_WORD},
- {CW_ITEM_WTP_REBOOT_STATISTICS,CW_ITEM_REBOOT_OTHER_FAILURE_COUNT,MBAG_WORD},
- {CW_ITEM_WTP_REBOOT_STATISTICS,CW_ITEM_REBOOT_UNKNOWN_FAILURE_COUNT,MBAG_WORD},
- {CW_ITEM_WTP_REBOOT_STATISTICS,CW_ITEM_REBOOT_LAST_FAILURE_TYPE,MBAG_BYTE},
-
-
-
-
-
-{CW_ITEM_CAPWAP_TRANSPORT_PROTOCOL,CW_ITEM_NONE,MBAG_BYTE},
-
-{CW_ITEM_LOCATION_DATA,CW_ITEM_NONE,MBAG_STR},
-
-
-
-
-//{CW_ITEM_WTP_GROUP_NAME,CW_ITEM_NONE,MBAG_STR},
-{CW_ITEM_MAXIMUM_MESSAGE_LENGTH,CW_ITEM_NONE,MBAG_WORD},
-{CW_ITEM_STATISTICS_TIMER,CW_ITEM_NONE,MBAG_WORD},
-{CW_ITEM_IDLE_TIMEOUT,CW_ITEM_NONE,MTYPE_DWORD},
-{CW_ITEM_CAPWAP_TIMERS,CW_ITEM_NONE,MBAG_WORD},
-
-{CW_ITEM_AC_NAME_WITH_PRIORITY,CW_ITEM_ANY,MBAG_STR},
-{CW_ITEM_AC_NAME,CW_ITEM_NONE,MBAG_STR},
-{CW_ITEM_RESULT_CODE,CW_ITEM_NONE,MTYPE_DWORD},
-{CW_ITEM_ECN_SUPPORT,CW_ITEM_NONE,MBAG_BYTE},
-{CW_ITEM_DISCOVERY_TYPE,CW_ITEM_NONE,MBAG_BYTE},
-{ CW_ITEM_SESSION_ID,CW_ITEM_NONE,MBAG_BSTR},
-
-
-
-//{CW_ITEM_AP_MODE_AND_TYPE,CW_ITEM_NONE,MBAG_WORD},
-
-/* Board Data */
-{CW_ITEM_WTP_BOARD_DATA,CW_ITEM_NONE,MBAG_MBAG},
-{CW_ITEM_WTP_BOARD_DATA,CW_ITEM_WTP_BOARD_VENDOR,MTYPE_DWORD},
-{CW_ITEM_WTP_BOARD_DATA,CW_ITEM_WTP_BOARD_MODELNO,MBAG_BSTR16},
-{CW_ITEM_WTP_BOARD_DATA,CW_ITEM_WTP_BOARD_SERIALNO,MBAG_BSTR16},
-
-
-/* Cisco Specific items, should be moved to a file like
-cisco_items or so */
-
-{CW_ITEM_CISCO_BOARD_DATA_OPTIONS,CW_ITEM_NONE,MBAG_BSTR16},
-
-
-
-
-{CW_ITEM_NONE}
-
-};
-
-
-const char CW_RADIOITEM_ADMIN_STATE[]="admin_state";
-const char CW_RADIOITEM_OPER_STATE[]="oper_state";
-const char CW_RADIOITEM_DECRYPTION_ERROR_REPORT_PERIOD[]="decryption_error_report_period";
-
-
-struct cw_itemdef capwap_radioitemdefs[] = {
- {CW_RADIOITEM_ADMIN_STATE,CW_ITEM_NONE,MBAG_BYTE},
- {CW_RADIOITEM_OPER_STATE,CW_ITEM_NONE,MBAG_WORD},
-
- {CW_RADIOITEM_DECRYPTION_ERROR_REPORT_PERIOD,CW_ITEM_NONE,MBAG_WORD},
-
- {CW_ITEM_NONE}
-};
diff --git a/src/cw/capwap_items.h b/src/cw/capwap_items.h
deleted file mode 100644
index 87435ad2..00000000
--- a/src/cw/capwap_items.h
+++ /dev/null
@@ -1,207 +0,0 @@
-#ifndef __CAPWAP_ITEMS_H
-#define __CAPWAP_ITEMS_H
-
-#include "item.h"
-
-/*
- CW_ITEM_NONE=0,
- CW_ITEM_IDLE_TIMEOUT,
- CW_ITEM_DISCOVERY_TYPE,
- CW_ITEM_WTP_NAME,
- CW_ITEM_WTP_BOARD_VENDOR,
- CW_ITEM_WTP_BOARD_MODELNO,
- CW_ITEM_WTP_BOARD_MACADDRESS,
- CW_ITEM_WTP_BOARD_ID,
- CW_ITEM_WTP_BOARD_REVISION,
- CW_ITEM_WTP_BOARD_SERIALNO,
- CW_ITEM_WTP_MAC_TYPE,
- CW_ITEM_WTP_FRAME_TUNNEL_MODE,
- CW_ITEM_WTP_RADIOS_IN_USE,
- CW_ITEM_WTP_MAX_RADIOS,
- CW_ITEM_WTP_HARDWARE_VENDOR,
- CW_ITEM_WTP_HARDWARE_VERSION,
- CW_ITEM_WTP_SOFTWARE_VENDOR,
- CW_ITEM_WTP_SOFTWARE_VERSION,
- CW_ITEM_WTP_BOOTLOADER_VENDOR,
- CW_ITEM_WTP_BOOTLOADER_VERSION,
- CW_ITEM_WTP_OTHERSOFTWARE_VENDOR,
- CW_ITEM_WTP_OTHERSOFTWARE_VERSION,
- CW_ITEM_WTP_BOARD_DATA,
- CW_ITEM_WTP_DESCRIPTOR,
- CW_ITEM_CAPWAP_TIMERS,
- CW_ITEM_RADIO_ADMINISTRATIVE_STATE,
-
- CW_ITEM_AC_NAME,
- CW_ITEM_AC_DESCRIPTOR,
- CW_ITEM_RESULT_CODE,
- CW_ITEM_AC_STATUS,
-
- CW_ITEM_AC_HARDWARE_VERSION,
- CW_ITEM_AC_SOFTWARE_VERSION,
-
- CW_ITEM_AC_IP_LIST,
- CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST,
- CW_ITEM_CAPWAP_LOCAL_IP_ADDRESS,
-
- CW_ITEM_LOCATION_DATA,
- CW_ITEM_SESSION_ID,
-
- CW_ITEM_AC_TIMESTAMP,
- CW_ITEM_STATISTICS_TIMER,
- CW_ITEM_WTP_REBOOT_STATISTICS,
- CW_ITEM_IMAGE_IDENTIFIER,
- CW_ITEM_AC_HASH_VALUE,
-
- CW_ITEM_AC_NAME_WITH_PRIORITY,
- CW_ITEM_MAXIMUM_MESSAGE_LENGTH,
-
-
- CW_ITEM_WTP_GROUP_NAME,
-
-
- CW_ITEM_AC_IMAGE_DIR,
- CW_ITEM_IMAGE_FILENAME,
- CW_ITEM_DISCOVERIES,
-
- CW_ITEM_IMAGE_FILEHANDLE,
-
- CW_ITEM_RADIO_CFG,
- CW_ITEM_AP_MODE_AND_TYPE,
-
- CW_ITEM_CISCO_BOARD_DATA_OPTIONS,
- CW_ITEM_RADIOS,
- CW_ITEM_RADIO_OPER_STATE,
-
-
-*/
-
-extern const char CW_ITEM_IDLE_TIMEOUT[];
-extern const char CW_ITEM_DISCOVERY_TYPE[];
-extern const char CW_ITEM_WTP_NAME[];
-extern const char CW_ITEM_WTP_FALLBACK[];
-
-/*
-extern const char CW_ITEM_WTP_BOARD_VENDOR,
-extern const char CW_ITEM_WTP_BOARD_MODELNO,
-extern const char CW_ITEM_WTP_BOARD_MACADDRESS,
-extern const char CW_ITEM_WTP_BOARD_ID,
-extern const char CW_ITEM_WTP_BOARD_REVISION,
-extern const char CW_ITEM_WTP_BOARD_SERIALNO,
-*/
-extern const char CW_ITEM_WTP_MAC_TYPE[];
-extern const char CW_ITEM_WTP_FRAME_TUNNEL_MODE[];
-/*
-extern const char CW_ITEM_WTP_RADIOS_IN_USE=
-extern const char CW_ITEM_WTP_MAX_RADIOS,
-*/
-/*
-extern const char CW_ITEM_WTP_HARDWARE_VENDOR=
-extern const char CW_ITEM_WTP_HARDWARE_VERSION="
-*/
-/*
-extern const char CW_ITEM_WTP_SOFTWARE_VENDOR,
-extern const char CW_ITEM_WTP_SOFTWARE_VERSION,
-extern const char CW_ITEM_WTP_BOOTLOADER_VENDOR,
-extern const char CW_ITEM_WTP_BOOTLOADER_VERSION,
-extern const char CW_ITEM_WTP_OTHERSOFTWARE_VENDOR,
-extern const char CW_ITEM_WTP_OTHERSOFTWARE_VERSION,
-*/
-extern const char CW_ITEM_WTP_BOARD_DATA[];
-extern const char CW_ITEM_WTP_DESCRIPTOR[];
-extern const char CW_ITEM_CAPWAP_TIMERS[];
-extern const char CW_ITEM_RADIO_ADMINISTRATIVE_STATE[];
-
-extern const char CW_ITEM_AC_NAME[];
-extern const char CW_ITEM_AC_DESCRIPTOR[];
-extern const char CW_ITEM_RESULT_CODE[];
-extern const char CW_ITEM_AC_STATUS[];
-
-extern const char CW_ITEM_AC_HARDWARE_VERSION[];
-extern const char CW_ITEM_AC_SOFTWARE_VERSION[];
-
-extern const char CW_ITEM_AC_IP_LIST[];
-extern const char CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST[];
-extern const char CW_ITEM_CAPWAP_LOCAL_IP_ADDRESS[];
-
-extern const char CW_ITEM_LOCATION_DATA[];
-extern const char CW_ITEM_SESSION_ID[];
-
-extern const char CW_ITEM_AC_TIMESTAMP[];
-extern const char CW_ITEM_STATISTICS_TIMER[];
-extern const char CW_ITEM_WTP_REBOOT_STATISTICS[];
-extern const char CW_ITEM_IMAGE_IDENTIFIER[];
-/*
-//extern const char CW_ITEM_AC_HASH_VALUE[];
-*/
-extern const char CW_ITEM_AC_NAME_WITH_PRIORITY[];
-extern const char CW_ITEM_MAXIMUM_MESSAGE_LENGTH[];
-extern const char CW_ITEM_CAPWAP_TRANSPORT_PROTOCOL[];
-
-
- /* CIPWAP and Cisco */
-/*
-//extern const char CW_ITEM_WTP_GROUP_NAME[];
-*/
-
- /* Other Items */
-extern const char CW_ITEM_AC_IMAGE_DIR[]; /* Path where WTP images are stored */
-extern const char CW_ITEM_IMAGE_FILENAME[]; /* Full path of image filename */
-extern const char CW_ITEM_DISCOVERIES[];
-
- /** FILE handle for uploading and downloading images */
-extern const char CW_ITEM_IMAGE_FILEHANDLE[];
-
-extern const char CW_ITEM_RADIO_CFG[];
-extern const char CW_ITEM_AP_MODE_AND_TYPE[];
-
-extern const char CW_ITEM_CISCO_BOARD_DATA_OPTIONS[];
-extern const char CW_ITEM_RADIOS[];
-extern const char CW_ITEM_RADIO_OPER_STATE[];
-
-
-extern const char CW_ITEM_WTP_BOARD_VENDOR[];
-extern const char CW_ITEM_WTP_BOARD_MODELNO[];
-extern const char CW_ITEM_WTP_BOARD_MACADDRESS[];
-extern const char CW_ITEM_WTP_BOARD_ID[];
-extern const char CW_ITEM_WTP_BOARD_REVISION[];
-extern const char CW_ITEM_WTP_BOARD_SERIALNO[];
-
-extern const char CW_ITEM_WTP_SOFTWARE_VERSION[];
-extern const char CW_ITEM_WTP_HARDWARE_VERSION[];
-extern const char CW_ITEM_WTP_BOOT_VERSION[];
-extern const char CW_ITEM_WTP_OTHER_VERSION[];
-
-extern const char CW_ITEM_WTP_BOOTLOADER_VERSION[];
-
-extern const char CW_ITEM_WTP_RADIOS_IN_USE[];
-extern const char CW_ITEM_WTP_MAX_RADIOS[];
-extern const char CW_ITEM_RADIO_INFOS[];
-extern const char CW_ITEM_ECN_SUPPORT[];
-
-/*
-//extern const char CW_ITEM_SSH_ENABLE[];
-//extern const char CW_ITEM_TELNET_ENABLE[];
-*/
-
-
-
-#define CW_ITEM_REBOOT_COUNT "reboot_count"
-#define CW_ITEM_REBOOT_AC_INITIATED_COUNT "ac_initiated"
-#define CW_ITEM_REBOOT_LINK_FAILURE_COUNT "link_failure"
-#define CW_ITEM_REBOOT_SW_FAILURE_COUNT "sw_failure"
-#define CW_ITEM_REBOOT_HW_FAILURE_COUNT "hw_failure"
-#define CW_ITEM_REBOOT_OTHER_FAILURE_COUNT "other_failure"
-#define CW_ITEM_REBOOT_UNKNOWN_FAILURE_COUNT "unknown_failure"
-#define CW_ITEM_REBOOT_LAST_FAILURE_TYPE "last_failure"
-
-
-extern const char CW_RADIOITEM_ADMIN_STATE[];
-extern const char CW_RADIOITEM_OPER_STATE[];
-extern const char CW_RADIOITEM_DECRYPTION_ERROR_REPORT_PERIOD[];
-
-
-extern struct cw_itemdef capwap_itemdefs[];
-extern struct cw_itemdef capwap_radioitemdefs[];
-
-
-#endif
diff --git a/src/cw/capwap_msg_new.c b/src/cw/capwap_msg_new.c
deleted file mode 100644
index 91dedcbc..00000000
--- a/src/cw/capwap_msg_new.c
+++ /dev/null
@@ -1,26 +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 "mbag.h"
-#include "capwap.h"
-
-struct capwap_msg * capwap_msg_new()
-{
-
-
-}
diff --git a/src/cw/capwap_strings_board.c b/src/cw/capwap_strings_board.c
index 4d14b556..eba1efa5 100644
--- a/src/cw/capwap_strings_board.c
+++ b/src/cw/capwap_strings_board.c
@@ -1,4 +1,4 @@
-#include "mbag.h"
+
#include "capwap.h"
struct cw_strlist_elem capwap_strings_board[] = {
diff --git a/src/cw/capwap_strings_elem.c b/src/cw/capwap_strings_elem.c
index 70c6aa9f..812de2c7 100644
--- a/src/cw/capwap_strings_elem.c
+++ b/src/cw/capwap_strings_elem.c
@@ -1,4 +1,4 @@
-#include "mbag.h"
+
#include "capwap.h"
struct cw_strlist_elem capwap_strings_elem[] = {
diff --git a/src/cw/capwap_strings_elem80211.c b/src/cw/capwap_strings_elem80211.c
index 8af4e74a..90336820 100644
--- a/src/cw/capwap_strings_elem80211.c
+++ b/src/cw/capwap_strings_elem80211.c
@@ -1,4 +1,4 @@
-#include "mbag.h"
+
#include "capwap80211.h"
#include "strlist.h"
diff --git a/src/cw/capwap_strings_msg.c b/src/cw/capwap_strings_msg.c
index 60be0d03..27a63258 100644
--- a/src/cw/capwap_strings_msg.c
+++ b/src/cw/capwap_strings_msg.c
@@ -19,7 +19,7 @@
* @file
* @brief Definition of CAPWAP Message Strings
*/
-#include "mbag.h"
+
#include "capwap.h"
/**
diff --git a/src/cw/capwap_strings_result.c b/src/cw/capwap_strings_result.c
index 19da9bfc..574808d2 100644
--- a/src/cw/capwap_strings_result.c
+++ b/src/cw/capwap_strings_result.c
@@ -1,4 +1,4 @@
-#include "mbag.h"
+
#include "capwap.h"
diff --git a/src/cw/capwap_strings_state.c b/src/cw/capwap_strings_state.c
index bfbad924..be0ea712 100644
--- a/src/cw/capwap_strings_state.c
+++ b/src/cw/capwap_strings_state.c
@@ -1,4 +1,4 @@
-#include "mbag.h"
+
#include "capwap.h"
struct cw_strlist_elem capwap_strings_state[] = {
diff --git a/src/cw/capwap_strings_vendor.c b/src/cw/capwap_strings_vendor.c
index 3df86816..de011b47 100644
--- a/src/cw/capwap_strings_vendor.c
+++ b/src/cw/capwap_strings_vendor.c
@@ -1,4 +1,4 @@
-#include "mbag.h"
+
#include "capwap.h"
#include "vendors.h"
diff --git a/src/cw/cipwap.h b/src/cw/cipwap.h
deleted file mode 100644
index b946f708..00000000
--- a/src/cw/cipwap.h
+++ /dev/null
@@ -1,14 +0,0 @@
-
-#ifndef __CIPWAP_H
-#define __CIPWAP_H
-
-#include "strheap.h"
-#include "action.h"
-
-extern struct cw_strlist_elem cipwap_strings_elem[];
-extern int cw_register_actions_cipwap_wtp(struct cw_actiondef *def);
-
-
-
-#endif
-
diff --git a/src/cw/cipwap_strings_elem.c b/src/cw/cipwap_strings_elem.c
deleted file mode 100644
index c571c8c6..00000000
--- a/src/cw/cipwap_strings_elem.c
+++ /dev/null
@@ -1,18 +0,0 @@
-
-#include "mbag.h"
-#include "capwap.h"
-#include "cipwap.h"
-#include "capwap_cisco.h"
-
-
-struct cw_strlist_elem cipwap_strings_elem[] = {
-
- {CAPWAP_ELEM_WTP_IPV4_IP_ADDRESS, "WTP IPv4 IP Address"},
- {CAPWAP_ELEM_WTP_IPV6_IP_ADDRESS, "WTP IPv6 IP Address"},
- {CW_ELEM_AC_NAME_WITH_INDEX, "AC Name with Index"},
-
- {CW_CISCO_AP_GROUP_NAME, "WTP Group Name" },
-
- {CW_STR_STOP,"Unknown Element"}
-
-};
diff --git a/src/cw/cisco.c b/src/cw/cisco.c
index 6183683a..5fbd72d1 100644
--- a/src/cw/cisco.c
+++ b/src/cw/cisco.c
@@ -1,11 +1,12 @@
#include "capwap.h"
#include "capwap_cisco.h"
-#include "mbag.h"
+
#include "radio.h"
#include "log.h"
#include "dbg.h"
+/*
int cw_put_cisco_wtp_radio_cfg(uint8_t *dst, int rid, mbag_t radio)
{
@@ -59,16 +60,17 @@ exit(0);
return 26+2; //+cw_put_elem_vendor_hdr(dst,CW_VENDOR_ID_CISCO,CW_CISCO_WTP_RADIO_CFG,28);
}
+*/
-
+/*
int cw_put_elem_cisco_ap_regulatory_domain(uint8_t *dst,int rid, mbag_t radio)
{
//int l=0;
uint8_t *d=dst+10;
- d+=cw_put_byte(d,rid); /* Band ID */
- d+=cw_put_byte(d,1); /* Set True/False */
- d+=cw_put_byte(d,rid); /* Slot ID */
+ d+=cw_put_byte(d,rid); //Band ID
+ d+=cw_put_byte(d,1); // Set True/False
+ d+=cw_put_byte(d,rid); //* Slot ID
d+=cw_put_word(d,mbag_get_word(radio,CW_RADIO_REG_DOMAIN,1));
return 5 + cw_put_elem_vendor_hdr(dst, CW_VENDOR_ID_CISCO, CW_CISCO_AP_REGULATORY_DOMAIN, 5);
@@ -76,8 +78,9 @@ int cw_put_elem_cisco_ap_regulatory_domain(uint8_t *dst,int rid, mbag_t radio)
}
+*/
-
+/*
int cw_put_elem_cisco_radio_cfg(uint8_t * dst,int rid, mbag_t radio)
{
int l = cw_put_cisco_wtp_radio_cfg(dst+10,rid,radio);
@@ -169,3 +172,4 @@ int cw_in_cisco_radio_administrative_state_wtp(struct conn *conn, struct cw_acti
}
+*/
diff --git a/src/cw/conn.h b/src/cw/conn.h
index d8bf4024..9a9c8e24 100644
--- a/src/cw/conn.h
+++ b/src/cw/conn.h
@@ -32,7 +32,7 @@
#include "fragman.h"
#include "cwmsg.h"
-#include "mbag.h"
+
/*#include "action.h"*/
@@ -78,7 +78,7 @@ struct conn {
- mbag_t outgoing;
+/* mbag_t outgoing;
mbag_t incomming;
mbag_t remote;
mbag_t local;
@@ -87,7 +87,7 @@ struct conn {
mbag_t radios_upd;
mbag_t config;
mbag_t config_upd;
-
+*/
uint8_t session_id[16];
diff --git a/src/cw/conn_clear_upd.c b/src/cw/conn_clear_upd.c
index fc0e3c38..8759b485 100644
--- a/src/cw/conn_clear_upd.c
+++ b/src/cw/conn_clear_upd.c
@@ -5,7 +5,7 @@
#include "mavl.h"
-
+/*
void conn_clear_upd(struct conn *conn, int merge)
{
if (merge){
@@ -30,3 +30,4 @@ void conn_clear_upd(struct conn *conn, int merge)
}
+*/
\ No newline at end of file
diff --git a/src/cw/conn_create_noq.c b/src/cw/conn_create_noq.c
index ce737744..ef9581d9 100644
--- a/src/cw/conn_create_noq.c
+++ b/src/cw/conn_create_noq.c
@@ -25,7 +25,7 @@
#include
#include
-#include "mbag.h"
+
#include "conn.h"
#include "sock.h"
diff --git a/src/cw/conn_destroy.c b/src/cw/conn_destroy.c
index 9d1bbae6..f346fc15 100644
--- a/src/cw/conn_destroy.c
+++ b/src/cw/conn_destroy.c
@@ -21,7 +21,7 @@
*/
#include
-#include "mbag.h"
+
#include "conn.h"
/**
diff --git a/src/cw/conn_init.c b/src/cw/conn_init.c
index 2b247036..a9fd12b9 100644
--- a/src/cw/conn_init.c
+++ b/src/cw/conn_init.c
@@ -24,7 +24,7 @@
#include
-#include "mbag.h"
+
#include "conn.h"
#include "capwap.h"
@@ -43,14 +43,14 @@ void conn_init(struct conn * conn)
conn->capwap_mode = 0;
conn->strict_capwap=1;
- conn->remote = mbag_create();
+
conn->process_packet=conn_process_packet;
conn->process_message=process_message;
- conn->config = mbag_create();
- conn->config_upd=mbag_create();
+
+
}
diff --git a/src/cw/conn_prepare_image_data_request.c b/src/cw/conn_prepare_image_data_request.c
index 03f57894..50438bb6 100644
--- a/src/cw/conn_prepare_image_data_request.c
+++ b/src/cw/conn_prepare_image_data_request.c
@@ -16,7 +16,7 @@
*/
-#include "mbag.h"
+
#include "capwap.h"
#include "lwapp.h"
diff --git a/src/cw/conn_process_packet.c b/src/cw/conn_process_packet.c
index 34d0a8ff..97681f2b 100644
--- a/src/cw/conn_process_packet.c
+++ b/src/cw/conn_process_packet.c
@@ -186,10 +186,11 @@ static struct cw_MsgSet *load_msg_set(struct conn *conn, uint8_t * rawmsg, int l
int cw_in_check_generic(struct conn *conn, struct cw_action_in *a, uint8_t * data,
int len,struct sockaddr *from)
{
- if (cw_is_request(a->msg_id)){
+/* if (cw_is_request(a->msg_id)){
return cw_in_check_generic_req(conn,a,data,len,from);
}
return cw_in_check_generic_resp(conn,a,data,len,from);
+*/
}
@@ -217,7 +218,7 @@ static int process_elements(struct conn *conn, uint8_t * rawmsg, int len,
char sock_buf[SOCK_ADDR_BUFSIZE]; /**< to hold str from sockaddr2str */
- struct cw_action_in as, *af, *afm;
+ /*struct cw_action_in as, *af, *afm;*/
int offset = cw_get_hdr_msg_offset(rawmsg);
diff --git a/src/cw/conn_q_add_packet.c b/src/cw/conn_q_add_packet.c
index 6abc2477..f3c2a7c6 100644
--- a/src/cw/conn_q_add_packet.c
+++ b/src/cw/conn_q_add_packet.c
@@ -19,7 +19,7 @@
#include
#include
-#include "mbag.h"
+
#include "dbg.h"
#include "conn.h"
#include "sock.h"
diff --git a/src/cw/conn_q_get_packet.c b/src/cw/conn_q_get_packet.c
index 13b46c9c..15b9e507 100644
--- a/src/cw/conn_q_get_packet.c
+++ b/src/cw/conn_q_get_packet.c
@@ -15,7 +15,7 @@
along with Foobar. If not, see .
*/
-#include "mbag.h"
+
#include
#include "conn.h"
diff --git a/src/cw/conn_q_recv_packet.c b/src/cw/conn_q_recv_packet.c
index 9fd4d676..cab52cd9 100644
--- a/src/cw/conn_q_recv_packet.c
+++ b/src/cw/conn_q_recv_packet.c
@@ -19,7 +19,7 @@
#include
#include
#include
-#include "mbag.h"
+
#include "conn.h"
static int conn_q_recv_packet_(struct conn * conn, uint8_t * buffer,int len,int peek)
diff --git a/src/cw/conn_recv_packet.c b/src/cw/conn_recv_packet.c
index 70052e51..79825f08 100644
--- a/src/cw/conn_recv_packet.c
+++ b/src/cw/conn_recv_packet.c
@@ -22,7 +22,7 @@
#include
#include
-#include "mbag.h"
+
#include "conn.h"
#include "sock.h"
diff --git a/src/cw/conn_send_msg.c b/src/cw/conn_send_msg.c
index 412727af..42e7ad17 100644
--- a/src/cw/conn_send_msg.c
+++ b/src/cw/conn_send_msg.c
@@ -2,6 +2,8 @@
#include "cw.h"
#include "dbg.h"
+#define CW_MODE_ZYXEL 7
+
int conn_send_msg(struct conn * conn, uint8_t *rawmsg)
{
uint8_t * ptr;
diff --git a/src/cw/conn_send_packet.c b/src/cw/conn_send_packet.c
index d84986ac..25d51167 100644
--- a/src/cw/conn_send_packet.c
+++ b/src/cw/conn_send_packet.c
@@ -16,7 +16,7 @@
*/
-#include "mbag.h"
+
#include
#include
#include "sock.h"
diff --git a/src/cw/connlist.c b/src/cw/connlist.c
index 24958c89..8cf5f8c8 100644
--- a/src/cw/connlist.c
+++ b/src/cw/connlist.c
@@ -28,7 +28,7 @@
#include
-#include "mbag.h"
+
#include "conn.h"
#include "connlist.h"
diff --git a/src/cw/cw.h b/src/cw/cw.h
index 47f6c754..724dd968 100644
--- a/src/cw/cw.h
+++ b/src/cw/cw.h
@@ -4,9 +4,9 @@
#include
#include "bstr.h"
-#include "mbag.h"
+
#include "conn.h"
-#include "action.h"
+
#include "lw.h"
#include "capwap.h"
@@ -271,7 +271,7 @@ int cw_put_elem_vendor_hdr(uint8_t * dst, uint32_t vendorid,
int cw_put_image_data(uint8_t * dst, FILE * infile);
-extern int cw_put_mbag_item(uint8_t * dst, struct mbag_item *item);
+
/**
@@ -337,6 +337,7 @@ extern int cw_read_wtp_descriptor_7(mavl_t mbag, struct conn *conn,
struct cw_ElemHandler *eh, uint8_t * data, int len,
struct cw_DescriptorSubelemDef *allowed);
+/*
extern int cw_read_ac_descriptor(mbag_t store, uint8_t * data, int len,
struct cw_DescriptorSubelemDef *allowed);
@@ -349,7 +350,7 @@ extern int cw_in_check_generic_resp(struct conn *conn, struct cw_action_in *a,
extern int cw_in_check_generic_req(struct conn *conn, struct cw_action_in *a,
uint8_t * data, int len, struct sockaddr *from);
-
+*/
/**
* @defgroup CWELEMIN Input Handlers for Message Elements
@@ -414,10 +415,7 @@ int cw_process_element(struct cw_ElemHandlerParams *params,
* @defgroup CWELEMOUT Output Handlers for Message Elements
* @{
*/
-extern int cw_out_capwap_local_ip_address(struct conn *conn, struct cw_action_out *action,
- uint8_t * dst);
-extern int cw_out_wtp_ip_address(struct conn *conn, struct cw_action_out *action,
- uint8_t * dst);
+
/**
@@ -427,15 +425,19 @@ extern int cw_out_wtp_ip_address(struct conn *conn, struct cw_action_out *action
*/
#define cw_out_capwap_local_ip_address_7 cw_out_wtp_ip_address
+/*
extern int cw_out_wtp_reboot_statistics(struct conn *conn, struct cw_action_out *a,
uint8_t * dst);
+*/
/* helpers */
-extern int cw_put_local_ip_address(int sock, uint8_t * dst, int ipv4elem_id,
+/*extern int cw_put_local_ip_address(int sock, uint8_t * dst, int ipv4elem_id,
int ipv6elem_id);
+*/
+/*
extern int cw_put_radio_operational_states(mbag_t radios, uint8_t * dst, int *nerror,
int d7mode);
-
+*/
void cw_init_request(struct conn *conn, int msg_id);
@@ -448,7 +450,10 @@ void cw_init_request(struct conn *conn, int msg_id);
* @defgroup CAPWAP_RADIO Radio Operations
* @{
*/
+/*
extern int cw_radio_set_admin_state(mbag_t radios,int rid, int state, int cause);
+ */
+
/*
//extern int cw_put_elem_radio_administrative_state(uint8_t *dst,int radio_id,mbag_t radio);
//extern int cw_put_elem_radio_operational_state(uint8_t * dst, int rid, int os, int d7mode);
@@ -461,7 +466,8 @@ int cw_put_elem_radio_administrative_state(uint8_t * dst, int rid, int state);
uint8_t *cw_init_data_keep_alive_msg(uint8_t * buffer,uint8_t *rmac);
-int cw_out_radio_generic(struct conn *conn, struct cw_action_out *a, uint8_t * dst);
+/*int cw_out_radio_generic(struct conn *conn, struct cw_action_out *a, uint8_t * dst);*/
+
int cw_put_elem_session_id(uint8_t *dst, uint8_t *session_id, int len);
int cw_result_is_ok( int rc );
diff --git a/src/cw/cw_80211.h b/src/cw/cw_80211.h
index eab264b8..9a223afb 100644
--- a/src/cw/cw_80211.h
+++ b/src/cw/cw_80211.h
@@ -1,12 +1,12 @@
#ifndef __CW_80211_H
#define __CW_80211_H
-
+/*
int cw_in_80211_mac_operation(struct conn *conn, struct cw_action_in *a, uint8_t * data,
int len, struct sockaddr *from);
int cw_read_80211_mac_operation(uint8_t *data,mbag_t r);
-
+*/
#endif
diff --git a/src/cw/cw_addelem_capwap_local_ip_addr.c b/src/cw/cw_addelem_capwap_local_ip_addr.c
index ec6c2b41..381d7df0 100644
--- a/src/cw/cw_addelem_capwap_local_ip_addr.c
+++ b/src/cw/cw_addelem_capwap_local_ip_addr.c
@@ -23,7 +23,7 @@
#include
-#include "mbag.h"
+
#include "capwap.h"
#include "cwmsg.h"
#include "conn.h"
diff --git a/src/cw/cw_in_80211_mac_operation.c b/src/cw/cw_in_80211_mac_operation.c
index 0867750b..ade7e83b 100644
--- a/src/cw/cw_in_80211_mac_operation.c
+++ b/src/cw/cw_in_80211_mac_operation.c
@@ -1,8 +1,8 @@
#include "cw.h"
-#include "capwap80211_items.h"
#include "dbg.h"
#include "cw_80211.h"
+/*
int cw_in_80211_mac_operation(struct conn *conn, struct cw_action_in *a, uint8_t * data,
int len, struct sockaddr *from)
{
@@ -15,3 +15,4 @@ int cw_in_80211_mac_operation(struct conn *conn, struct cw_action_in *a, uint8_t
return cw_read_80211_mac_operation(data+2,r);
}
+*/
\ No newline at end of file
diff --git a/src/cw/cw_in_ac_descriptor.c b/src/cw/cw_in_ac_descriptor.c
index 4a3559a6..95e6cabc 100644
--- a/src/cw/cw_in_ac_descriptor.c
+++ b/src/cw/cw_in_ac_descriptor.c
@@ -1,9 +1,9 @@
#include "cw.h"
-#include "capwap_items.h"
+
#include "dbg.h"
-#include "mbag.h"
+/*
int cw_in_ac_descriptor(struct conn *conn, struct cw_action_in *a, uint8_t * data,
int len, struct sockaddr *from)
{
@@ -40,3 +40,4 @@ int cw_in_ac_descriptor(struct conn *conn, struct cw_action_in *a, uint8_t * dat
return 1;
}
+*/
diff --git a/src/cw/cw_in_ac_name_with_priority.c b/src/cw/cw_in_ac_name_with_priority.c
index 3f4700f8..c9cc185c 100644
--- a/src/cw/cw_in_ac_name_with_priority.c
+++ b/src/cw/cw_in_ac_name_with_priority.c
@@ -1,20 +1,20 @@
-#include "mbag.h"
-#include "action.h"
+
+
#include "dbg.h"
#include "log.h"
-#include "mbag.h"
+
#include "cw.h"
#include "acpriolist.h"
-#include "capwap_items.h"
+/*
int cw_in_ac_name_with_priority(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
struct sockaddr *from)
{
-/*
+
cw_acpriolist_t prios = mbag_get_mavl(conn->config,CW_ITEM_AC_NAME_WITH_PRIORITY);
if (!prios)
return 0;
@@ -26,7 +26,7 @@ int cw_in_ac_name_with_priority(struct conn *conn, struct cw_action_in *a, uint8
prio->prio=cw_get_byte(data);
prio->name=strndup((char*)data+1,len-1);
mavl_replace(prios,prio,NULL);
-*/
+
return 1;
}
-
+*/
diff --git a/src/cw/cw_in_capwap_control_ip_address.c b/src/cw/cw_in_capwap_control_ip_address.c
index 6b69b7d4..42021d68 100644
--- a/src/cw/cw_in_capwap_control_ip_address.c
+++ b/src/cw/cw_in_capwap_control_ip_address.c
@@ -29,12 +29,12 @@
#include
-#include "mbag.h"
-#include "action.h"
+
+
#include "log.h"
-#include "mbag.h"
+
#include "cw.h"
-#include "capwap_items.h"
+
#include "aciplist.h"
#include "sock.h"
diff --git a/src/cw/cw_in_capwap_local_ipv4_address.c b/src/cw/cw_in_capwap_local_ipv4_address.c
index 024de215..6282a87c 100644
--- a/src/cw/cw_in_capwap_local_ipv4_address.c
+++ b/src/cw/cw_in_capwap_local_ipv4_address.c
@@ -6,10 +6,10 @@
#include "cw.h"
-#include "capwap_items.h"
-#include "mbag.h"
+
+/*
int cw_in_capwap_local_ipv4_address(struct conn *conn, struct cw_action_in *a,
uint8_t * data, int len,struct sockaddr *from)
{
@@ -23,4 +23,4 @@ int cw_in_capwap_local_ipv4_address(struct conn *conn, struct cw_action_in *a,
return 1;
}
-
+*/
diff --git a/src/cw/cw_in_capwap_local_ipv6_address.c b/src/cw/cw_in_capwap_local_ipv6_address.c
index 284302a7..0698e448 100644
--- a/src/cw/cw_in_capwap_local_ipv6_address.c
+++ b/src/cw/cw_in_capwap_local_ipv6_address.c
@@ -6,8 +6,8 @@
#include
#include "cw.h"
-#include "capwap_items.h"
-#include "mbag.h"
+
+
int cw_in_capwap_local_ipv6_address(struct conn *conn, struct cw_action_in *a,
uint8_t * data, int len,struct sockaddr *from)
@@ -16,8 +16,9 @@ int cw_in_capwap_local_ipv6_address(struct conn *conn, struct cw_action_in *a,
memcpy(&addr.sin6_addr,data,4);
addr.sin6_family=AF_INET6;
+/*
mbag_set_sockaddr(conn->incomming,CW_ITEM_CAPWAP_LOCAL_IP_ADDRESS,(struct sockaddr*)&addr);
-
+*/
return 1;
}
diff --git a/src/cw/cw_in_check_cfg_update_req.c b/src/cw/cw_in_check_cfg_update_req.c
index 55471aed..9ba6b703 100644
--- a/src/cw/cw_in_check_cfg_update_req.c
+++ b/src/cw/cw_in_check_cfg_update_req.c
@@ -1,16 +1,16 @@
-#include "mbag.h"
+
#include "capwap.h"
#include "intavltree.h"
#include "dbg.h"
#include "log.h"
-#include "capwap_items.h"
+
int cw_in_check_cfg_update_req(struct conn *conn, struct cw_action_in *a, uint8_t * data,
int len,struct sockaddr *from)
{
- cw_action_in_t * mlist[60];
+ /*cw_action_in_t * mlist[60];*/
/* Check for mandatory elements */
/* int n = cw_check_missing_mand(mlist,conn,a);
@@ -25,7 +25,7 @@ int cw_in_check_cfg_update_req(struct conn *conn, struct cw_action_in *a, uint8_
*/
/* set result code to ok and change to configure state */
- mbag_set_dword(conn->outgoing,CW_ITEM_RESULT_CODE,0);
+ /*mbag_set_dword(conn->outgoing,CW_ITEM_RESULT_CODE,0);*/
return 0;
diff --git a/src/cw/cw_in_check_chng_state_evnt_req.c b/src/cw/cw_in_check_chng_state_evnt_req.c
deleted file mode 100644
index 33b29b33..00000000
--- a/src/cw/cw_in_check_chng_state_evnt_req.c
+++ /dev/null
@@ -1,16 +0,0 @@
-
-#include "mbag.h"
-#include "capwap.h"
-#include "capwap_items.h"
-#include "cw.h"
-
-int cw_in_check_chng_state_evnt_req(struct conn *conn, struct cw_action_in *a, uint8_t * data,
- int len,struct sockaddr *from)
-{
- conn->capwap_state = CW_STATE_NONE;
- int rc = cw_in_check_generic_req(conn,a,data,len,from);
- if (rc==0)
- conn->capwap_state = CW_STATE_RUN;
- return rc;
-
-}
diff --git a/src/cw/cw_in_check_cipwap_join_req.c b/src/cw/cw_in_check_cipwap_join_req.c
index 857aee5c..5e187f88 100644
--- a/src/cw/cw_in_check_cipwap_join_req.c
+++ b/src/cw/cw_in_check_cipwap_join_req.c
@@ -3,7 +3,7 @@
#include "intavltree.h"
#include "dbg.h"
#include "log.h"
-#include "capwap_items.h"
+
#include "bstr.h"
#include "sock.h" //tube
diff --git a/src/cw/cw_in_check_disc_req.c b/src/cw/cw_in_check_disc_req.c
index 6d25f376..b467a1f8 100644
--- a/src/cw/cw_in_check_disc_req.c
+++ b/src/cw/cw_in_check_disc_req.c
@@ -1,6 +1,6 @@
#include "capwap.h"
-#include "capwap_items.h"
+
#include "intavltree.h"
#include "log.h"
diff --git a/src/cw/cw_in_check_disc_resp.c b/src/cw/cw_in_check_disc_resp.c
index be80d4af..5a90cf80 100644
--- a/src/cw/cw_in_check_disc_resp.c
+++ b/src/cw/cw_in_check_disc_resp.c
@@ -1,8 +1,8 @@
#include
-#include "mbag.h"
+
#include "capwap.h"
-#include "capwap_items.h"
+
#include "intavltree.h"
#include "log.h"
#include "dbg.h"
diff --git a/src/cw/cw_in_check_generic_req.c b/src/cw/cw_in_check_generic_req.c
deleted file mode 100644
index 7b107c2f..00000000
--- a/src/cw/cw_in_check_generic_req.c
+++ /dev/null
@@ -1,27 +0,0 @@
-
-#include
-
-#include "capwap.h"
-#include "intavltree.h"
-#include "dbg.h"
-#include "log.h"
-#include "capwap_items.h"
-
-int cw_in_check_generic_req(struct conn *conn, struct cw_action_in *a, uint8_t * data,
- int len,struct sockaddr *from)
-{
- cw_action_in_t * mlist[60];
-
- /* Check for mandatory elements */
-/* int n = cw_check_missing_mand(mlist,conn,a);
- if (n) {
- if ( conn->strict_capwap ){
- cw_dbg_missing_mand(DBG_MSG_ERR,conn,mlist,n,a);
- return CW_RESULT_MISSING_MAND_ELEM;
- }
- cw_dbg_missing_mand(DBG_RFC,conn,mlist,n,a);
- }
-*/
- return 0;
-
-}
diff --git a/src/cw/cw_in_check_generic_resp.c b/src/cw/cw_in_check_generic_resp.c
index c495e318..7464671b 100644
--- a/src/cw/cw_in_check_generic_resp.c
+++ b/src/cw/cw_in_check_generic_resp.c
@@ -5,7 +5,7 @@
#include "intavltree.h"
#include "dbg.h"
#include "log.h"
-#include "capwap_items.h"
+
int cw_in_check_generic_resp(struct conn *conn, struct cw_action_in *a, uint8_t * data,
int len,struct sockaddr *from)
diff --git a/src/cw/cw_in_check_img_data_req_ac.c b/src/cw/cw_in_check_img_data_req_ac.c
index d181fd7c..2e92ceee 100644
--- a/src/cw/cw_in_check_img_data_req_ac.c
+++ b/src/cw/cw_in_check_img_data_req_ac.c
@@ -1,11 +1,11 @@
#include
#include
-#include "mbag.h"
+
#include "capwap.h"
#include "dbg.h"
#include "log.h"
-#include "capwap_items.h"
+
int cw_in_check_img_data_req_ac(struct conn *conn, struct cw_action_in *a, uint8_t * data,
diff --git a/src/cw/cw_in_check_img_data_req_wtp.c b/src/cw/cw_in_check_img_data_req_wtp.c
index fe717985..8855920c 100644
--- a/src/cw/cw_in_check_img_data_req_wtp.c
+++ b/src/cw/cw_in_check_img_data_req_wtp.c
@@ -4,10 +4,10 @@
#include "capwap.h"
#include "dbg.h"
#include "log.h"
-#include "capwap_items.h"
-#include //Tube
+#include
+/*
int cw_in_check_img_data_req_wtp(struct conn *conn, struct cw_action_in *a, uint8_t * data,
int len,struct sockaddr *from)
{
@@ -20,7 +20,7 @@ int cw_in_check_img_data_req_wtp(struct conn *conn, struct cw_action_in *a, uint
return CAPWAP_RESULT_IMAGE_DATA_ERROR;
return 0;
-
+*/
/* Check for mandatory elements */
/* cw_action_in_t * mlist[60];
int n = cw_check_missing_mand(mlist,conn,a);
@@ -63,4 +63,6 @@ int cw_in_check_img_data_req_wtp(struct conn *conn, struct cw_action_in *a, uint
return CAPWAP_RESULT_IMAGE_DATA_ERROR;
*/
+/*
}
+ */
diff --git a/src/cw/cw_in_check_img_data_resp.c b/src/cw/cw_in_check_img_data_resp.c
deleted file mode 100644
index 4af2c5eb..00000000
--- a/src/cw/cw_in_check_img_data_resp.c
+++ /dev/null
@@ -1,35 +0,0 @@
-#include
-#include
-
-#include "mbag.h"
-#include "capwap.h"
-#include "dbg.h"
-#include "log.h"
-#include "capwap_items.h"
-
-
-int cw_in_check_img_data_resp(struct conn *conn, struct cw_action_in *a, uint8_t * data,
- int len, struct sockaddr *from)
-{
- cw_action_in_t * mlist[60];
-
- /* Check for mandatory elements */
-/* int n = cw_check_missing_mand(mlist,conn,a);
- if (n) {
- cw_dbg_missing_mand(DBG_ELEM,conn,mlist,n,a);
- conn->capwap_state=CAPWAP_STATE_JOIN;
- errno=EAGAIN;
- return -1; //CW_RESULT_MISSING_MAND_ELEM;
- }
-
-
-
- mbag_item_t * iresult = mbag_get(conn->incomming, CW_ITEM_RESULT_CODE);
-
- if ( iresult ) {
- return iresult->u2.dword;
- }
-*/
- return 0;
-
-}
diff --git a/src/cw/cw_in_check_join_req.c b/src/cw/cw_in_check_join_req.c
index d54269c1..84026082 100644
--- a/src/cw/cw_in_check_join_req.c
+++ b/src/cw/cw_in_check_join_req.c
@@ -3,7 +3,7 @@
#include "intavltree.h"
#include "dbg.h"
#include "log.h"
-#include "capwap_items.h"
+
#include "format.h"
#include "connlist.h"
diff --git a/src/cw/cw_in_check_join_resp.c b/src/cw/cw_in_check_join_resp.c
index e39804e7..b303c48a 100644
--- a/src/cw/cw_in_check_join_resp.c
+++ b/src/cw/cw_in_check_join_resp.c
@@ -5,7 +5,7 @@
#include "intavltree.h"
#include "dbg.h"
#include "log.h"
-#include "capwap_items.h"
+
int cw_in_check_join_resp(struct conn *conn, struct cw_action_in *a, uint8_t * data,
int len,struct sockaddr *from)
diff --git a/src/cw/cw_in_cisco_image_identifier.c b/src/cw/cw_in_cisco_image_identifier.c
index 7145454c..f5db467f 100644
--- a/src/cw/cw_in_cisco_image_identifier.c
+++ b/src/cw/cw_in_cisco_image_identifier.c
@@ -1,11 +1,11 @@
-#include "mbag.h"
-#include "action.h"
+
+
#include "dbg.h"
-#include "mbag.h"
+
#include "capwap.h"
#include "capwap_cisco.h"
-
+/*
int cw_in_cisco_image_identifier(struct conn *conn,struct cw_action_in * a,uint8_t *data,int len,struct sockaddr *from)
{
@@ -35,3 +35,4 @@ int cw_in_cisco_image_identifier(struct conn *conn,struct cw_action_in * a,uint8
return 1;
}
+*/
\ No newline at end of file
diff --git a/src/cw/cw_in_radio_administrative_state.c b/src/cw/cw_in_radio_administrative_state.c
index 91708253..af051330 100644
--- a/src/cw/cw_in_radio_administrative_state.c
+++ b/src/cw/cw_in_radio_administrative_state.c
@@ -1,9 +1,9 @@
-#include "mbag.h"
-#include "action.h"
+
+
#include "dbg.h"
#include "log.h"
-#include "mbag.h"
+
#include "cw.h"
#include "radio.h"
@@ -12,9 +12,10 @@
int cw_in_radio_administrative_state(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
struct sockaddr *from)
{
- int rid = cw_get_byte(data);
+/* int rid = cw_get_byte(data);
int state = cw_get_byte(data+1);
return cw_radio_set_admin_state(conn->radios,rid,state,-1);
+*/
}
diff --git a/src/cw/cw_in_radio_administrative_state_wtp.c b/src/cw/cw_in_radio_administrative_state_wtp.c
index aab3178a..545b6f8b 100644
--- a/src/cw/cw_in_radio_administrative_state_wtp.c
+++ b/src/cw/cw_in_radio_administrative_state_wtp.c
@@ -1,9 +1,9 @@
-#include "mbag.h"
-#include "action.h"
+
+
#include "dbg.h"
#include "log.h"
-#include "mbag.h"
+
#include "capwap.h"
#include "radio.h"
diff --git a/src/cw/cw_in_radio_generic.c b/src/cw/cw_in_radio_generic.c
index 84a98054..76a84fe5 100644
--- a/src/cw/cw_in_radio_generic.c
+++ b/src/cw/cw_in_radio_generic.c
@@ -1,16 +1,16 @@
-#include "mbag.h"
-#include "action.h"
+
+
#include "dbg.h"
#include "log.h"
-#include "mbag.h"
+
#include "cw.h"
-#include "item.h"
+/*
int cw_in_radio_generic(struct conn *conn, struct cw_action_in *a, uint8_t * data,
int len, struct sockaddr *from)
{
@@ -48,5 +48,5 @@ int cw_in_radio_generic(struct conn *conn, struct cw_action_in *a, uint8_t * dat
}
-
+*/
diff --git a/src/cw/cw_in_wtp_board_data.c b/src/cw/cw_in_wtp_board_data.c
index 301c4fbb..70293536 100644
--- a/src/cw/cw_in_wtp_board_data.c
+++ b/src/cw/cw_in_wtp_board_data.c
@@ -23,15 +23,15 @@
#include "cw.h"
-#include "capwap_items.h"
-#include "mbag.h"
+
+
#include "cw_util.h"
#include "dbg.h"
-
+/*
static void readsubelems_wtp_board_data(mbag_t itemstore, uint8_t * msgelem,
int len)
{
@@ -94,10 +94,14 @@ static void readsubelems_wtp_board_data(mbag_t itemstore, uint8_t * msgelem,
} while (i < len);
}
+*/
/**
* Parse a WTP Board Data messag element and put results to itemstore.
*/
+
+
+ /*
int cw_in_wtp_board_data(struct conn *conn, struct cw_action_in *a, uint8_t * data,
int len, struct sockaddr *from)
{
@@ -116,3 +120,4 @@ int cw_in_wtp_board_data(struct conn *conn, struct cw_action_in *a, uint8_t * da
return 1;
}
+*/
\ No newline at end of file
diff --git a/src/cw/cw_in_wtp_reboot_statistics.c b/src/cw/cw_in_wtp_reboot_statistics.c
index b5b2461d..30a9ce83 100644
--- a/src/cw/cw_in_wtp_reboot_statistics.c
+++ b/src/cw/cw_in_wtp_reboot_statistics.c
@@ -19,16 +19,18 @@
#include "cw.h"
#include "log.h"
-#include "capwap_items.h"
+
int cw_in_wtp_reboot_statistics(struct conn *conn, struct cw_action_in *a, uint8_t * data,
int len, struct sockaddr *from)
{
+ /*
mbag_t rs = mbag_create();
if (!rs) {
cw_log(LOG_ERR,"Can't create REBOOT_STATISITCS");
return 0;
}
+*/
/*
This file is part of libcapwap.
@@ -49,7 +51,7 @@ int cw_in_wtp_reboot_statistics(struct conn *conn, struct cw_action_in *a, uint8
*/
-
+/*
mbag_set_word( rs, CW_ITEM_REBOOT_COUNT,cw_get_word(data+0) );
mbag_set_word( rs, CW_ITEM_REBOOT_AC_INITIATED_COUNT,cw_get_word(data+2) );
mbag_set_word( rs, CW_ITEM_REBOOT_LINK_FAILURE_COUNT,cw_get_word(data+2) );
@@ -61,6 +63,7 @@ int cw_in_wtp_reboot_statistics(struct conn *conn, struct cw_action_in *a, uint8
mbag_set_mbag(conn->incomming,CW_ITEM_WTP_REBOOT_STATISTICS,rs);
+*/
return 1;
diff --git a/src/cw/cw_out_80211_supported_rates.c b/src/cw/cw_out_80211_supported_rates.c
index 7f871e13..df023ad2 100644
--- a/src/cw/cw_out_80211_supported_rates.c
+++ b/src/cw/cw_out_80211_supported_rates.c
@@ -2,7 +2,7 @@
#include "capwap80211.h"
#include "radio.h"
-
+/*
int cw_put_elem_80211_supported_rates(uint8_t*dst,int radio_id,mbag_t radio)
{
@@ -33,3 +33,4 @@ int cw_out_80211_supported_rates(struct conn *conn, struct cw_action_out *a, uin
}
+*/
\ No newline at end of file
diff --git a/src/cw/cw_out_ac_name_with_priority.c b/src/cw/cw_out_ac_name_with_priority.c
index b14611f3..416cfb30 100644
--- a/src/cw/cw_out_ac_name_with_priority.c
+++ b/src/cw/cw_out_ac_name_with_priority.c
@@ -1,7 +1,7 @@
#include "cw.h"
-#include "capwap_items.h"
+
#include "dbg.h"
#include "log.h"
diff --git a/src/cw/cw_out_capwap_control_ip_addr_list.c b/src/cw/cw_out_capwap_control_ip_addr_list.c
index 06a79fb5..12388ab0 100644
--- a/src/cw/cw_out_capwap_control_ip_addr_list.c
+++ b/src/cw/cw_out_capwap_control_ip_addr_list.c
@@ -45,7 +45,7 @@ static int put_ip(uint8_t *dst /*void *priv*/, cw_acip_t * acip /*void *data*/)
// return 1;
}
-
+/*
int cw_out_capwap_control_ip_addr_list(struct conn *conn,struct cw_action_out *a,uint8_t *dst)
{
struct mbag_item * item = mbag_get(conn->local,a->item_id);
@@ -76,3 +76,4 @@ int cw_out_capwap_control_ip_addr_list(struct conn *conn,struct cw_action_out *a
return d-dst;
}
+*/
\ No newline at end of file
diff --git a/src/cw/cw_out_capwap_local_ip_address.c b/src/cw/cw_out_capwap_local_ip_address.c
index 3a29cf70..e4c5c783 100644
--- a/src/cw/cw_out_capwap_local_ip_address.c
+++ b/src/cw/cw_out_capwap_local_ip_address.c
@@ -28,7 +28,7 @@
#include
#include "cw.h"
-#include "capwap_items.h"
+
#include "dbg.h"
#include "log.h"
@@ -46,9 +46,12 @@
* It can deal both with IPv4 and IPv6 sockets.
*
*/
+
+ /*
int cw_out_capwap_local_ip_address(struct conn *conn, struct cw_action_out *action,
uint8_t * dst)
{
return cw_put_local_ip_address(conn->sock,dst,CW_ELEM_CAPWAP_LOCAL_IPV4_ADDRESS,CW_ELEM_CAPWAP_LOCAL_IPV6_ADDRESS);
}
+*/
\ No newline at end of file
diff --git a/src/cw/cw_out_generic.c b/src/cw/cw_out_generic.c
index 73a7e83d..a9a0965a 100644
--- a/src/cw/cw_out_generic.c
+++ b/src/cw/cw_out_generic.c
@@ -1,6 +1,6 @@
#include "cw.h"
-#include "capwap_items.h"
+
#include "dbg.h"
#include "log.h"
diff --git a/src/cw/cw_out_image_data.c b/src/cw/cw_out_image_data.c
index d998813b..d81a4fe3 100644
--- a/src/cw/cw_out_image_data.c
+++ b/src/cw/cw_out_image_data.c
@@ -2,7 +2,7 @@
#include
#include "cw.h"
-#include "capwap_items.h"
+
#include "log.h"
#include "dbg.h"
diff --git a/src/cw/cw_out_radio_administrative_states.c b/src/cw/cw_out_radio_administrative_states.c
index 92f150be..31c8a535 100644
--- a/src/cw/cw_out_radio_administrative_states.c
+++ b/src/cw/cw_out_radio_administrative_states.c
@@ -1,7 +1,7 @@
#include "cw.h"
#include "dbg.h"
-
+/*
int cw_out_radio_administrative_states(struct conn *conn, struct cw_action_out *a, uint8_t * dst)
{
cw_dbg(DBG_X,"Radio admin updater");
@@ -21,4 +21,4 @@ int cw_out_radio_administrative_states(struct conn *conn, struct cw_action_out *
return l;
}
-
+*/
diff --git a/src/cw/cw_out_radio_generic.c b/src/cw/cw_out_radio_generic.c
index c3c1735d..d06b39cb 100644
--- a/src/cw/cw_out_radio_generic.c
+++ b/src/cw/cw_out_radio_generic.c
@@ -1,11 +1,10 @@
-#include "mbag.h"
-#include "action.h"
+/*
+
#include "cw.h"
#include "cw/dbg.h"
-
int cw_out_radio_generic(struct conn *conn, struct cw_action_out *a, uint8_t * dst)
{
cw_dbg(DBG_X,"Radio Generic out %s",a->item_id);
@@ -18,8 +17,8 @@ cw_dbg(DBG_X,"Radio Generic out %s",a->item_id);
continue;
}
- /* Size for msg elem header depends on
- vendor specific payload */
+ // Size for msg elem header depends on
+ // vendor specific payload
int start = a->vendor_id ? 10 : 4;
uint8_t * d = dst+l;
@@ -48,3 +47,4 @@ cw_dbg(DBG_X,"Not found! %s for rid %d",a->item_id,radio->u1.iid);
return l;
}
+*/
\ No newline at end of file
diff --git a/src/cw/cw_out_radio_info.c b/src/cw/cw_out_radio_info.c
index 71a72570..729d93c7 100644
--- a/src/cw/cw_out_radio_info.c
+++ b/src/cw/cw_out_radio_info.c
@@ -1,18 +1,15 @@
#include "cw.h"
-#include "capwap_items.h"
-#include "capwap80211.h"
-#include "capwap80211_items.h"
+
#include "radio.h"
#include "dbg.h"
#include "log.h"
-#include "mbag.h"
-
+/*
int cw_put_elem_radio_info(uint8_t*dst,int radio_id,mbag_t radio)
{
cw_put_byte(dst+4,radio_id);
@@ -36,9 +33,10 @@ int cw_out_radio_infos(struct conn *conn, struct cw_action_out *a, uint8_t * dst
}
return l;
+
}
-
+*/
diff --git a/src/cw/cw_out_wtp_descriptor.c b/src/cw/cw_out_wtp_descriptor.c
index b60f4983..222a810a 100644
--- a/src/cw/cw_out_wtp_descriptor.c
+++ b/src/cw/cw_out_wtp_descriptor.c
@@ -3,11 +3,12 @@
#include "conn.h"
#include "capwap.h"
//#include "itemstore.h"
-#include "capwap_items.h"
+
#include "capwap.h"
#include "cw.h"
+#define CW_MODE_CISCO 1
static int cw_put_encryption_subelems(uint8_t *dst,int capwap_mode)
{
diff --git a/src/cw/cw_out_wtp_ip_address.c b/src/cw/cw_out_wtp_ip_address.c
index a14eac9d..220b9a7d 100644
--- a/src/cw/cw_out_wtp_ip_address.c
+++ b/src/cw/cw_out_wtp_ip_address.c
@@ -28,7 +28,7 @@
#include
#include "cw.h"
-#include "capwap_items.h"
+
#include "dbg.h"
#include "log.h"
@@ -46,8 +46,11 @@
* It can deal both with IPv4 and IPv6 sockets.
*
*/
+
+ /*
int cw_out_wtp_ip_address(struct conn *conn, struct cw_action_out *action,
uint8_t * dst)
{
return cw_put_local_ip_address(conn->sock,dst,CAPWAP_ELEM_WTP_IPV4_IP_ADDRESS,CAPWAP_ELEM_WTP_IPV6_IP_ADDRESS);
}
+*/
\ No newline at end of file
diff --git a/src/cw/cw_out_wtp_reboot_statistics.c b/src/cw/cw_out_wtp_reboot_statistics.c
index 186ca879..0e1673b9 100644
--- a/src/cw/cw_out_wtp_reboot_statistics.c
+++ b/src/cw/cw_out_wtp_reboot_statistics.c
@@ -18,13 +18,13 @@
#include "log.h"
-#include "mbag.h"
-#include "capwap_items.h"
-#include "action.h"
+
+
+
#include "cw.h"
-
+/*
int cw_out_wtp_reboot_statistics(struct conn *conn, struct cw_action_out *a,
uint8_t * dst)
{
@@ -62,3 +62,4 @@ int cw_out_wtp_reboot_statistics(struct conn *conn, struct cw_action_out *a,
int l = d - dst - 4;
return l + cw_put_elem_hdr(dst, a->elem_id, l);
}
+*/
\ No newline at end of file
diff --git a/src/cw/cw_put_elem_radio_administrative_state.c b/src/cw/cw_put_elem_radio_administrative_state.c
index a263a992..c5d67291 100644
--- a/src/cw/cw_put_elem_radio_administrative_state.c
+++ b/src/cw/cw_put_elem_radio_administrative_state.c
@@ -1,11 +1,11 @@
#include "cw.h"
-#include "capwap_items.h"
+/*
int xcw_put_elem_radio_administrative_state(uint8_t *dst,int radio_id,mbag_t radio)
{
cw_put_byte(dst+4,radio_id);
cw_put_byte(dst+5,mbag_get_byte(radio,CW_RADIOITEM_ADMIN_STATE,CW_RADIO_ADMIN_STATE_DISABLED));
return 2 + cw_put_elem_hdr(dst,CW_ELEM_RADIO_ADMINISTRATIVE_STATE,2);
}
-
+*/
diff --git a/src/cw/cw_put_local_ip_address.c b/src/cw/cw_put_local_ip_address.c
index 574c9198..471db6ee 100644
--- a/src/cw/cw_put_local_ip_address.c
+++ b/src/cw/cw_put_local_ip_address.c
@@ -3,7 +3,6 @@
#include
#include
-#include "mbag.h"
#include "log.h"
#include "dbg.h"
#include "cw.h"
diff --git a/src/cw/cw_put_mbag_item.c b/src/cw/cw_put_mbag_item.c
deleted file mode 100644
index a1baa55f..00000000
--- a/src/cw/cw_put_mbag_item.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- This file is part of actube.
-
- actube 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 .
-
-*/
-
-/**
- * @file
- */
-
-#include "cw.h"
-#include "log.h"
-#include "dbg.h"
-
-#include "ktv.h"
-
-int cw_put_mbag_item(uint8_t * dst, struct mbag_item *item)
-{
- cw_KTV_t ktv;
- ktv.type->put(&ktv,dst);
-/*
- if (item->type->put){
- cw_dbg(DBG_X,"User put method to put ");
- return item->type->put(item,dst);
- }
-
-
- if (MBAG_STR == item->type ){
- return cw_put_data(dst, item->u2.data, strlen((char *) item->u2.data));
- }
-
- if (MBAG_DATA == item->type){
- return cw_put_data(dst, item->u2.data+1, *((uint8_t*)item->u2.data));
- }
-
- if (MBAG_BYTE == item->type){
- return cw_put_byte(dst, item->u2.byte);
- }
- if (MBAG_WORD == item->type){
- return cw_put_word(dst, item->u2.word);
- }
- if (MTYPE_DWORD == item->type){
- return cw_put_dword(dst, item->u2.dword);
- }
- if (MBAG_BSTR == item->type) {
- return cw_put_bstr(dst, item->u2.data);
- }
-
- if ( MBAG_BSTR16 == item->type)
- return cw_put_bstr16(dst,item->u2.data);
-
- if (MBAG_VENDORSTR == item->type)
- {
- int l=0;
- l+=cw_put_dword(dst, bstrv_get_vendor_id(item->u2.data));
- l+=cw_put_data(dst+4, bstrv_data(item->u2.data),bstrv_len(item->u2.data));
- return l;
- }
-
-
- if (MBAG_MBAG == item->type){
- *((void**)dst)=item->u2.data;
- return sizeof(void *);
- }
-
- cw_log(LOG_ERR,"No method to put items of type %s",item->type->name);
-
-*/
- return 0;
-}
-
-
diff --git a/src/cw/cw_put_msg.c b/src/cw/cw_put_msg.c
index 1b550f7c..14694204 100644
--- a/src/cw/cw_put_msg.c
+++ b/src/cw/cw_put_msg.c
@@ -22,7 +22,7 @@
*/
#include "cw.h"
-#include "capwap_items.h"
+
#include "conn.h"
#include "log.h"
@@ -99,105 +99,6 @@ int cw_put_msg(struct conn *conn, uint8_t * rawout)
return len;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- printf("Message to send: %s\n",msg->name);
-
-
- /* create search paramaters */
- cw_action_out_t as;
-
- as.msg_id = cw_get_msg_type(msgptr);
- as.item_id = CW_ITEM_NONE;
- as.vendor_id = 0;
-
- dst = msgptr+8;
-
- printf("Put Message\n");
- exit(0);
-
- //mlist_t m = cw_actionlist_out_get(conn->actions->out,cw_get_msg_type(msgptr));
- mlist_t m =0;
-
- if (!m){
- cw_log(LOG_ERR,"Error: Can't create message of type %d (%s) - no definition found.",
- as.msg_id,cw_strmsg(as.msg_id));
-
- /* invalidate the cache */
- cw_set_msg_type(msgptr,0);
- return -1;
- }
-
-
- struct mlistelem *e;
-
- len = 0;
-
- for (e=m->first; e; e=e->next) {
- int l;
- cw_action_out_t *ae=(cw_action_out_t*)e;
-
- //printf("Put %d %i %s\n",ae->msg_id,ae->elem_id,ae->item_id);
- if ( ae->item_id ) {
- // DBGX("Item ID: %s %p",ae->item_id,CW_ITEM_NONE);
- }
-
- if (ae->msg_id != as.msg_id) {
- /* Element is from next msg, close action */
- break;
- }
- l=0;
- if (ae->out) {
-
- // printf("Out Call with len =%d\n",len);
-
- l= ae->out(conn, ae, dst+len);
-// cw_dbg_elem(DBG_ELEM, conn, ae->msg_id, ae->elem_id, dst+len,l);
-
- // printf("Returned len = %d\n",l);
-
-
- len +=l;
-
- }
-
-
- }
-
-
- cw_set_msg_elems_len(msgptr, len);
-
- if (as.msg_id & 1) {
- /* It's a request, so we have to set seqnum */
- int s = conn_get_next_seqnum(conn);
- cw_set_msg_seqnum(msgptr,s);
- }
-
- return len;
-
}
diff --git a/src/cw/cw_put_radio_operational_states.c b/src/cw/cw_put_radio_operational_states.c
index c4d2321e..04cc563c 100644
--- a/src/cw/cw_put_radio_operational_states.c
+++ b/src/cw/cw_put_radio_operational_states.c
@@ -22,16 +22,16 @@
*/
#include "cw.h"
-#include "capwap_items.h"
+
#include "radio.h"
/**
* Put all radio operational states
*/
-int xxcw_put_radio_operational_states(mbag_t radios, uint8_t * dst, int *nerror, int d7mode)
-{
- uint8_t *d=dst;
+//int xxcw_put_radio_operational_states(struct xaaa * radios, uint8_t * dst, int *nerror, int d7mode)
+//{/
+ //uint8_t *d=dst;
/* Iterate through all radios and send the CW_RADIO_OPER_STATE item if found.
We assume, that any other processes, dealing with setting the
@@ -40,46 +40,46 @@ int xxcw_put_radio_operational_states(mbag_t radios, uint8_t * dst, int *nerror,
// int nerror=0;
- *nerror=0;
+// *nerror=0;
- MAVLITER_DEFINE(it,radios);
- mavliter_foreach(&it){
+// MAVLITER_DEFINE(it,radios);
+// mavliter_foreach(&it){
- mbag_item_t * radioitem = mavliter_get(&it);
- mbag_item_t *ositem = mbag_get(radioitem->u2.data,CW_RADIOITEM_OPER_STATE);
- if (!ositem){
- (*nerror)++;
- continue;
- }
+// mbag_item_t * radioitem = mavliter_get(&it);
+// mbag_item_t *ositem = mbag_get(radioitem->u2.data,CW_RADIOITEM_OPER_STATE);
+ //if (!ositem){
+ // (*nerror)++;
+// continue;//
+// }//
/* Put the radio ID */
- cw_put_byte(d+4,radioitem->u1.iid);
+// cw_put_byte(d+4,radioitem->u1.iid);
/* Get the operational state and cause */
- uint16_t os = ositem->u2.word;
+// uint16_t os = ositem->u2.word;
- if ( d7mode ){
- /* Isolate Oper Sate from cause */
- uint8_t o=os>>8;
+// if ( d7mode ){//
+ // Isolate Oper Sate from cause
+// uint8_t o=os>>8;
- /* Invert oper state for Cisco, if oper state is 2 or 1 */
- if (o!=0 && o<=2) {
- /* 2 becomes 1 and 1 becomes 2 */
- os = (os & 0x00ff ) | ((3-o)<<8);
- }
- }
+// /* Invert oper state for Cisco, if oper state is 2 or 1 */
+// if (o!=0 && o<=2) {
+// /* 2 becomes 1 and 1 becomes 2 */
+// os = (os & 0x00ff ) | ((3-o)<<8);
+// }
+// }
- /* Put oper state */
- cw_put_word(d+5,os);
- d+=3+cw_put_elem_hdr(d,CW_ELEM_RADIO_OPERATIONAL_STATE,3);
+// /* Put oper state */
+// cw_put_word(d+5,os);
+// d+=3+cw_put_elem_hdr(d,CW_ELEM_RADIO_OPERATIONAL_STATE,3);
/* delete the operational state item, so it won't be
sent again, until it is set by a change through
Set Radio Admin State */
- mbag_del(radioitem->u2.data,CW_RADIOITEM_OPER_STATE);
+// mbag_del(radioitem->u2.data,CW_RADIOITEM_OPER_STATE);
- }
+// }
/* if (nerror) {
@@ -90,7 +90,7 @@ int xxcw_put_radio_operational_states(mbag_t radios, uint8_t * dst, int *nerror,
}
}
*/
- return d-dst;
-}
+// return d-dst;
+//}
diff --git a/src/cw/cw_radio_set_admin_state.c b/src/cw/cw_radio_set_admin_state.c
index b20f2aed..6635c9ee 100644
--- a/src/cw/cw_radio_set_admin_state.c
+++ b/src/cw/cw_radio_set_admin_state.c
@@ -1,10 +1,10 @@
#include "cw.h"
#include "dbg.h"
-#include "capwap_items.h"
+/*
int cw_radio_set_admin_state(mbag_t radios,int rid, int state, int cause)
{
mbag_t radio = mbag_i_get_mbag(radios,rid,NULL);
@@ -18,11 +18,12 @@ int cw_radio_set_admin_state(mbag_t radios,int rid, int state, int cause)
return 1;
- /* Set operational state for next config update response. */
+ // Set operational state for next config update response.
mbag_set_word(radio,CW_RADIOITEM_OPER_STATE, (state<<8) | 3);
return 1;
}
+ */
diff --git a/src/cw/cw_read_80211_mac_operation.c b/src/cw/cw_read_80211_mac_operation.c
index 01900488..2774d4b4 100644
--- a/src/cw/cw_read_80211_mac_operation.c
+++ b/src/cw/cw_read_80211_mac_operation.c
@@ -1,7 +1,8 @@
#include "cw.h"
-#include "capwap80211_items.h"
+
#include "dbg.h"
+/*
int cw_read_80211_mac_operation(uint8_t *data,mbag_t r)
{
mbag_set_word( r, CW_RADIOITEM80211_RTS_THRESHOLD,cw_get_word(data) );
@@ -12,3 +13,4 @@ int cw_read_80211_mac_operation(uint8_t *data,mbag_t r)
mbag_set_dword( r, CW_RADIOITEM80211_RX_MSDU_LIFETIME,cw_get_dword(data+10) );
return 1;
}
+*/
\ No newline at end of file
diff --git a/src/cw/cw_read_ac_descriptor.c b/src/cw/cw_read_ac_descriptor.c
index 6ebfc71c..ee4620be 100644
--- a/src/cw/cw_read_ac_descriptor.c
+++ b/src/cw/cw_read_ac_descriptor.c
@@ -1,8 +1,8 @@
#include "cw.h"
-#include "capwap_items.h"
-#include "dbg.h"
-#include "mbag.h"
+#include "dbg.h"
+
+/*
int cw_read_ac_descriptor(mbag_t store, uint8_t *data, int len,
struct cw_DescriptorSubelemDef *allowed)
{
@@ -38,4 +38,4 @@ int cw_read_ac_descriptor(mbag_t store, uint8_t *data, int len,
}
-
+*/
diff --git a/src/cw/cw_read_wtp_descriptor.c b/src/cw/cw_read_wtp_descriptor.c
index b2a70c5c..1a5ebb41 100644
--- a/src/cw/cw_read_wtp_descriptor.c
+++ b/src/cw/cw_read_wtp_descriptor.c
@@ -1,7 +1,7 @@
#include "cw.h"
#include "capwap.h"
-#include "capwap_items.h"
+
#include "dbg.h"
#include "ktv.h"
#include "keys.h"
diff --git a/src/cw/cw_read_wtp_descriptor_7.c b/src/cw/cw_read_wtp_descriptor_7.c
index e2e130f1..09cdc6f7 100644
--- a/src/cw/cw_read_wtp_descriptor_7.c
+++ b/src/cw/cw_read_wtp_descriptor_7.c
@@ -1,7 +1,7 @@
#include "cw.h"
#include "capwap.h"
-#include "capwap_items.h"
+
#include "ktv.h"
#include "keys.h"
diff --git a/src/cw/cw_read_wtp_descriptor_versions.c b/src/cw/cw_read_wtp_descriptor_versions.c
index 6d61e2c0..09c6d531 100644
--- a/src/cw/cw_read_wtp_descriptor_versions.c
+++ b/src/cw/cw_read_wtp_descriptor_versions.c
@@ -2,7 +2,8 @@
#include "capwap.h"
#include "log.h"
#include "dbg.h"
-#include "capwap_items.h"
+
+/*
int cw_read_wtp_descriptor_versions(mbag_t mbag, uint8_t * data, int len)
{
@@ -33,8 +34,8 @@ int cw_read_wtp_descriptor_versions(mbag_t mbag, uint8_t * data, int len)
char *dmp;
char *dmpmem = NULL;
if (cw_dbg_is_level(DBG_SUBELEM_DMP)) {
-/* TODO XXX */
- dmpmem = NULL; /*cw_dbg_mkdmp(data + i, sublen);*/
+// TODO XXX
+ dmpmem = NULL; //cw_dbg_mkdmp(data + i, sublen);
dmp = dmpmem;
} else
dmp = "";
@@ -45,33 +46,10 @@ int cw_read_wtp_descriptor_versions(mbag_t mbag, uint8_t * data, int len)
free(dmpmem);
switch (subtype) {
-/* case CW_SUBELEM_WTP_HARDWARE_VERSION:
- mbag_set_bstrv(mbag,
- CW_ITEM_WTP_HARDWARE_VERSION,
- vendor_id, data + i, sublen);
-
- break;
- case CW_SUBELEM_WTP_SOFTWARE_VERSION:
-
- mbag_set_bstrv(mbag,
- CW_ITEM_WTP_SOFTWARE_VERSION,
- vendor_id, data + i, sublen);
- break;
- case CW_SUBELEM_WTP_BOOTLOADER_VERSION:
-
- mbag_set_bstrv(mbag,
- CW_ITEM_WTP_BOOTLOADER_VERSION,
- vendor_id, data + i, sublen);
-
- break;
- default:
- cw_dbg(DBG_ELEM_ERR,
- "Unknown WTP descriptor subelement, type = %d",
- subtype);
- break;
-*/ }
+ }
i += sublen;
}
return 1;
}
+*/
\ No newline at end of file
diff --git a/src/cw/cwmsg_addelem_mtu_discovery_padding.c b/src/cw/cwmsg_addelem_mtu_discovery_padding.c
index b08a4481..935cb14e 100644
--- a/src/cw/cwmsg_addelem_mtu_discovery_padding.c
+++ b/src/cw/cwmsg_addelem_mtu_discovery_padding.c
@@ -18,7 +18,7 @@
#include
-#include "mbag.h"
+
#include "capwap.h"
#include "conn.h"
#include "cwmsg.h"
diff --git a/src/cw/dbg.c b/src/cw/dbg.c
index 087614eb..09d5a8a5 100644
--- a/src/cw/dbg.c
+++ b/src/cw/dbg.c
@@ -25,7 +25,7 @@
*/
#include
-#include "mbag.h"
+
#include "capwap.h"
#include "dbg.h"
#include "sock.h"
@@ -182,8 +182,8 @@ static const char *get_dbg_color_ontext(int level)
/**
* Put a list of missing mandatory message elements to debug output
*/
-void cw_dbg_missing_mand(int level, struct conn *conn, cw_action_in_t ** ml, int n,
- cw_action_in_t * a)
+void cw_dbg_missing_mand(int level, struct conn *conn, int ** ml, int n,
+ int * a)
{
/*
// if (!cw_dbg_is_level(DBG_MSG_ERR) || n == 0)
@@ -422,6 +422,7 @@ void cw_dbg(int level, const char *format, ...)
//int cw_is_utf8(unsigned char *str, size_t len);
*/
+/*
int cw_format_item(char *dst, mbag_item_t * item)
{
*dst = 0;
@@ -435,7 +436,7 @@ int cw_format_item(char *dst, mbag_item_t * item)
return 0;
}
-
+*/
diff --git a/src/cw/dbg.h b/src/cw/dbg.h
index cfce7037..8d881f62 100644
--- a/src/cw/dbg.h
+++ b/src/cw/dbg.h
@@ -45,7 +45,11 @@
void cw_dbg_elem_(struct conn * conn, int msg, int msgelem, const uint8_t * msgbuf, int len);
+
+/*
void cw_dbg_missing_mand(int level,struct conn *conn,cw_action_in_t ** ml,int n,cw_action_in_t *a);
+*/
+
void cw_dbg_packet(struct conn *conn, uint8_t * packet, int len);
void cw_dbg_pkt(int level,struct conn *conn, uint8_t * packet, int len,struct sockaddr *from);
void cw_dbg(int level, const char *format, ...);
diff --git a/src/cw/dbg_strings.c b/src/cw/dbg_strings.c
index 4488d8c2..7308c252 100644
--- a/src/cw/dbg_strings.c
+++ b/src/cw/dbg_strings.c
@@ -22,7 +22,7 @@
*/
-#include "mbag.h"
+
#include "dbg.h"
/**
diff --git a/src/cw/debug.c b/src/cw/debug.c
index 1dadcd39..2ae4804c 100644
--- a/src/cw/debug.c
+++ b/src/cw/debug.c
@@ -1,6 +1,6 @@
#include
#include "debug.h"
-#include "mbag.h"
+
#include "dbg.h"
#include "log.h"
diff --git a/src/cw/dtls_bio.c b/src/cw/dtls_bio.c
index 9279f6de..01c85c90 100644
--- a/src/cw/dtls_bio.c
+++ b/src/cw/dtls_bio.c
@@ -24,7 +24,7 @@
#include
-#include "mbag.h"
+
#include "log.h"
#include "dbg.h"
#include "dtls.h"
diff --git a/src/cw/dtls_gnutls.c b/src/cw/dtls_gnutls.c
index b6ae0cde..6a8121aa 100644
--- a/src/cw/dtls_gnutls.c
+++ b/src/cw/dtls_gnutls.c
@@ -22,7 +22,7 @@
#include
#include
-#include "mbag.h"
+
#include "dtls_common.h"
#include "dtls_gnutls.h"
diff --git a/src/cw/dtls_gnutls_accept.c b/src/cw/dtls_gnutls_accept.c
index 99f99681..32af0b54 100644
--- a/src/cw/dtls_gnutls_accept.c
+++ b/src/cw/dtls_gnutls_accept.c
@@ -24,7 +24,7 @@
#include
-#include "mbag.h"
+
#include "conn.h"
#include "dbg.h"
#include "log.h"
diff --git a/src/cw/dtls_gnutls_bio.c b/src/cw/dtls_gnutls_bio.c
index 12e365e9..3afc6b16 100644
--- a/src/cw/dtls_gnutls_bio.c
+++ b/src/cw/dtls_gnutls_bio.c
@@ -27,7 +27,7 @@
#include
-#include "mbag.h"
+
#include "dtls.h"
#include "dtls_gnutls.h"
#include "capwap.h"
diff --git a/src/cw/dtls_gnutls_connect.c b/src/cw/dtls_gnutls_connect.c
index aa1286db..71595f10 100644
--- a/src/cw/dtls_gnutls_connect.c
+++ b/src/cw/dtls_gnutls_connect.c
@@ -23,7 +23,7 @@
#include "gnutls/dtls.h"
-#include "mbag.h"
+
#include "dtls.h"
#include "dtls_gnutls.h"
diff --git a/src/cw/dtls_gnutls_get_cipher.c b/src/cw/dtls_gnutls_get_cipher.c
index 161f44c9..9e87bd97 100644
--- a/src/cw/dtls_gnutls_get_cipher.c
+++ b/src/cw/dtls_gnutls_get_cipher.c
@@ -1,5 +1,5 @@
-#include "mbag.h"
+
#include "dtls_common.h"
#include "dtls_gnutls.h"
diff --git a/src/cw/dtls_gnutls_get_peers_cert.c b/src/cw/dtls_gnutls_get_peers_cert.c
index 865108ef..863a7d93 100644
--- a/src/cw/dtls_gnutls_get_peers_cert.c
+++ b/src/cw/dtls_gnutls_get_peers_cert.c
@@ -2,7 +2,7 @@
#include
#include
-#include "mbag.h"
+
#include "conn.h"
#include "dtls.h"
#include "dtls_gnutls.h"
diff --git a/src/cw/dtls_openssl_accept.c b/src/cw/dtls_openssl_accept.c
index cfadd090..a06f44f2 100644
--- a/src/cw/dtls_openssl_accept.c
+++ b/src/cw/dtls_openssl_accept.c
@@ -18,7 +18,7 @@
#include
-#include "mbag.h"
+
#include "conn.h"
#include "sock.h"
#include "dtls_openssl.h"
diff --git a/src/cw/dtls_openssl_bio.c b/src/cw/dtls_openssl_bio.c
index c4294c6d..9d03a9f7 100644
--- a/src/cw/dtls_openssl_bio.c
+++ b/src/cw/dtls_openssl_bio.c
@@ -21,13 +21,13 @@
* @brief Functions for OpenSSL BIO
*/
-#include "mbag.h"
+
#include
#include
#include "dtls_openssl.h"
#include "dtls.h"
-#include "mbag.h"
+
#include "conn.h"
#include "log.h"
#include "dbg.h"
diff --git a/src/cw/dtls_openssl_connect.c b/src/cw/dtls_openssl_connect.c
index 7b527b68..4ad10827 100644
--- a/src/cw/dtls_openssl_connect.c
+++ b/src/cw/dtls_openssl_connect.c
@@ -1,6 +1,6 @@
#include
-#include "mbag.h"
+
#include "dtls_openssl.h"
#include "log.h"
#include "dbg.h"
diff --git a/src/cw/dtls_openssl_get_cipher.c b/src/cw/dtls_openssl_get_cipher.c
index 887327a4..00ad2162 100644
--- a/src/cw/dtls_openssl_get_cipher.c
+++ b/src/cw/dtls_openssl_get_cipher.c
@@ -16,7 +16,7 @@
*/
-#include "mbag.h"
+
#include "dtls_openssl.h"
const char * dtls_openssl_get_cipher(struct conn * conn)
diff --git a/src/cw/item.c b/src/cw/item.c
deleted file mode 100644
index 628f09d9..00000000
--- a/src/cw/item.c
+++ /dev/null
@@ -1,79 +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 "mbag.h"
-#include "item.h"
-#include "log.h"
-
-
-const char CW_ITEM_NONE[] = "";
-const char CW_ITEM_ANY[] = "*";
-
-
-struct cw_itemdef *cw_item_get_by_name(const char *id, struct cw_itemdef *table)
-{
- while (table->id != CW_ITEM_NONE) {
- if (!strcmp(table->id, id))
- return table;
- table++;
-
- }
- return NULL;
-}
-
-
-
-static int cmp(const void *x1, const void *x2)
-{
- cw_itemdef_t *i1, *i2;
- i1 = (cw_itemdef_t *) x1;
- i2 = (cw_itemdef_t *) x2;
-
- int rc = strcmp(i1->id, i2->id);
- if (rc != 0)
- return rc;
- return strcmp(i1->sub_id, i2->sub_id);
-}
-
-const cw_itemdef_t * cw_itemdef_get(cw_itemdefheap_t t, const char *id, const char *sub_id)
-{
- cw_itemdef_t idef;
- idef.id = id;
- idef.sub_id = !sub_id ? CW_ITEM_NONE : sub_id;
-
- return mavl_get(t, &idef);
-}
-
-cw_itemdefheap_t cw_itemdefheap_create()
-{
- return mavl_create(cmp, NULL,1312);
-}
-
-int cw_itemdefheap_register(cw_itemdefheap_t t, cw_itemdef_t * defs)
-{
- int n = 0;
- while (defs->id != CW_ITEM_NONE) {
- cw_itemdef_t *a = mavl_add(t, defs,NULL);
- if (a != defs) {
- cw_log(LOG_ERR, "Duplicated item: %s", defs->id);
- } else
- n++;
- defs++;
- }
- return n;
-}
diff --git a/src/cw/item.h b/src/cw/item.h
deleted file mode 100644
index 9a883f4c..00000000
--- a/src/cw/item.h
+++ /dev/null
@@ -1,60 +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 .
-
-*/
-
-
-#ifndef __CW_ITEM_H
-#define __CW_ITEM_H
-
-/*#include "mbag.h"*/
-
-extern const char CW_ITEM_NONE[];
-extern const char CW_ITEM_ANY[];
-
-
-/* Definitions for CAPWAP Items */
-
-struct cw_itemdef {
- /** ID */
- const char *id;
- /** Sub-ID */
- const char *sub_id;
- /** Type */
- mbagtype_t type;
- /**
- * A category this item belongs to.
- */
- const char *cat;
-
-};
-typedef struct cw_itemdef cw_itemdef_t;
-
-
-typedef mavl_t cw_itemdefheap_t;
-extern cw_itemdefheap_t cw_itemdefheap_create();
-extern int cw_itemdefheap_register(cw_itemdefheap_t t, cw_itemdef_t * defs);
-extern const cw_itemdef_t * cw_itemdef_get(cw_itemdefheap_t t, const char *id,
- const char *sub_id);
-
-
-
-
-struct cw_itemdef *cw_item_get_by_name(const char *name, struct cw_itemdef *table);
-
-typedef const char *cw_item_id_t;
-
-#endif
diff --git a/src/cw/lw_addelem.c b/src/cw/lw_addelem.c
index 06643dd7..8d53245b 100644
--- a/src/cw/lw_addelem.c
+++ b/src/cw/lw_addelem.c
@@ -3,7 +3,7 @@
#include "lwapp.h"
#include "lwapp_cisco.h"
-#include "mbag.h"
+
#include "lw.h"
#include "vendors.h"
diff --git a/src/cw/lw_checksum.c b/src/cw/lw_checksum.c
index d8c1aa3f..86116989 100644
--- a/src/cw/lw_checksum.c
+++ b/src/cw/lw_checksum.c
@@ -23,7 +23,7 @@
*@{
*/
-#include "mbag.h"
+
#include "lw.h"
diff --git a/src/cw/lw_in_vendor_specific.c b/src/cw/lw_in_vendor_specific.c
index a1c91947..0dd1f291 100644
--- a/src/cw/lw_in_vendor_specific.c
+++ b/src/cw/lw_in_vendor_specific.c
@@ -12,6 +12,8 @@
/**
* Default handler for LWAPP Vendor Specific Payload message elements.
*/
+
+ /*
int lw_in_vendor_specific(struct conn *conn, struct cw_action_in *a,
uint8_t * data, int len, struct sockaddr *from)
{
@@ -23,9 +25,9 @@ int lw_in_vendor_specific(struct conn *conn, struct cw_action_in *a,
as.elem_id = cw_get_word(data + 4);
as.proto = CW_ACTION_PROTO_LWAPP;
-/* TODO XXXX
+// TODO XXXX
//af = cw_actionlist_in_get(conn->actions->in, &as);
-*/
+//
af = 0;
if (!af) {
@@ -39,12 +41,13 @@ int lw_in_vendor_specific(struct conn *conn, struct cw_action_in *a,
if (af->start) {
int afrc = af->start(conn, af, data + 6, len - 6, from);
if (af->mand && afrc) {
- /* add found mandatory message element
- to mand list */
-/* XXXX stravltree_add(conn->mand, af->item_id); */
+ // add found mandatory message element
+ //to mand list
+// XXXX stravltree_add(conn->mand, af->item_id);
}
return afrc;
}
return 1;
}
+*/
\ No newline at end of file
diff --git a/src/cw/lw_inline.c b/src/cw/lw_inline.c
index ced2acdb..3ea0ece4 100644
--- a/src/cw/lw_inline.c
+++ b/src/cw/lw_inline.c
@@ -1,4 +1,4 @@
-#include "mbag.h"
+
#include "lw.h"
/**
diff --git a/src/cw/lw_put_ac_descriptor.c b/src/cw/lw_put_ac_descriptor.c
index 9d1f518a..7cd6b46c 100644
--- a/src/cw/lw_put_ac_descriptor.c
+++ b/src/cw/lw_put_ac_descriptor.c
@@ -1,6 +1,6 @@
#include
-#include "mbag.h"
+
#include "lwapp.h"
#include "lw.h"
diff --git a/src/cw/lw_put_cisco_path_mtu.c b/src/cw/lw_put_cisco_path_mtu.c
index 74fa74d2..f6f264ac 100644
--- a/src/cw/lw_put_cisco_path_mtu.c
+++ b/src/cw/lw_put_cisco_path_mtu.c
@@ -20,7 +20,7 @@
* @file
* @brief Implementation of lw_put_cisco_path_mtu
*/
-#include "mbag.h"
+
#include "lwapp_cisco.h"
#include "lw.h"
#include "vendors.h"
diff --git a/src/cw/lw_put_image_data.c b/src/cw/lw_put_image_data.c
index a14bcfbb..28ed287e 100644
--- a/src/cw/lw_put_image_data.c
+++ b/src/cw/lw_put_image_data.c
@@ -1,4 +1,4 @@
-#include "mbag.h"
+
#include "lwapp.h"
#include "lw.h"
diff --git a/src/cw/lw_put_sockaddr.c b/src/cw/lw_put_sockaddr.c
index 69468c50..ff2ec322 100644
--- a/src/cw/lw_put_sockaddr.c
+++ b/src/cw/lw_put_sockaddr.c
@@ -21,7 +21,7 @@
#include
-#include "mbag.h"
+
#include "lw.h"
int lw_put_sockaddr(uint8_t * dst, struct sockaddr_storage *addr)
diff --git a/src/cw/lw_readelem_wtp_name.c b/src/cw/lw_readelem_wtp_name.c
index 610fa6a1..a8a80bfe 100644
--- a/src/cw/lw_readelem_wtp_name.c
+++ b/src/cw/lw_readelem_wtp_name.c
@@ -21,7 +21,7 @@
* @brief Implent lw_readelem_wtp_name
*/
-#include "mbag.h"
+
#include "lwapp.h"
#include "cw_util.h"
diff --git a/src/cw/mbag.c b/src/cw/mbag.c
deleted file mode 100644
index 281e3266..00000000
--- a/src/cw/mbag.c
+++ /dev/null
@@ -1,814 +0,0 @@
-#include "mbag.h"
-#include "capwap.h"
-#include "format.h"
-/**
- * @file
- * @MBAG functions
- * @addtogroup MbagFunctions
- * @{
- */
-
-/*
-static int mbag_bstr16str(void *item,char *dst)
-{
- mbag_item_t *i= item;
-
-
-
- char *d = dst;
- int utf8 = cw_is_utf8(bstr16_data(i->data), bstr16_len(i->data));
-
-
- if (utf8) {
- d += sprintf(d, "%.*s", bstr16_len(i->data), bstr16_data(i->data));
- } else {
- d += sprintf(d, "\".x");
- d += cw_format_hex(d, bstr16_data(i->data), bstr16_len(i->data));
- d += sprintf(d, "\"");
- }
- return d-dst;
-}
-*/
-
-
-/*
-const struct mbag_typedef mbag_type_byte = {
- "byte",NULL
-};
-*/
-
-/*
-const struct mbag_typedef mbag_type_word = {
- "word",NULL
-};
-*/
-
-/*
-const struct mbag_typedef mbag_type_dword = {
- "dword",NULL
-};
-*/
-
-const struct mbag_typedef mbag_type_const_data = {
- "data",NULL
-};
-
-const struct mbag_typedef mbag_type_bstr = {
- "bstr",free
-};
-
-/*
-const struct mbag_typedef mbag_type_bstr16 = {
- "bstr16",free,mbag_bstr16str
-};
-
-*/
-
-
-
-
-/*
-const struct mbag_typedef mbag_type_vendorstr = {
- "vendorstr",free
-};
-*/
-
-/*
-void free_avltree(void*t){
- mavl_t i = (mavl_t) t;
-
- mavl_destroy(i);
-
-}
-const struct mbag_typedef mbag_type_avltree = {
- "mavl",free_avltree
-};
-*/
-
-
-
-static void mbag_type_mbag_del(void *i)
-{
- mbag_t x = (mbag_t)i;
-
- mavl_destroy(x);
-}
-
-/*const struct mbag_typedef mbag_type_mbag = {
-# "mbag",mbag_type_mbag_del
-};
-*/
-
-/*const struct mbag_typedef mbag_type_mbag_dyn = {
- "mbag",mbag_type_mbag_del
-};
-*/
-
-static void mbag_del_data(struct mbag_item *i)
-{
- if (i->type->del) {
- i->type->del(i->u2.data);
- }
-}
-
-
-static void mbag_del_fun(void *e)
-{
- mbag_item_t * i = (mbag_item_t*)e;
- if (i->dynid){
- free((void*)i->u1.id);
- }
-
- mbag_del_data(e);
- free(e);
-}
-
-
-static void mbag_i_del_fun(void *e)
-{
-
- mbag_del_data(e);
- free(e);
-}
-
-
-static int mbag_cmp_fun(const void *x1, const void *x2)
-{
- return strcmp(( (struct mbag_item *) x1)->u1.id , ((struct mbag_item *) x2)->u1.id );
-}
-
-
-
-static int mbag_i_cmp_fun(const void *x1, const void *x2)
-{
- return ((struct mbag_item *) x1)->u1.iid - ((struct mbag_item *) x2)->u1.iid;
-}
-
-mbag_t mbag_i_create()
-{
- return mavl_create(mbag_i_cmp_fun, mbag_i_del_fun,1312);
-}
-
-
-mbag_t mbag_create()
-{
- return mavl_create(mbag_cmp_fun, mbag_del_fun,1312);
-
-}
-
-
-
-mbag_item_t *mbag_item_new(mbagtype_t type)
-{
- struct mbag_item *i= malloc(sizeof(mbag_item_t));
- if (!i)
- return NULL;
-
- i->type = type;
- i->dynid=0;
- return i;
-}
-
-struct mbag_item *mbag_item_create(mbag_t s, const char *id)
-{
- struct mbag_item is;
- is.u1.id = id;
-
-
- struct mbag_item *i = mavl_get(s, &is);
- if (i) {
- mbag_del_data(i);
- return i;
- }
-
- i = malloc(sizeof(struct mbag_item));
- if (!i)
- return NULL;
- i->u1.id = id;
- i->dynid=0;
- return mavl_add(s, i,NULL);
-}
-
-
-struct mbag_item *mbag_i_item_create(mbag_t s, uint32_t id)
-{
- struct mbag_item is;
- is.u1.iid = id;
-
-
- struct mbag_item *i = mavl_get(s, &is);
- if (i) {
- mbag_del_data(i);
- return i;
- }
-
- i = malloc(sizeof(struct mbag_item));
- if (!i)
- return NULL;
- i->u1.iid = id;
- i->dynid=0;
- return mavl_add(s, i,NULL);
-}
-
-
-
-
-
-/*
-struct mbag_item *strmbag_item_create(mbag_t s, char *name)
-{
- struct mbag_item is;
- is.name = name;
-
-
- struct mbag_item *i = mavl_get(s, &is);
- if (i) {
- mbag_del_data(i);
- return i;
- }
-
- i = malloc(sizeof(struct mbag_item));
- if (!i)
- return NULL;
- i->name = name;
- return mavl_add(s, i);
-}
-
-*/
-
-/**@}*/
-
-
-
-
-
-
-
-
-
-
-
-
-
-int mbag_set(mbag_t t,mbag_item_t *is)
-{
- mavl_del(t,is);
- mavl_add(t,is,NULL);
- return 1;
-
-/*
- struct mbag_item *i = mavl_get(s, is);
- if (i) {
- mbag_del_data(i);
- return i;
- }
- mavl_add(t,is);
-*/
-}
-
-int mbag_set_byte(mbag_t s, const char *id, uint8_t byte)
-{
- struct mbag_item *i = mbag_item_create(s, id);
- if (!i)
- return 0;
- i->u2.byte = byte;
- i->type = &mbag_type_byte;
- return 1;
-}
-
-struct mbag_item * mbag_set_word(mbag_t s, const char *id, uint16_t word)
-{
- struct mbag_item *i = mbag_item_create(s, id);
- if (!i)
- return 0;
- i->u2.word = word;
- i->type = &mbag_type_word;
- return i;
-}
-
-
-
-
-struct mbag_item * mbag_set_dword(mbag_t s, const char *id, uint32_t dword)
-{
- struct mbag_item *i = mbag_item_create(s, id);
- if (!i)
- return NULL;
- i->u2.dword = dword;
- i->type = &mtype_dword;
- return i;
-}
-
-
-int mbag_i_set_mbag(mbag_t s, uint32_t id, mbag_t mbag)
-{
- struct mbag_item *i = mbag_i_item_create(s, id);
- if (!i)
- return 0;
- i->u2.data = mbag;
- i->type = &mbag_type_mbag;
- return 1;
-}
-
-int mbag_set_mbag(mbag_t s, const char *id, mbag_t mbag)
-{
- struct mbag_item *i = mbag_item_create(s, id);
- if (!i)
- return 0;
- i->u2.data = mbag;
- i->type = &mbag_type_mbag;
- return 1;
-}
-
-int mbag_set_data(mbag_t s, const char *id, const struct mbag_typedef *type, void *data)
-{
- struct mbag_item *i = mbag_item_create(s, id);
- if (!i)
- return 0;
- i->u2.data = data;
- i->type = type;
- return 1;
-
-
-}
-
-/*
-bstrv_t mbag_set_bstrv(mbag_t s, const char *id, uint32_t vendor_id,
- uint8_t * version, int len)
-{
- mbag_item_t *i = mbag_item_create(s, id);
- if (!i)
- return NULL;
-
- i->type = MBAG_VENDORSTR;
- i->u2.data = bstrv_create(vendor_id,version,len);
- return i->u2.data;
-}
-
-
-*/
-
-
-
-
-
-
-
-
-
-
-mbag_item_t *mbag_get(mbag_t s, const char *id)
-{
- mbag_item_t i;
- i.u1.id = id;
- i.type=0;
- return mavl_get(s, &i);
-}
-
-
-mbag_item_t *mbag_i_get(mbag_t s, uint32_t id)
-{
- mbag_item_t i;
- i.u1.iid = id;
- i.type=0;
- return mavl_get(s, &i);
-}
-
-
-
-void mbag_del(mbag_t s,const char *id)
-{
- mbag_item_t i;
- i.u1.id = id;
- i.type=0;
- mavl_del(s, &i);
-}
-
-void * mbag_get_data(mbag_t s, const char *id, const struct mbag_typedef * type, void * def)
-{
- struct mbag_item *i = mbag_get(s, id);
- if (!i)
- return def;
- if (i->type != type)
- return def;
- return i->u2.data;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/***************************************************/
-
-
-void * mbag_get_raw(mbag_t s, const char *id, void * def)
-{
- struct mbag_item *i = mbag_get(s, id);
- if (!i)
- return def;
- return i->u2.data;
-}
-
-
-
-uint8_t mbag_get_byte(mbag_t s, const char *id, uint8_t def)
-{
- struct mbag_item *i = mbag_get(s, id);
- if (!i)
- return def;
- if (i->type != MBAG_BYTE)
- return def;
- return i->u2.byte;
-}
-
-uint16_t mbag_get_word(mbag_t s, const char *id, uint16_t def)
-{
- struct mbag_item *i = mbag_get(s, id);
- if (!i)
- return def;
- if (i->type != MBAG_WORD)
- return def;
- return i->u2.word;
-}
-
-
-
-uint32_t mbag_get_dword(mbag_t s, const char *id, uint32_t def)
-{
- struct mbag_item *i = mbag_get(s, id);
- if (!i)
- return def;
- if (i->type != MTYPE_DWORD)
- return def;
- return i->u2.dword;
-}
-
-
-mbag_t mbag_i_get_mbag(mbag_t s, uint32_t id, mbag_t def)
-{
- struct mbag_item *i = mbag_i_get(s, id);
- if (!i)
- return def;
- if (i->type != MBAG_MBAG)
- return def;
- return i->u2.data;
-}
-
-
-mbag_t mbag_get_mbag(mbag_t s, const char *id, mbag_t def)
-{
- struct mbag_item *i = mbag_get(s, id);
- if (!i)
- return def;
- if (i->type != MBAG_MBAG)
- return def;
- return i->u2.data;
-}
-
-mbag_item_t * mbag_set_bstrn(mbag_t s, const char *id, uint8_t * data, int len)
-{
- struct mbag_item *i = mbag_item_create(s, id);
- if (!i)
- return NULL;
- i->type = MBAG_BSTR;
- i->u2.data = bstr_create(data, len);
- return i;
-}
-
-
-/*
-
-struct mavl *mbag_get_mavl(mbag_t s, const char *id)
-{
- struct mbag_item *i = mbag_get(s, id);
- if (!i)
- return NULL;
- if (i->type != MBAG_AVLTREE)
- return NULL;
- return i->u2.data;
-}
-
-int mbag_i_set_mavl(mbag_t s, uint32_t id, mavl_t t)
-{
- struct mbag_item *i = mbag_i_item_create(s, id);
- if (!i)
- return 0;
- i->type = MBAG_AVLTREE;
- i->u2.data = t;
- return 1;
-}
-
-int mbag_set_mavl(mbag_t s, const char *id, mavl_t t)
-{
- struct mbag_item *i = mbag_item_create(s, id);
- if (!i)
- return 0;
- i->type = MBAG_AVLTREE;
- i->u2.data = t;
- return 1;
-}
-*/
-
-/*
-struct mavl *mbag_get_avltree_c(mbag_t s, const char *id,
- struct mavl *(creator) ())
-{
- struct mavl * avltree = mbag_get_mavl(s, id);
- if (avltree){
- return avltree;
- }
-
- avltree = creator();
- if (!avltree)
- return NULL;
- mbag_set_mavl(s, id, avltree);
- return avltree;
-}
-*/
-
-mavl_t mbag_get_mavl_c(mbag_t s, const char *id,
- mavl_t (creator) ())
-{
-/* struct mbag_item *i = mbag_get(s, id);
- if (i)
- return i->u2.data;
-
- if (!creator)
- return NULL;
- mavl_t avltree = creator();
- if (!avltree)
- return NULL;
- mbag_set_mavl(s, id, avltree);
- return avltree;
-*/
-}
-
-
-mavl_t mbag_get_mbag_c(mbag_t s, const char *id,
- mavl_t (creator) ())
-{
- struct mbag_item *i = mbag_get(s, id);
- if (i)
- return i->u2.data;
-
- if (!creator)
- return NULL;
- mavl_t avltree = creator();
- if (!avltree)
- return NULL;
- mbag_set_mbag(s, id, avltree);
- return avltree;
-}
-
-
-
-int mbag_inc_word(mbag_t s, const char * id,int n)
-{
- uint16_t w = mbag_get_word(s,id,0);
- mbag_set_word(s,id,w+n);
- return 1;
-}
-
-
-
-mavl_t mbag_i_get_mbag_c(mbag_t s, uint32_t iid,
- mavl_t (creator) ())
-{
- struct mbag_item *i = mbag_i_get(s, iid);
- if (i)
- return i->u2.data;
-
- if (!creator)
- return NULL;
- mavl_t avltree = creator();
- if (!avltree)
- return NULL;
- mbag_i_set_mbag(s, iid, avltree);
- return avltree;
-}
-
-
-
-
-mavl_t mbag_i_get_mavl(mbag_t s, uint32_t id,
- mavl_t (creator) ())
-{
-/* struct mbag_item *i = mbag_i_get(s, id);
- if (i)
- return i->u2.data;
-
- if (!creator)
- return NULL;
- mavl_t avltree = creator();
- if (!avltree)
- return NULL;
- mbag_i_set_mavl(s, id, avltree);
- return avltree;
-*/
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-char *mbag_get_str(mbag_t s, const char *id, char *def)
-{
- struct mbag_item *i = mbag_get(s, id);
- if (!i)
- return def;
- return i->u2.data;
-
-};
-
-int mbag_set_str(mbag_t s, const char *id, const char *str)
-{
- struct mbag_item *i = mbag_item_create(s, id);
- if (!i)
- return 0;
- i->type = MBAG_STR;
- i->u2.data = strdup(str);
- return 1;
-}
-
-
-int mbag_set_sockaddr(mbag_t s, const char *id, const struct sockaddr * sa)
-{
- struct mbag_item *i = mbag_item_create(s, id);
- if (!i)
- return 0;
- struct sockaddr_storage * sad = malloc(sizeof(struct sockaddr_storage));
- if (!sad){
- free(i);
- return 0;
- }
- sock_copyaddr(sad,sa);
- i->type = MBAG_SOCKADDR;
- i->u2.data = sad;
- return 1;
-
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/*******/
-
-void *mbag_item_get_data_ptr(struct mbag_item *item)
-{
- if (item->type == MBAG_FUN )
- {
- struct mbag_item_fundef *fundef =
- (struct mbag_item_fundef *) item->u2.data;
- if (!fundef)
- return NULL;
- return fundef->get(fundef->arg);
- }
- return item->u2.data;
-}
-
-
-void mbag_item_release_data_ptr(struct mbag_item *item, void *data)
-{
- if (item->type == MBAG_FUN)
- {
- struct mbag_item_fundef *fundef =
- (struct mbag_item_fundef *) item->u2.data;
- if (!fundef)
- return;
- if (!fundef->free)
- return;
-
- return fundef->free(fundef->arg, data);
- }
-
-}
-
-int mbag_set_strn(mbag_t s, const char *id, const char *str, int n)
-{
- struct mbag_item *i = mbag_item_create(s, id);
- if (!i)
- return 0;
- i->type = MBAG_STR;
- i->u2.data = strndup(str, n);
- return 1;
-}
-
-int mbag_set_bstr16n(mbag_t s, const char *id, uint8_t * data, int len)
-{
- struct mbag_item *i = mbag_item_create(s, id);
- if (!i)
- return 0;
- i->type = MBAG_BSTR16;
- i->u2.data = bstr16_create(data, len);
- return 1;
-}
-
-
-
-mbag_item_t * mbag_set_const_ptr(mbag_t s, const char *id, void *ptr)
-{
- struct mbag_item *i = mbag_item_create(s, id);
- if (!i)
- return 0;
- i->type = MBAG_CONST_DATA;
- i->u2.data = ptr;
- return i;
-}
-
-
-int mbag_set_ptr(mbag_t s, const char *id, void *ptr)
-{
- struct mbag_item *i = mbag_item_create(s, id);
- if (!i)
- return 0;
- i->type = MBAG_PTR;
- i->u2.data = ptr;
- return 1;
-}
-
-
-
-int mbag_set_fun(mbag_t s, const char *id,
- void *(*funget) (void *arg),
- void (*funfree) (void *arg, void *data), void *arg)
-{
- struct mbag_item *i = mbag_item_create(s, id);
- if (!i)
- return 0;
-
- struct mbag_item_fundef *fundef = malloc(sizeof(struct mbag_item_fundef));
- i->u2.data = fundef;
- if (!fundef)
- return 0;
-
- fundef->get = funget;
- fundef->free = funfree;
- fundef->arg = arg;
- i->type=MBAG_FUN;
-
- return 1;
-}
-
-
-
-
-
-
-
diff --git a/src/cw/mbag.h b/src/cw/mbag.h
deleted file mode 100644
index 8043bf05..00000000
--- a/src/cw/mbag.h
+++ /dev/null
@@ -1,304 +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 .
-
-*/
-
-
-#ifndef __MBAG_H
-#define __MBAG_H
-
-/**
- * @defgroup MBAG MBAG
- * @{
- */
-
-
-#include
-#include "mavl.h"
-#include "bstr.h"
-#include "sock.h"
-
-/* Forward declaration */
-struct mbag_item;
-
-/**
- * The MBAG Type
- *
- * It's simply an #mavl AVL Tree.
- */
-typedef mavl_t mbag_t;
-
-
-
-/**
- * Definition for MABG data types
- */
-struct mbag_typedef{
- /** A human readable name for this type */
- const char *name;
- /** A pointer to a function to delete elements of this type */
- void (*del)(void*);
- /** A pointer to a function to convert elements of this type to a string.
- This function is mainly used to store elements to an SQL database
- or to json strings */
- int (*to_str)(void*,char *dst);
- /** Cereate an item of this type from a string, which was previously
- created by the #del function. */
- struct mbag_item * (*from_str)(const char *src);
-
- struct mbag_item * (*get)(const uint8_t*src, int len);
-
- /** A method to put this object to a buffer */
- int (*put)(struct mbag_item *i,uint8_t*dst);
-
- int (*def)(void *, void *);
-
-};
-
-/** The type for an mbag typedef */
-typedef const struct mbag_typedef * mbagtype_t;
-
-
-
-/**
- * The MBAG item
- */
-struct mbag_item{
- union {
- uint32_t iid;
- /**
- * Key of this item
- *
- * This could be either a string (default) or an integer uint32_t value.
- * If you whant to use with uint32_t keys, use the mbag_i_* functions, to
- * create mbags.
- */
- const char *id;
- }u1;
- /**
- * Indicates if the key is dynamic oder static.
- * If dynamic, the id will be freed using free,
- * if mbag_item is deleted
- */
- uint8_t dynid;
- /** Type of this item */
- const struct mbag_typedef * type;
- union {
- /** Value of this item */
- void *data;
- uint8_t byte;
- uint16_t word;
- uint32_t dword;
- }u2;
-};
-
-
-typedef struct mbag_item mbag_item_t;
-
-extern const struct mbag_typedef mbag_type_byte;
-extern const struct mbag_typedef mbag_type_word;
-extern const struct mbag_typedef mtype_dword;
-extern const struct mbag_typedef mbag_type_mbag;
-extern const struct mbag_typedef mbag_type_bstr;
-extern const struct mbag_typedef mbag_type_bstr16;
-
-extern const struct mbag_typedef mbag_type_str;
-extern const struct mbag_typedef mbag_type_ptr;
-extern const struct mbag_typedef mbag_type_avltree;
-extern const struct mbag_typedef mbag_type_const_data;
-extern const struct mbag_typedef mbag_type_mbag_dyn;
-extern const struct mbag_typedef mbag_type_sockaddr;
-extern const struct mbag_typedef mbag_type_data;
-
-/**
- *@defgroup MBAG_TYPES MBAG Types
- *@{
- */
-/** MBAG_BYTE stores one byte */
-#define MBAG_BYTE (&mbag_type_byte)
-/** MBAG_WORD stores one word */
-#define MBAG_WORD (&mbag_type_word)
-/** MTYPE_DWORD stores one dword */
-#define MTYPE_DWORD (&mtype_dword)
-/** MBAG_MBAG stores an MBAG */
-#define MBAG_MBAG (&mbag_type_mbag)
-#define MBAG_MBAG_DYN (&mbag_type_mbag_dyn)
-/**
- * MBAG_BSTR stores a #bstr_t value
- * The to_str converts it either to a readable string
- * if it detects utf8 or to an hex string otherwise
- */
-#define MBAG_BSTR (&mbag_type_bstr)
-/**
- * MBAG_BSTR16 holds an #bstr16_t value.
- * @see MBAG_BSTR
- */
-#define MBAG_BSTR16 (&mbag_type_bstr16)
-
-#define MBAG_DATA (&mbag_type_data)
-#define MBAG_BIN MBAG_DATA
-
-/** MBAG_STR holds a zero terminated string */
-#define MBAG_STR (&mbag_type_str)
-/**
- * MBAG_PTR holds a pointer to some data.
- * The data will be free'd when the object is destroyed.
- * There is no to_str or from_str method defined.
- */
-#define MBAG_PTR (&mbag_type_ptr)
-
-#define MBAG_FUN MBAG_STR
-#define MBAG_CONST_DATA (&mbag_type_const_data)
-/** MBAG_SOCK_ADDR holds a sockkaddr structure */
-#define MBAG_SOCKADDR (&mbag_type_sockaddr)
-/**@}*/
-
-extern mbag_t mbag_create();
-extern mbag_t mbag_i_create();
-
-struct mbag_item *mbag_item_create(mbag_t s, const char *id);
-struct mbag_item *mbag_i_item_create(mbag_t s, uint32_t id);
-
-
-bstrv_t mbag_set_bstrv(mbag_t s, const char *id, uint32_t vendor_id,
- uint8_t * version, int len);
-int mbag_set_data(mbag_t s, const char *id, const struct mbag_typedef *type, void *data);
-int mbag_set_mbag(mbag_t s, const char *id, mbag_t mbag);
-int mbag_i_set_mbag(mbag_t s, uint32_t id, mbag_t mbag);
-struct mbag_item * mbag_set_dword(mbag_t s, const char *id, uint32_t dword);
-struct mbag_item * mbag_set_word(mbag_t s, const char *id, uint16_t word);
-int mbag_set_byte(mbag_t s, const char *id, uint8_t byte);
-int mbag_set(mbag_t t,mbag_item_t *is);
-
-
-mbag_item_t *mbag_item_new(mbagtype_t type);
-
-
-
-
-#define mbag_set_bstr(m,i,d) mbag_set_data(m,i,MBAG_BSTR,d)
-#define mbag_set_bstr16(m,i,d) mbag_set_data(m,i,MBAG_BSTR16,d)
-
-
-
-
-
-void * mbag_get_data(mbag_t s, const char *id, const struct mbag_typedef * type, void * def);
-void mbag_del(mbag_t s,const char *id);
-mbag_item_t *mbag_i_get(mbag_t s, uint32_t id);
-mbag_item_t *mbag_get(mbag_t s, const char *id);
-
-
-
-
-
-
-
-#define mbag_get_bstr(m,i,d) mbag_get_data(m,i,MBAG_BSTR,d)
-#define mbag_get_bstr16(m,i,d) mbag_get_data(m,i,MBAG_BSTR16,d)
-
-
-
-void * mbag_get_raw(mbag_t s, const char *id, void * def);
-uint8_t mbag_get_byte(mbag_t s, const char *id, uint8_t def);
-uint16_t mbag_get_word(mbag_t s, const char *id, uint16_t def);
-uint32_t mbag_get_dword(mbag_t s, const char *id, uint32_t def);
-mbag_t mbag_i_get_mbag(mbag_t s, uint32_t id, mbag_t def);
-mbag_t mbag_get_mbag(mbag_t s, const char *id, mbag_t def);
-mbag_item_t * mbag_set_bstrn(mbag_t s, const char *id, uint8_t * data, int len);
-struct mavl *mbag_get_mavl(mbag_t s, const char *id);
-int mbag_i_set_mavl(mbag_t s, uint32_t id, mavl_t t);
-int mbag_set_mavl(mbag_t s, const char *id, mavl_t t);
-mavl_t mbag_get_mavl_c(mbag_t s, const char *id,
- mavl_t (creator) ());
-mavl_t mbag_get_mbag_c(mbag_t s, const char *id,
- mavl_t (creator) ());
-
-int mbag_inc_word(mbag_t s, const char * id,int n);
-
-mavl_t mbag_i_get_mbag_c(mbag_t s, uint32_t iid,
- mavl_t (creator) ());
-
-
-mavl_t mbag_i_get_mavl(mbag_t s, uint32_t id,
- mavl_t (creator) ());
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/** @} */
-
-char *mbag_get_str(mbag_t s, const char *id, char *def);
-int mbag_set_str(mbag_t s, const char *id, const char *str);
-int mbag_set_sockaddr(mbag_t s, const char *id, const struct sockaddr * sa);
-
-
-
-
-
-
-
-
-
-struct mbag_item_fundef {
- void *(*get) (void *arg);
- void (*free) (void *arg, void *data);
- void *arg;
-};
-
-void *mbag_item_get_data_ptr(struct mbag_item *item);
-void mbag_item_release_data_ptr(struct mbag_item *item, void *data);
-int mbag_set_strn(mbag_t s, const char *id, const char *str, int n);
-int mbag_set_bstr16n(mbag_t s, const char *id, uint8_t * data, int len);
-mbag_item_t * mbag_set_const_ptr(mbag_t s, const char *id, void *ptr);
-int mbag_set_ptr(mbag_t s, const char *id, void *ptr);
-int mbag_set_fun(mbag_t s, const char *id,
- void *(*funget) (void *arg),
- void (*funfree) (void *arg, void *data), void *arg);
-
-
-
-
-
-
-
-
-
-int mbag_set_from_buf(mbag_t dst, mbagtype_t type, const char *item_id, uint8_t *data, int len);
-
-
-
-/**
- * Delete all objects in ab mbag.
- *
- * @see #mavl_del_all
- */
-#define mbag_del_all mavl_del_all
-
-#endif
diff --git a/src/cw/mbag_get_upd.c b/src/cw/mbag_get_upd.c
index bf7d723e..27a332f2 100644
--- a/src/cw/mbag_get_upd.c
+++ b/src/cw/mbag_get_upd.c
@@ -1,10 +1,10 @@
-#include "mbag.h"
+
#include "log.h"
-
+/*
int mbag_get_upd(mbag_t b, mbag_t b_upd, const char *id, uint8_t *dst, int *found)
{
struct mbag_item *i = mbag_get(b_upd, id);
@@ -29,3 +29,4 @@ int mbag_get_upd(mbag_t b, mbag_t b_upd, const char *id, uint8_t *dst, int *foun
return -1;
}
+*/
\ No newline at end of file
diff --git a/src/cw/mbag_set_from_buf.c b/src/cw/mbag_set_from_buf.c
deleted file mode 100644
index 89504ec8..00000000
--- a/src/cw/mbag_set_from_buf.c
+++ /dev/null
@@ -1,54 +0,0 @@
-#include "mbag.h"
-#include "cw.h"
-
-int mbag_set_from_buf(mbag_t dst, mbagtype_t type, const char *item_id, uint8_t *data, int len)
-{
-/*
- if (type == MBAG_BYTE) {
- mbag_set_byte(dst, item_id, *data);
- return 1;
- }
- if (type == MBAG_WORD) {
- mbag_set_word(dst, item_id, cw_get_word(data));
- return 1;
- }
- if (type == MTYPE_DWORD) {
- mbag_set_dword(dst, item_id, cw_get_dword(data));
- return 1;
- }
- if (type == MBAG_STR) {
- mbag_set_strn(dst, item_id, (char *) data, len);
- return 1;
- }
- if (type == MBAG_BSTR) {
- mbag_set_bstrn(dst, item_id, data, len);
- return 1;
- }
-
- if (type == MBAG_BSTR16) {
- mbag_set_bstr16n(dst, item_id, data, len);
- return 1;
- }
-
- if (type == MBAG_VENDORSTR) {
- mbag_set_bstrv(dst, item_id,
- cw_get_dword(data), data + 4, len - 4);
- return 1;
- }
-
- if (type->get){
- struct mbag_item * item = type->get(data,len);
- if (!item)
- return 0;
- item->u1.id=item_id;
- mbag_set(dst,item);
- return 1;
-
-
- }
-*/
- return 0;
-
-}
-
-
diff --git a/src/cw/mbag_type_bstr16.c b/src/cw/mbag_type_bstr16.c
deleted file mode 100644
index bfee2b18..00000000
--- a/src/cw/mbag_type_bstr16.c
+++ /dev/null
@@ -1,60 +0,0 @@
-
-#include "mbag.h"
-#include "format.h"
-
-
-
-static int to_str(void *item,char *dst)
-{
- mbag_item_t *i= item;
-
- char *d = dst;
- int utf8 = format_is_utf8(bstr16_data(i->u2.data), bstr16_len(i->u2.data));
-
-
- if (utf8) {
- d += sprintf(d, "%.*s", bstr16_len(i->u2.data), bstr16_data(i->u2.data));
- } else {
- d += sprintf(d, ".x");
- d += format_hex(d, bstr16_data(i->u2.data), bstr16_len(i->u2.data));
- }
- return d-dst;
-}
-
-
-static struct mbag_item * from_str(const char *src)
-{
- mbag_item_t * i = mbag_item_new(MBAG_BSTR16);
- if (!i)
- return NULL;
- i->u2.data=bstr16_create_from_str(src);
-
- return i;
-}
-
-int put(struct mbag_item *i, uint8_t *dst)
-{
- int l = bstr16_len(i->u2.data);
- memcpy(dst,bstr16_data(i->u2.data),l);
- return l;
-}
-
-static struct mbag_item * get(const uint8_t *src, int len)
-{
- mbag_item_t * i = mbag_item_new(MBAG_BSTR16);
- if (!i)
- return NULL;
- i->u2.data=bstr16_create(src,len);
- return i;
-
-}
-
-
-const struct mbag_typedef mbag_type_bstr16 = {
- .name = "Bstr16",
- .del = free,
- .to_str = to_str,
- .from_str = from_str,
- .get = get,
- .put = put
-};
diff --git a/src/cw/mbag_type_byte.c b/src/cw/mbag_type_byte.c
deleted file mode 100644
index 2e94f77f..00000000
--- a/src/cw/mbag_type_byte.c
+++ /dev/null
@@ -1,66 +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 "cw.h"
-#include "mbag.h"
-
-
-static struct mbag_item * from_str(const char *src)
-{
- mbag_item_t * i = mbag_item_new(MBAG_BYTE);
- if (!i)
- return NULL;
- i->u2.byte=atoi(src);
- return i;
-}
-
-static int to_str(void *item,char *dst)
-{
- mbag_item_t *i= item;
- return sprintf(dst, "%d", i->u2.byte);
-}
-
-static struct mbag_item * get(const uint8_t *src,int len)
-{
- mbag_item_t * item = mbag_item_new(MBAG_BYTE);
- if (!item)
- return NULL;
- item->u2.byte=*src;
- return item;
-}
-
-
-static int put(struct mbag_item * i, uint8_t *dst)
-{
- return cw_put_byte(dst,i->u2.byte);
-}
-
-/** Defines a word, two bytes. */
-const struct mbag_typedef mbag_type_byte = {
- .name = "Byte",
- .del = NULL,
- .to_str = to_str,
- .from_str = from_str,
- .get = get,
- .put = put
-
-
-
-};
-
-
diff --git a/src/cw/mbag_type_data.c b/src/cw/mbag_type_data.c
deleted file mode 100644
index 66225d13..00000000
--- a/src/cw/mbag_type_data.c
+++ /dev/null
@@ -1,73 +0,0 @@
-
-#include
-
-#include "mbag.h"
-#include "format.h"
-
-
-
-static int to_str(void *item,char *dst)
-{
- mbag_item_t *i= item;
- return format_hex(dst, ((uint8_t*)i->u2.data)+1, *((uint8_t*)i->u2.data));
-}
-
-
-static struct mbag_item * from_str(const char *src)
-{
-
- mbag_item_t * i = mbag_item_new(MBAG_DATA);
- if (!i)
- return NULL;
-
-
- int l=strlen(src);
- int msize=l/2;
- if(l&1)
- msize++;
- uint8_t * mem = malloc(1+msize);
- if (!mem)
- return NULL;
-
- *(mem)=msize;
- cw_format_scan_hex_bytes(mem+1,src,l);
- i->u2.data=mem;
- return i;
-
-}
-
-static struct mbag_item * get(const uint8_t *src,int len)
-{
-
- mbag_item_t * item = mbag_item_new(MBAG_DATA);
- if (!item)
- return NULL;
-
- uint8_t *data = malloc(len+1);
- if (!data){
- free (item);
- return NULL;
- }
- *data=len;
- memcpy(data+1,src,len);
- item->u2.data=data;
- return item;
-}
-
-static int put(struct mbag_item *i,uint8_t *dst)
-{
- int l = *((uint8_t*)i->u2.data);
- memcpy(dst,i->u2.data+1,l);
- return l;
-}
-
-
-const struct mbag_typedef mbag_type_data = {
- .name = "Binary Data",
- .del = free,
- .from_str = from_str,
- .to_str = to_str,
- .get = get,
- .put = put
-
-};
diff --git a/src/cw/mbag_type_dword.c b/src/cw/mbag_type_dword.c
deleted file mode 100644
index 221ddd0f..00000000
--- a/src/cw/mbag_type_dword.c
+++ /dev/null
@@ -1,63 +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 "cw.h"
-#include "mbag.h"
-
-
-static struct mbag_item * from_str(const char *src)
-{
- mbag_item_t * i = mbag_item_new(MTYPE_DWORD);
- if (!i)
- return NULL;
- i->u2.dword=atoi(src);
- return i;
-}
-
-static int to_str(void *item,char *dst)
-{
- mbag_item_t *i= item;
- return sprintf(dst, "%d", i->u2.dword);
-}
-
-static struct mbag_item * get(const uint8_t *src,int len)
-{
- mbag_item_t * item = mbag_item_new(MTYPE_DWORD);
- if (!item)
- return NULL;
- item->u2.dword=cw_get_dword(src);
- return item;
-}
-
-
-static int put(struct mbag_item * i, uint8_t *dst)
-{
- return cw_put_dword(dst,i->u2.dword);
-}
-
-
-const struct mbag_typedef mtype_dword = {
- .name = "Dword",
- .del = NULL,
- .to_str = to_str,
- .from_str = from_str,
- .get = get,
- .put = put
-};
-
-
diff --git a/src/cw/mbag_type_mbag.c b/src/cw/mbag_type_mbag.c
deleted file mode 100644
index b6648a88..00000000
--- a/src/cw/mbag_type_mbag.c
+++ /dev/null
@@ -1,36 +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 "mbag.h"
-
-static void del_fun(void *i)
-{
- mbag_t x = (mbag_t)i;
- mavl_destroy(x);
-}
-
-const struct mbag_typedef mbag_type_mbag = {
- "Mbag",del_fun
-};
-
-const struct mbag_typedef mbag_type_mbag_dyn = {
- "Mbag_Dyn",del_fun
-};
-
-
diff --git a/src/cw/mbag_type_ptr.c b/src/cw/mbag_type_ptr.c
deleted file mode 100644
index fc0977a4..00000000
--- a/src/cw/mbag_type_ptr.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "mbag.h"
-
-const struct mbag_typedef mbag_type_ptr = {
- "Ptr",free
-};
-
-
diff --git a/src/cw/mbag_type_sockaddr.c b/src/cw/mbag_type_sockaddr.c
deleted file mode 100644
index 786b5d55..00000000
--- a/src/cw/mbag_type_sockaddr.c
+++ /dev/null
@@ -1,36 +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 .
-
-*/
-
-/**
- * @file
- * @brief Implementation of mbag_type_sockaddr
- * @addtogroup MbagFunctions
- * @{
- */
-
-#include "mbag.h"
-
-/**
- * MBAG items of this type hold an struct sockaddr element.
- */
-const struct mbag_typedef mbag_type_sockaddr = {
- "SocakAddr",free,
-};
-
-
-/**@}*/
diff --git a/src/cw/mbag_type_str.c b/src/cw/mbag_type_str.c
deleted file mode 100644
index 9ab54440..00000000
--- a/src/cw/mbag_type_str.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "mbag.h"
-
-static int to_str(void *item,char *dst)
-{
- mbag_item_t *i= item;
- return sprintf(dst, "%s", (char*)i->u2.data);
-}
-
-static struct mbag_item * from_str(const char *src)
-{
- struct mbag_item *i= malloc(sizeof(mbag_item_t));
- if (!i)
- return NULL;
-
- i->type = MBAG_STR;
- i->dynid=0;
- i->u2.data = strndup(src,2000);
- return i;
-}
-
-
-const struct mbag_typedef mbag_type_str = {
- "Sstr",free,to_str,from_str
-};
-
-
diff --git a/src/cw/mbag_type_word.c b/src/cw/mbag_type_word.c
deleted file mode 100644
index de72c407..00000000
--- a/src/cw/mbag_type_word.c
+++ /dev/null
@@ -1,64 +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 "cw.h"
-#include "mbag.h"
-
-
-static struct mbag_item * from_str(const char *src)
-{
- mbag_item_t * i = mbag_item_new(MBAG_WORD);
- if (!i)
- return NULL;
- i->u2.word=atoi(src);
- return i;
-}
-
-static int to_str(void *item,char *dst)
-{
- mbag_item_t *i= item;
- return sprintf(dst, "%d", i->u2.word);
-}
-
-static struct mbag_item * get(const uint8_t *src,int len)
-{
- mbag_item_t * item = mbag_item_new(MBAG_WORD);
- if (!item)
- return NULL;
- item->u2.word=cw_get_word(src);
- return item;
-}
-
-
-static int put(struct mbag_item * i, uint8_t *dst)
-{
- return cw_put_word(dst,i->u2.word);
-}
-
-
-/** Defines a word, two bytes. */
-const struct mbag_typedef mbag_type_word = {
- .name = "Word",
- .del = NULL,
- .to_str = to_str,
- .from_str = from_str,
- .get = get,
- .put = put
-};
-
-
diff --git a/src/cw/mod.c b/src/cw/mod.c
index 1a0e4165..0f634b4c 100644
--- a/src/cw/mod.c
+++ b/src/cw/mod.c
@@ -25,7 +25,7 @@
#include
#include
-#include "mbag.h"
+
#include "mavl.h"
#include "dbg.h"
#include "log.h"
diff --git a/src/cw/netconn.c b/src/cw/netconn.c
index 2f3b32fa..91009492 100644
--- a/src/cw/netconn.c
+++ b/src/cw/netconn.c
@@ -20,7 +20,7 @@
#include
#include
-#include "mbag.h"
+
#include "sock.h"
#include "netconn.h"
#include "log.h"
diff --git a/src/cw/radio.c b/src/cw/radio.c
index dd0f3d0e..4460ca17 100644
--- a/src/cw/radio.c
+++ b/src/cw/radio.c
@@ -1,6 +1,5 @@
-
-
+/*
#include "radio.h"
#include "dbg.h"
@@ -16,7 +15,7 @@ const char CW_RADIO_SUPPORTED_RATES[]="supported_rates";
-/* Cisco */
+// Cisco
const char CW_RADIO_OCCUPANCY_LIMIT[]="occupancy_limit";
const char CW_RADIO_CFP_PERIOD[]="cfp_period";
@@ -52,3 +51,4 @@ int cw_radio_set_all_admin_states(mbag_t radios,int state, int cause)
+*/
\ No newline at end of file
diff --git a/src/cw/radio.h b/src/cw/radio.h
index 196acdd8..b011eca0 100644
--- a/src/cw/radio.h
+++ b/src/cw/radio.h
@@ -1,8 +1,8 @@
#ifndef __CW_RADIO_H
#define __CW_RADIO_H
-#include "mbag.h"
-#include "item.h"
+
+
#include "conn.h"
@@ -50,13 +50,13 @@ enum radiodata{
*/
-
+/*
int cw_radio_update_oper_states(mbag_t radios,int cause);
extern struct cw_itemdef capwap_radioitemdefs[];
extern int cw_radio_set_all_admin_states(mbag_t radios,int state, int cause);
int cw_out_80211_supported_rates(struct conn *conn, struct cw_action_out *a, uint8_t * dst);
-
+*/
#endif
diff --git a/src/cw/send.c b/src/cw/send.c
index 721fbd99..1b028ada 100644
--- a/src/cw/send.c
+++ b/src/cw/send.c
@@ -1,6 +1,6 @@
#include
-#include "mbag.h"
+
#include "conn.h"
#include "cw.h"
#include "log.h"
diff --git a/src/mod/capwap/capwap_in_session_id.c b/src/mod/capwap/capwap_in_session_id.c
index b9d6c87b..da5d2989 100644
--- a/src/mod/capwap/capwap_in_session_id.c
+++ b/src/mod/capwap/capwap_in_session_id.c
@@ -1,13 +1,11 @@
-#include "cw/mbag.h"
-#include "cw/action.h"
-
+/*
int capwap_in_session_id(struct conn *conn, struct cw_action_in *a, uint8_t * data,
int len, struct sockaddr *from){
memcpy(conn->session_id,data,len);
return 1;
}
-
+*/
diff --git a/src/mod/capwap/capwap_out_ac_descriptor.c b/src/mod/capwap/capwap_out_ac_descriptor.c
index f22d3c72..c9ffb380 100644
--- a/src/mod/capwap/capwap_out_ac_descriptor.c
+++ b/src/mod/capwap/capwap_out_ac_descriptor.c
@@ -1,9 +1,9 @@
-#include "cw/mbag.h"
+
#include "cw/log.h"
#include "cw/conn.h"
-#include "cw/mbag.h"
-#include "cw/capwap_items.h"
+
+
#include "cw/capwap.h"
diff --git a/src/mod/capwap/capwap_out_ac_ip_list.c b/src/mod/capwap/capwap_out_ac_ip_list.c
index 791e0fd3..725e259d 100644
--- a/src/mod/capwap/capwap_out_ac_ip_list.c
+++ b/src/mod/capwap/capwap_out_ac_ip_list.c
@@ -2,8 +2,8 @@
-#include "cw/mbag.h"
-#include "cw/action.h"
+
+
#include "cw/cw.h"
#include "cw/mavl.h"
diff --git a/src/mod/capwap/capwap_out_get_idle_timeout.c b/src/mod/capwap/capwap_out_get_idle_timeout.c
index 4cc94cc4..c40a4de1 100644
--- a/src/mod/capwap/capwap_out_get_idle_timeout.c
+++ b/src/mod/capwap/capwap_out_get_idle_timeout.c
@@ -1,10 +1,10 @@
-#include "cw/mbag.h"
-#include "cw/action.h"
-#include "cw/capwap_items.h"
+
+
+
#include "cw/capwap.h"
-
+/*
struct mbag_item * capwap_out_get_idle_timeout(struct conn *conn,struct cw_action_out * a)
{
struct mbag_item * m = mbag_get(conn->config,CW_ITEM_IDLE_TIMEOUT);
@@ -13,9 +13,9 @@ struct mbag_item * capwap_out_get_idle_timeout(struct conn *conn,struct cw_actio
return mbag_set_dword(conn->config,CW_ITEM_IDLE_TIMEOUT,CAPWAP_IDLE_TIMEOUT);
}
+*/
-
-
+/*
struct mbag_item * capwap_out_get_capwap_timers(struct conn *conn,struct cw_action_out * a)
{
struct mbag_item * m = mbag_get(conn->local,CW_ITEM_CAPWAP_TIMERS);
@@ -24,3 +24,4 @@ struct mbag_item * capwap_out_get_capwap_timers(struct conn *conn,struct cw_acti
return mbag_set_word(conn->local,CW_ITEM_CAPWAP_TIMERS,CW_MAX_DISCOVERY_INTERVAL<<8 | CAPWAP_ECHO_INTERVAL);
}
+*/
\ No newline at end of file
diff --git a/src/mod/capwap/capwap_out_get_session_id.c b/src/mod/capwap/capwap_out_get_session_id.c
index 2f23c3e5..6557adcd 100644
--- a/src/mod/capwap/capwap_out_get_session_id.c
+++ b/src/mod/capwap/capwap_out_get_session_id.c
@@ -1,10 +1,10 @@
-#include "cw/mbag.h"
+
#include "cw/conn.h"
#include "cw/rand.h"
#include "cw/log.h"
-#include "cw/capwap_items.h"
+/*
struct mbag_item * capwap_out_get_session_id(struct conn *conn,struct cw_action_out * a)
{
uint8_t session_id[16];
@@ -18,4 +18,4 @@ struct mbag_item * capwap_out_get_session_id(struct conn *conn,struct cw_action_
}
return mbag_set_bstrn(conn->local,CW_ITEM_SESSION_ID,session_id,slen);
}
-
+*/
diff --git a/src/wtp/discovery.c b/src/wtp/discovery.c
index 45107a09..23bf01d1 100644
--- a/src/wtp/discovery.c
+++ b/src/wtp/discovery.c
@@ -39,6 +39,7 @@ static int run_discovery(struct conn *conn)
timer = cw_timer_start(0);
+/*
while (!cw_timer_timeout(timer)
&& conn->capwap_state == CAPWAP_STATE_DISCOVERY) {
int rc;
@@ -54,6 +55,7 @@ static int run_discovery(struct conn *conn)
break;
}
}
+*/
/*
mbag_t discs;