Got rid of mbag! Works for mod_capwap and wtp
FossilOrigin-Name: af10cb591d1e6db629c886cdbb268a2753bb93012e410e42f65b8385befb9896
This commit is contained in:
parent
5edd4ab621
commit
b0b08c1f7c
@ -3,9 +3,9 @@
|
||||
<Project Name="ac" Path="ac.project" Active="No"/>
|
||||
<Project Name="wtp" Path="wtp.project" Active="No"/>
|
||||
<Project Name="mod_cipwap" Path="mod_cipwap.project" Active="No"/>
|
||||
<Project Name="mod_capwap" Path="mod_capwap.project" Active="No"/>
|
||||
<Project Name="mod_capwap" Path="mod_capwap.project" Active="Yes"/>
|
||||
<Project Name="mod_cisco" Path="mod_cisco.project" Active="No"/>
|
||||
<Project Name="libcw" Path="libcw.project" Active="Yes"/>
|
||||
<Project Name="libcw" Path="libcw.project" Active="No"/>
|
||||
<Project Name="mod_capwap80211" Path="mod_capwap80211.project" Active="No"/>
|
||||
<Project Name="mod_fortinet" Path="mod_fortinet.project" Active="No"/>
|
||||
<BuildMatrix>
|
||||
|
@ -8,7 +8,6 @@
|
||||
<File Name="src/cw/conn.h"/>
|
||||
<File Name="src/cw/dot11.c"/>
|
||||
<File Name="src/cw/conn_clear_upd.c"/>
|
||||
<File Name="src/cw/mbag_type_dword.c"/>
|
||||
<File Name="src/cw/sock_getport.c"/>
|
||||
<File Name="src/cw/dtls_gnutls_get_peers_cert.c"/>
|
||||
<File Name="src/cw/conn_process_packet.c"/>
|
||||
@ -36,22 +35,17 @@
|
||||
<File Name="src/cw/cw_is_printable.c"/>
|
||||
<File Name="src/cw/sock_getifaddr.c"/>
|
||||
<File Name="src/cw/bstr_create.c"/>
|
||||
<File Name="src/cw/cw_put_mbag_item.c"/>
|
||||
<File Name="src/cw/conn_get_response.c"/>
|
||||
<File Name="src/cw/dtls_bio.c"/>
|
||||
<File Name="src/cw/rand.h"/>
|
||||
<File Name="src/cw/capwap_items.h"/>
|
||||
<File Name="src/cw/mbag_type_bstr.c"/>
|
||||
<File Name="src/cw/cw_in_cisco_image_identifier.c"/>
|
||||
<File Name="src/cw/radioinfo.h"/>
|
||||
<File Name="src/cw/capwap80211.h"/>
|
||||
<File Name="src/cw/conn_init.c"/>
|
||||
<File Name="src/cw/item_strings.c"/>
|
||||
<File Name="src/cw/capwap_actions.h"/>
|
||||
<File Name="src/cw/strheap.h"/>
|
||||
<File Name="src/cw/mbag_type_mbag.c"/>
|
||||
<File Name="src/cw/cw_in_check_join_req.c"/>
|
||||
<File Name="src/cw/mbag.c"/>
|
||||
<File Name="src/cw/cw_put_radio_operational_states.c"/>
|
||||
<File Name="src/cw/conn_wait_for_message.c"/>
|
||||
<File Name="src/cw/cw_util.h"/>
|
||||
@ -78,7 +72,6 @@
|
||||
<File Name="src/cw/lw_put_cisco_path_mtu.c"/>
|
||||
<File Name="src/cw/conn_get_message.c"/>
|
||||
<File Name="src/cw/cw_readelem_maximum_message_length.c"/>
|
||||
<File Name="src/cw/capwap_msg_new.c"/>
|
||||
<File Name="src/cw/cw_in_radio_administrative_state_wtp.c"/>
|
||||
<File Name="src/cw/cw_read_descriptor_subelems.c"/>
|
||||
<File Name="src/cw/log_file.c"/>
|
||||
@ -93,11 +86,9 @@
|
||||
<File Name="src/cw/cw_in_capwap_local_ipv6_address.c"/>
|
||||
<File Name="src/cw/cw_out_capwap_local_ip_address.c"/>
|
||||
<File Name="src/cw/cw_out_wtp_descriptor.c"/>
|
||||
<File Name="src/cw/cw_in_check_img_data_resp.c"/>
|
||||
<File Name="src/cw/capwap_action_helpers.c"/>
|
||||
<File Name="src/cw/conn_send_data_packet.c"/>
|
||||
<File Name="src/cw/cw_in_capwap_control_ip_address.c"/>
|
||||
<File Name="src/cw/cipwap_strings_elem.c"/>
|
||||
<File Name="src/cw/cw_radio_set_admin_state.c"/>
|
||||
<File Name="src/cw/conn_recv_packet.c"/>
|
||||
<File Name="src/cw/lw_readelem_80211_wtp_wlan_radio_configuration.c"/>
|
||||
@ -117,13 +108,10 @@
|
||||
<File Name="src/cw/bstr_create_from_cfgstr.c"/>
|
||||
<File Name="src/cw/sock_getifhwaddr.c"/>
|
||||
<File Name="src/cw/conn_send_packet.c"/>
|
||||
<File Name="src/cw/mbag_type_bstr16.c"/>
|
||||
<File Name="src/cw/cipwap.h"/>
|
||||
<File Name="src/cw/cw_in_check_join_resp.c"/>
|
||||
<File Name="src/cw/cw_in_80211_mac_operation.c"/>
|
||||
<File Name="src/cw/capwap_strings_board.c"/>
|
||||
<File Name="src/cw/capwap_80211_actions_ac.c"/>
|
||||
<File Name="src/cw/mbag.h"/>
|
||||
<File Name="src/cw/sock_addrlen.c"/>
|
||||
<File Name="src/cw/cw_load_file.c"/>
|
||||
<File Name="src/cw/sock_copyaddr.c"/>
|
||||
@ -141,18 +129,12 @@
|
||||
<File Name="src/cw/sock_cmpaddr.c"/>
|
||||
<File Name="src/cw/cw_in_radio_administrative_state.c"/>
|
||||
<File Name="src/cw/cwmsg_addelem_80211_add_wlan.c"/>
|
||||
<File Name="src/cw/cw_in_check_generic_req.c"/>
|
||||
<File Name="src/cw/dot11.h"/>
|
||||
<File Name="src/cw/item.h"/>
|
||||
<File Name="src/cw/cw_in_check_generic_resp.c"/>
|
||||
<File Name="src/cw/capwap80211_items.h"/>
|
||||
<File Name="src/cw/cw_in_ac_descriptor.c"/>
|
||||
<File Name="src/cw/mavl_foreach_lr.c"/>
|
||||
<File Name="src/cw/mbag_type_bin.c"/>
|
||||
<File Name="src/cw/mavl_get.c"/>
|
||||
<File Name="src/cw/sock_setport.c"/>
|
||||
<File Name="src/cw/mbag_type_word.c"/>
|
||||
<File Name="src/cw/mbag_type_byte.c"/>
|
||||
<File Name="src/cw/cw_strlist_get_id.c"/>
|
||||
<File Name="src/cw/sock.h"/>
|
||||
<File Name="src/cw/aciplist.c"/>
|
||||
@ -199,7 +181,6 @@
|
||||
<File Name="src/cw/cw_out_capwap_control_ip_addr_list.c"/>
|
||||
<File Name="src/cw/bstrv_create_from_str.c"/>
|
||||
<File Name="src/cw/cw_out_wtp_ip_address.c"/>
|
||||
<File Name="src/cw/mbag_set_from_buf.c"/>
|
||||
<File Name="src/cw/dtls_openssl_bio.c"/>
|
||||
<File Name="src/cw/cw_in_generic.c"/>
|
||||
<File Name="src/cw/cw_rand.c"/>
|
||||
@ -208,10 +189,6 @@
|
||||
<File Name="src/cw/cw_out_image_data.c"/>
|
||||
<File Name="src/cw/cw_readelem_80211_wtp_radio_info.c"/>
|
||||
<File Name="src/cw/connlist.h"/>
|
||||
<File Name="src/cw/mbag_type_data.c"/>
|
||||
<File Name="src/cw/item.c"/>
|
||||
<File Name="src/cw/mbag_type_sockaddr.c"/>
|
||||
<File Name="src/cw/action.c"/>
|
||||
<File Name="src/cw/strheap.c"/>
|
||||
<File Name="src/cw/dtls_gnutls_connect.c"/>
|
||||
<File Name="src/cw/fragman.c"/>
|
||||
@ -239,11 +216,8 @@
|
||||
<File Name="src/cw/sock_create.c"/>
|
||||
<File Name="src/cw/lw_readelem_wtp_board_data.c"/>
|
||||
<File Name="src/cw/cwmsg_addelem_vendor_cisco_mwar_addr.c"/>
|
||||
<File Name="src/cw/action.h"/>
|
||||
<File Name="src/cw/sock_get_primary_if.c"/>
|
||||
<File Name="src/cw/netconn.h"/>
|
||||
<File Name="src/cw/mbag_type_ptr.c"/>
|
||||
<File Name="src/cw/capwap80211_items.c"/>
|
||||
<File Name="src/cw/capwap_strings_elem.c"/>
|
||||
<File Name="src/cw/connlist.c"/>
|
||||
<File Name="src/cw/lw_put_80211_wtp_wlan_radio_configuration.c"/>
|
||||
@ -263,9 +237,7 @@
|
||||
<File Name="src/cw/mavl_foreach.c"/>
|
||||
<File Name="src/cw/lwapp_cisco.h"/>
|
||||
<File Name="src/cw/hdr_print.c"/>
|
||||
<File Name="src/cw/mbag_type_str.c"/>
|
||||
<File Name="src/cw/cw_init_data_keep_alive_msg.c"/>
|
||||
<File Name="src/cw/cw_in_check_chng_state_evnt_req.c"/>
|
||||
<File Name="src/cw/capwap_strings_item.c"/>
|
||||
<File Name="src/cw/cw_out_ac_name_with_priority.c"/>
|
||||
<File Name="src/cw/conn_send_request.c"/>
|
||||
@ -276,7 +248,6 @@
|
||||
<File Name="src/cw/capwap_crypto.h"/>
|
||||
<File Name="src/cw/capwap_strings_state.c"/>
|
||||
<File Name="src/cw/cw_out_radio_info.c"/>
|
||||
<File Name="src/cw/capwap_items.c"/>
|
||||
<File Name="src/cw/cw_filename.c"/>
|
||||
<File Name="src/cw/cw_type_byte.c"/>
|
||||
<File Name="src/cw/cw_type_word.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;
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define __ACIPRIORITYLIST_H
|
||||
|
||||
#include "mavl.h"
|
||||
#include "mbag.h"
|
||||
|
||||
|
||||
/**
|
||||
* Used to store AC Name With Priority elements.
|
||||
|
333
src/cw/action.c
333
src/cw/action.c
@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief Implementation of methods for actionlists.
|
||||
*/
|
||||
|
||||
#include "mbag.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
203
src/cw/action.h
203
src/cw/action.h
@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief CAPWAP ACtions Header
|
||||
* @defgroup ACTION CAPWAP/LWAPP Actions
|
||||
* @{
|
||||
*/
|
||||
#ifndef __ACTION_H
|
||||
#define __ACTION_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#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
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "mbag.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <arpa/inet.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);
|
||||
|
@ -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}
|
||||
};
|
@ -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
|
||||
|
@ -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
|
||||
};
|
||||
*/
|
||||
|
@ -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
|
@ -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);
|
||||
}
|
||||
|
||||
*/
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
#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
|
@ -1,4 +1,4 @@
|
||||
#include "mbag.h"
|
||||
|
||||
#include "capwap.h"
|
||||
|
||||
|
||||
|
@ -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}
|
||||
};
|
@ -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
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
#include "mbag.h"
|
||||
#include "capwap.h"
|
||||
|
||||
struct capwap_msg * capwap_msg_new()
|
||||
{
|
||||
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
#include "mbag.h"
|
||||
|
||||
#include "capwap.h"
|
||||
|
||||
struct cw_strlist_elem capwap_strings_board[] = {
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "mbag.h"
|
||||
|
||||
#include "capwap.h"
|
||||
|
||||
struct cw_strlist_elem capwap_strings_elem[] = {
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "mbag.h"
|
||||
|
||||
#include "capwap80211.h"
|
||||
#include "strlist.h"
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
* @file
|
||||
* @brief Definition of CAPWAP Message Strings
|
||||
*/
|
||||
#include "mbag.h"
|
||||
|
||||
#include "capwap.h"
|
||||
|
||||
/**
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "mbag.h"
|
||||
|
||||
#include "capwap.h"
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "mbag.h"
|
||||
|
||||
#include "capwap.h"
|
||||
|
||||
struct cw_strlist_elem capwap_strings_state[] = {
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "mbag.h"
|
||||
|
||||
#include "capwap.h"
|
||||
#include "vendors.h"
|
||||
|
||||
|
@ -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
|
||||
|
@ -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"}
|
||||
|
||||
};
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
@ -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];
|
||||
|
||||
|
@ -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)
|
||||
|
||||
}
|
||||
|
||||
*/
|
@ -25,7 +25,7 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "mbag.h"
|
||||
|
||||
#include "conn.h"
|
||||
#include "sock.h"
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "mbag.h"
|
||||
|
||||
#include "conn.h"
|
||||
|
||||
/**
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#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();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
*/
|
||||
|
||||
#include "mbag.h"
|
||||
|
||||
#include "capwap.h"
|
||||
#include "lwapp.h"
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "mbag.h"
|
||||
|
||||
#include "dbg.h"
|
||||
#include "conn.h"
|
||||
#include "sock.h"
|
||||
|
@ -15,7 +15,7 @@
|
||||
along with Foobar. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
#include "mbag.h"
|
||||
|
||||
#include <time.h>
|
||||
#include "conn.h"
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include "mbag.h"
|
||||
|
||||
#include "conn.h"
|
||||
|
||||
static int conn_q_recv_packet_(struct conn * conn, uint8_t * buffer,int len,int peek)
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "mbag.h"
|
||||
|
||||
#include "conn.h"
|
||||
|
||||
#include "sock.h"
|
||||
|
@ -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;
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
*/
|
||||
|
||||
#include "mbag.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <sys/socket.h>
|
||||
#include "sock.h"
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "mbag.h"
|
||||
|
||||
#include "conn.h"
|
||||
#include "connlist.h"
|
||||
|
||||
|
28
src/cw/cw.h
28
src/cw/cw.h
@ -4,9 +4,9 @@
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#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 );
|
||||
|
@ -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
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#include "mbag.h"
|
||||
|
||||
#include "capwap.h"
|
||||
#include "cwmsg.h"
|
||||
#include "conn.h"
|
||||
|
@ -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);
|
||||
}
|
||||
*/
|
@ -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;
|
||||
}
|
||||
*/
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
*/
|
||||
|
@ -29,12 +29,12 @@
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#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"
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
@ -6,8 +6,8 @@
|
||||
#include <netinet/in.h>
|
||||
|
||||
#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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
#include "intavltree.h"
|
||||
#include "dbg.h"
|
||||
#include "log.h"
|
||||
#include "capwap_items.h"
|
||||
|
||||
#include "bstr.h"
|
||||
#include "sock.h" //tube
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
#include "capwap.h"
|
||||
#include "capwap_items.h"
|
||||
|
||||
|
||||
#include "intavltree.h"
|
||||
#include "log.h"
|
||||
|
@ -1,8 +1,8 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include "mbag.h"
|
||||
|
||||
#include "capwap.h"
|
||||
#include "capwap_items.h"
|
||||
|
||||
#include "intavltree.h"
|
||||
#include "log.h"
|
||||
#include "dbg.h"
|
||||
|
@ -1,27 +0,0 @@
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#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;
|
||||
|
||||
}
|
@ -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)
|
||||
|
@ -1,11 +1,11 @@
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#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,
|
||||
|
@ -4,10 +4,10 @@
|
||||
#include "capwap.h"
|
||||
#include "dbg.h"
|
||||
#include "log.h"
|
||||
#include "capwap_items.h"
|
||||
|
||||
#include <unistd.h> //Tube
|
||||
|
||||
#include <unistd.h>
|
||||
/*
|
||||
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;
|
||||
*/
|
||||
/*
|
||||
}
|
||||
*/
|
||||
|
@ -1,35 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#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;
|
||||
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
#include "intavltree.h"
|
||||
#include "dbg.h"
|
||||
#include "log.h"
|
||||
#include "capwap_items.h"
|
||||
|
||||
#include "format.h"
|
||||
#include "connlist.h"
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
*/
|
@ -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);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
*/
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
*/
|
@ -1,7 +1,7 @@
|
||||
|
||||
|
||||
#include "cw.h"
|
||||
#include "capwap_items.h"
|
||||
|
||||
|
||||
#include "dbg.h"
|
||||
#include "log.h"
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
*/
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include <string.h>
|
||||
#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);
|
||||
}
|
||||
|
||||
*/
|
@ -1,6 +1,6 @@
|
||||
|
||||
#include "cw.h"
|
||||
#include "capwap_items.h"
|
||||
|
||||
|
||||
#include "dbg.h"
|
||||
#include "log.h"
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include "cw.h"
|
||||
#include "capwap_items.h"
|
||||
|
||||
|
||||
#include "log.h"
|
||||
#include "dbg.h"
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
@ -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;
|
||||
|
||||
}
|
||||
*/
|
@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include <string.h>
|
||||
#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);
|
||||
}
|
||||
*/
|
@ -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);
|
||||
}
|
||||
*/
|
@ -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);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "mbag.h"
|
||||
#include "log.h"
|
||||
#include "dbg.h"
|
||||
#include "cw.h"
|
||||
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* @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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
//}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
*/
|
@ -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,
|
||||
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "cw.h"
|
||||
|
||||
#include "capwap.h"
|
||||
#include "capwap_items.h"
|
||||
|
||||
#include "dbg.h"
|
||||
#include "ktv.h"
|
||||
#include "keys.h"
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "cw.h"
|
||||
|
||||
#include "capwap.h"
|
||||
#include "capwap_items.h"
|
||||
|
||||
#include "ktv.h"
|
||||
#include "keys.h"
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
*/
|
@ -18,7 +18,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "mbag.h"
|
||||
|
||||
#include "capwap.h"
|
||||
#include "conn.h"
|
||||
#include "cwmsg.h"
|
||||
|
@ -25,7 +25,7 @@
|
||||
*/
|
||||
#include <stdarg.h>
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -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, ...);
|
||||
|
@ -22,7 +22,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "mbag.h"
|
||||
|
||||
#include "dbg.h"
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include <stdarg.h>
|
||||
#include "debug.h"
|
||||
#include "mbag.h"
|
||||
|
||||
#include "dbg.h"
|
||||
#include "log.h"
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include "mbag.h"
|
||||
|
||||
#include "log.h"
|
||||
#include "dbg.h"
|
||||
#include "dtls.h"
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include <gnutls/gnutls.h>
|
||||
#include <gnutls/dtls.h>
|
||||
|
||||
#include "mbag.h"
|
||||
|
||||
#include "dtls_common.h"
|
||||
#include "dtls_gnutls.h"
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include <gnutls/dtls.h>
|
||||
|
||||
|
||||
#include "mbag.h"
|
||||
|
||||
#include "conn.h"
|
||||
#include "dbg.h"
|
||||
#include "log.h"
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user