More WTP functions.
FossilOrigin-Name: d911169da02fad41102ebdbd34b7533d78a39bb3c452d4174269ba7e3c825c53
This commit is contained in:
parent
f1feb4bc0d
commit
2ac7210734
9
INSTALL
9
INSTALL
@ -1,6 +1,15 @@
|
||||
pre-requisites
|
||||
--------------
|
||||
|
||||
On a fresh Ubuntu 14.04:
|
||||
|
||||
apt-get install git
|
||||
git clone https://github.com/7u83/actube.git
|
||||
apt-get install build-essential
|
||||
|
||||
|
||||
|
||||
|
||||
libcapwap:
|
||||
|
||||
gnutls (http://www.gnutls.org/)
|
||||
|
@ -108,6 +108,40 @@ AP = RAD = WTP
|
||||
*/
|
||||
|
||||
|
||||
|
||||
54. Cisco AP Mode and Type
|
||||
|
||||
The AP Mode and Type message element is used to configure a WTP to
|
||||
operate in a specific mode.
|
||||
|
||||
0 1
|
||||
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Mode | Type |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
|
||||
Type: 54 for AP Mode and Type
|
||||
|
||||
Length: 2
|
||||
|
||||
Mode: An 8-bit value describing the type of information being sent.
|
||||
The following values are supported:
|
||||
|
||||
0 - Split MAC / Local Mode
|
||||
1 - Monitor
|
||||
2 - Local MAC / FlexConnect
|
||||
3 - Rogue Detector
|
||||
4 - Sniffer
|
||||
|
||||
Type: AP Type
|
||||
|
||||
0 - ?
|
||||
4 - ?
|
||||
|
||||
|
||||
|
||||
|
||||
83. Cisco AP IP Address
|
||||
The IPv4 configuration of the WTP
|
||||
|
||||
@ -168,6 +202,10 @@ AP = RAD = WTP
|
||||
containing the AC name, whose maximum size MUST NOT exceed 512
|
||||
bytes.
|
||||
|
||||
108. Cisco Mesh Stats
|
||||
|
||||
|
||||
|
||||
125. SPAM AP LED State
|
||||
0
|
||||
0 1 2 3 4 5 6 7
|
||||
@ -245,12 +283,17 @@ AP = RAD = WTP
|
||||
0 1 2 3
|
||||
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| ANT Type | Reserved | AP Type | Join Priority |
|
||||
| ANT Type | FlexConnect | AP Type | Join Priority |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
Type: 207
|
||||
Length: 4
|
||||
|
||||
FlexConnect:
|
||||
00 = FlexConnect not supported
|
||||
01 = FlexConnect supported
|
||||
|
||||
|
||||
|
||||
208. Cisco MWAR Type
|
||||
|
||||
@ -302,7 +345,6 @@ Length: 4
|
||||
|
||||
|
||||
|
||||
|
||||
254. Cisco SPAM AP LED Flash Config
|
||||
|
||||
|
||||
@ -353,35 +395,14 @@ Vendor spec CAPWAP | Vedor spec LWAPP | Vendor specific LWAPP data
|
||||
Length: 2
|
||||
|
||||
|
||||
67. AP Submode (LWAPP)
|
||||
0
|
||||
0 1 2 3 4 5 6 7
|
||||
+-+-+-+-+-+-+-+-+
|
||||
| Submode |
|
||||
+-+-+-+-+-+-+-+-+
|
||||
|
||||
54. Cisco AP Mode and Type (LWAPP)
|
||||
|
||||
The AP Mode and Type message element is used to configure a WTP to
|
||||
operate in a specific mode.
|
||||
|
||||
0 1
|
||||
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Mode | Type |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
|
||||
Type: 54 for AP Mode and Type
|
||||
|
||||
Length: 2
|
||||
|
||||
Mode: An 8-bit value describing the type of information being sent.
|
||||
The following values are supported:
|
||||
|
||||
0 - Split MAC / Local Mode
|
||||
1 - Monitor
|
||||
2 - Local MAC / FlexConnect
|
||||
3 - Rogue Detector
|
||||
4 - Sniffer
|
||||
|
||||
Type: AP Type
|
||||
|
||||
0 - ?
|
||||
Type: 67
|
||||
|
||||
|
||||
|
||||
|
@ -163,6 +163,7 @@ int main (int argc, const char * argv[])
|
||||
DBGX("Attention! %s","DBGX is ON!");
|
||||
|
||||
cw_register_actions_cipwap_ac(&capwap_actions);
|
||||
//cw_register_actions_capwap_80211_ac(&capwap_actions);
|
||||
|
||||
|
||||
/*
|
||||
@ -177,13 +178,12 @@ int main (int argc, const char * argv[])
|
||||
|
||||
ac_global_init();
|
||||
|
||||
/*
|
||||
db_init();
|
||||
db_start();
|
||||
db_ping();
|
||||
pthread_t alth;
|
||||
pthread_create (&alth, NULL, alive_thread, (void *)0);
|
||||
*/
|
||||
|
||||
int rc=0;
|
||||
dtls_init();
|
||||
if (!socklist_init())
|
||||
|
@ -110,7 +110,7 @@ static void wtpman_run_discovery(void *arg)
|
||||
|
||||
struct conn * conn = wtpman->conn;
|
||||
|
||||
conn->strict_capwap=1;
|
||||
conn->strict_capwap=0;
|
||||
conn->strict_hdr=1;
|
||||
|
||||
conn->capwap_mode=CW_MODE_CIPWAP;
|
||||
@ -302,7 +302,7 @@ static int wtpman_join(void *arg, time_t timer)
|
||||
|
||||
struct conn * conn = wtpman->conn;
|
||||
|
||||
conn->strict_capwap=1;
|
||||
conn->strict_capwap=0;
|
||||
conn->strict_hdr=1;
|
||||
conn->capwap_mode=CW_MODE_CIPWAP;
|
||||
|
||||
@ -414,7 +414,6 @@ static void wtpman_run(void *arg)
|
||||
|
||||
/* here the WTP has joined, now we assume an image data request
|
||||
or an configuration status request. Nothing else.
|
||||
State is Image update
|
||||
*/
|
||||
|
||||
int rc = 0;
|
||||
|
@ -325,6 +325,8 @@ CWACTION=action.o \
|
||||
cw_in_generic.o \
|
||||
cw_in_wtp_descriptor.o \
|
||||
cw_out_wtp_board_data.o \
|
||||
cw_out_ac_name_with_priority.o \
|
||||
cw_in_ac_name_with_priority.o \
|
||||
cw_out_image_data.o \
|
||||
cipwap_actions_ac.o \
|
||||
cipwap_actions_wtp.o \
|
||||
@ -357,7 +359,7 @@ O:=$(OBJS);
|
||||
OBJS:=$(patsubst %.o,$(ARCH)/%.o,$(OBJS))
|
||||
|
||||
CFLAGS = -Werror -g -O0 -D_REENTRANT -DWITH_IPV6 -DWITH_RMAC_SUPPORT -I /usr/local/include
|
||||
#CFLAGS = -Wall -O3 -D_REENTRANT -DWITH_IPV6 -DWITH_RMAC_SUPPORT -I/usr/local/include
|
||||
#CFLAGS = -Wall -Os -D_REENTRANT -DWITH_IPV6 -DWITH_RMAC_SUPPORT -I/usr/local/include
|
||||
|
||||
CFLAGS += $(GNUTLS_CFLAGS) \
|
||||
-DWITH_CW_LOG \
|
||||
|
@ -39,9 +39,18 @@ static void acprio_del(void *d)
|
||||
cw_acprio_t *p = (cw_acprio_t*)d;
|
||||
if ( p->name )
|
||||
free (p->name);
|
||||
// if ( p->addr )
|
||||
// free(p->addr);
|
||||
free(d);
|
||||
}
|
||||
|
||||
const struct mbag_typedef mbag_type_acprio = {
|
||||
acprio_del
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
cw_acpriolist_t cw_acpriolist_create()
|
||||
{
|
||||
return mavl_create(acprio_cmp, acprio_del);
|
||||
|
@ -2,13 +2,21 @@
|
||||
#define __ACIPRIORITYLIST_H
|
||||
|
||||
#include "mavl.h"
|
||||
#include "mbag.h"
|
||||
//#include "mavl.h"
|
||||
|
||||
struct cw_acprio{
|
||||
char *name;
|
||||
struct sockaddr_storage * addr;
|
||||
uint8_t prio;
|
||||
};
|
||||
|
||||
extern const struct mbag_typedef mbag_type_acprio;
|
||||
|
||||
#define MBAG_ACPRIO (&mbag_type_acprio)
|
||||
|
||||
|
||||
|
||||
typedef struct cw_acprio cw_acprio_t;
|
||||
typedef struct mavl * cw_acpriolist_t;
|
||||
|
||||
|
@ -273,7 +273,7 @@ CW_MSG_MAXMSG = 26
|
||||
#define CW_ELEM_LOCATION_DATA 28
|
||||
#define CWMSGELEM_MAXIMUM_MESSAGE_LENGTH 29
|
||||
#define CWMSGELEM_MTU_DISCOVERY_PADDING 52
|
||||
#define CWMSGELEM_RADIO_ADMINISTRATIVE_STATE 31
|
||||
#define CW_ELEM_RADIO_ADMINISTRATIVE_STATE 31
|
||||
#define CW_ELEM_RADIO_OPERATIONAL_STATE 32
|
||||
#define CW_ELEM_RESULT_CODE 33
|
||||
#define CW_ELEM_RETURNED_MESSAGE_ELEMENT 34
|
||||
@ -1101,9 +1101,18 @@ struct mbag_item *cw_out_get_config(struct conn *conn, struct cw_action_out *a);
|
||||
extern int cw_in_radio_administrative_state(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
|
||||
struct sockaddr *from);
|
||||
|
||||
int cw_out_ac_name_with_priority(struct conn *conn, struct cw_action_out *a, uint8_t * dst);
|
||||
|
||||
int cw_send_request(struct conn *conn, int msg_id);
|
||||
int cw_is_utf8(unsigned char *str, size_t len);
|
||||
|
||||
int cw_in_ac_name_with_priority(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
|
||||
struct sockaddr *from);
|
||||
|
||||
int cw_out_radio_administrative_states(struct conn *conn, struct cw_action_out *a, uint8_t * dst);
|
||||
|
||||
int cw_in_radio_administrative_state(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
|
||||
struct sockaddr *from);
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -121,7 +121,7 @@
|
||||
|
||||
#define CW_ACTION_IN_CAPWAP_CONTROL_IPV6_ADDRESS \
|
||||
CW_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS, /* Element ID*/ \
|
||||
cw_in_capwap_control_iv4p_address, 0, /* start/end callback */ \
|
||||
cw_in_capwap_control_ipv4_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 */
|
||||
@ -157,6 +157,16 @@
|
||||
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 */ \
|
||||
|
@ -59,6 +59,11 @@ cw_action_in_t capwap_actions_ac_in[] = {
|
||||
1}
|
||||
,
|
||||
|
||||
/* Element WTP Board Data */
|
||||
{0, 0, CW_STATE_CONFIGURE, CW_MSG_DISCOVERY_REQUEST, CW_ACTION_IN_WTP_BOARD_DATA,
|
||||
1}
|
||||
,
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------- */
|
||||
|
||||
@ -96,7 +101,7 @@ cw_action_in_t capwap_actions_ac_in[] = {
|
||||
|
||||
/* Message: Configuration Status Request */
|
||||
{0, 0, CW_STATE_CONFIGURE, CW_MSG_CONFIGURATION_STATUS_REQUEST, 0,
|
||||
0, cw_in_check_join_req}
|
||||
0, 0}
|
||||
,
|
||||
/* Element: AC Name */
|
||||
{0, 0, CW_STATE_CONFIGURE, CW_MSG_CONFIGURATION_STATUS_REQUEST,
|
||||
@ -112,17 +117,11 @@ cw_action_in_t capwap_actions_ac_in[] = {
|
||||
CW_ACTION_IN_WTP_REBOOT_STATISTICS, 1}
|
||||
,
|
||||
|
||||
|
||||
/* Element Vendor Specific Payload */
|
||||
{0, 0, CW_STATE_CONFIGURE, CW_MSG_CONFIGURATION_STATUS_REQUEST,
|
||||
CW_ACTION_IN_VENDOR_SPECIFIC_PAYLOAD}
|
||||
,
|
||||
|
||||
/* Element WTP Board Data */
|
||||
{0, 0, CW_STATE_CONFIGURE, CW_MSG_DISCOVERY_REQUEST, CW_ACTION_IN_WTP_BOARD_DATA,
|
||||
1}
|
||||
,
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------- */
|
||||
|
||||
@ -135,6 +134,21 @@ cw_action_in_t capwap_actions_ac_in[] = {
|
||||
0}
|
||||
,
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------- */
|
||||
|
||||
/* Message: Change State Request - in Config State */
|
||||
{0, 0, CW_STATE_CONFIGURE, CW_MSG_CHANGE_STATE_EVENT_REQUEST, 0,
|
||||
0, 0}
|
||||
,
|
||||
|
||||
/* Element: Result Code */
|
||||
{0, 0, CW_STATE_CONFIGURE, CW_MSG_CHANGE_STATE_EVENT_REQUEST,
|
||||
CW_ACTION_IN_RESULT_CODE, 1}
|
||||
,
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------- */
|
||||
|
||||
/* Message Image Data Response IN */
|
||||
@ -239,6 +253,12 @@ cw_action_out_t capwap_actions_ac_out[] = {
|
||||
,
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------------
|
||||
* Change State Event Response OUT
|
||||
*/
|
||||
|
||||
{CW_MSG_CHANGE_STATE_EVENT_RESPONSE, CW_ITEM_NONE}
|
||||
,
|
||||
|
||||
|
||||
|
||||
|
@ -39,23 +39,28 @@ cw_action_in_t capwap_actions_wtp_in[] = {
|
||||
CW_ACTION_IN_AC_DESCRIPTOR, 1}
|
||||
,
|
||||
|
||||
/* Element: AC Name */
|
||||
/* AC Name */
|
||||
{0, 0, CW_STATE_DISCOVERY, CW_MSG_DISCOVERY_RESPONSE,
|
||||
CW_ACTION_IN_AC_NAME, 1}
|
||||
,
|
||||
|
||||
/* Element CAPWAP Control IPv4 Address */
|
||||
/* CAPWAP Control IPv4 Address */
|
||||
{0, 0, CW_STATE_DISCOVERY, CW_MSG_DISCOVERY_RESPONSE,
|
||||
CW_ACTION_IN_CAPWAP_CONTROL_IPV4_ADDRESS, 1}
|
||||
,
|
||||
|
||||
/* CAPWAP Control IPv6 Address */
|
||||
{0, 0, CW_STATE_DISCOVERY, CW_MSG_DISCOVERY_RESPONSE,
|
||||
CW_ACTION_IN_CAPWAP_CONTROL_IPV6_ADDRESS, 1}
|
||||
,
|
||||
|
||||
/* Element: Vendor Specific */
|
||||
/* Vendor Specific Payload*/
|
||||
{0, 0, CW_STATE_DISCOVERY, CW_MSG_DISCOVERY_RESPONSE,
|
||||
CW_ACTION_IN_VENDOR_SPECIFIC_PAYLOAD, 0}
|
||||
,
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------- */
|
||||
|
||||
/* Message Join Response */
|
||||
@ -63,16 +68,21 @@ cw_action_in_t capwap_actions_wtp_in[] = {
|
||||
0, cw_in_check_join_resp }
|
||||
,
|
||||
|
||||
/* Element: Vendor Specific */
|
||||
/* AC Descriptor */
|
||||
{0, 0, CW_STATE_JOIN, CW_MSG_JOIN_RESPONSE,
|
||||
CW_ACTION_IN_RESULT_CODE, 1}
|
||||
CW_ACTION_IN_AC_DESCRIPTOR, 1}
|
||||
,
|
||||
|
||||
/* Element: AC Name */
|
||||
/* AC Name */
|
||||
{0, 0, CW_STATE_JOIN, CW_MSG_JOIN_RESPONSE,
|
||||
CW_ACTION_IN_AC_NAME, 1}
|
||||
,
|
||||
|
||||
/* Vendor Specific */
|
||||
{0, 0, CW_STATE_JOIN, CW_MSG_JOIN_RESPONSE,
|
||||
CW_ACTION_IN_RESULT_CODE, 1}
|
||||
,
|
||||
|
||||
|
||||
|
||||
|
||||
@ -120,6 +130,8 @@ cw_action_in_t capwap_actions_wtp_in[] = {
|
||||
CW_ACTION_IN_VENDOR_SPECIFIC_PAYLOAD, 0}
|
||||
,
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------- */
|
||||
|
||||
/* Message Change State Response IN */
|
||||
@ -135,10 +147,15 @@ cw_action_in_t capwap_actions_wtp_in[] = {
|
||||
|
||||
{0, 0, CW_STATE_RUN, CW_MSG_CONFIGURATION_UPDATE_REQUEST,
|
||||
CW_ACTION_IN_CAPWAP_TIMERS, 0}
|
||||
|
||||
,
|
||||
|
||||
|
||||
{0, 0, CW_STATE_RUN, CW_MSG_CONFIGURATION_UPDATE_REQUEST,
|
||||
CW_ACTION_IN_RADIO_ADMINISTRATIVE_STATE, 0}
|
||||
,
|
||||
|
||||
|
||||
|
||||
/* Element: Vendor Specific */
|
||||
{0, 0, CW_STATE_RUN, CW_MSG_CONFIGURATION_UPDATE_REQUEST,
|
||||
CW_ACTION_IN_VENDOR_SPECIFIC_PAYLOAD, 0}
|
||||
@ -151,6 +168,9 @@ cw_action_in_t capwap_actions_wtp_in[] = {
|
||||
0,0 }
|
||||
,
|
||||
|
||||
|
||||
|
||||
|
||||
/* Element: Vendor Specific */
|
||||
{0, 0, CW_STATE_RUN, CW_MSG_ECHO_RESPONSE,
|
||||
CW_ACTION_IN_VENDOR_SPECIFIC_PAYLOAD, 0}
|
||||
@ -226,12 +246,12 @@ cw_action_out_t capwap_actions_wtp_out[] = {
|
||||
|
||||
/* WTP MAC Type */
|
||||
{CW_MSG_JOIN_REQUEST, CW_ITEM_WTP_MAC_TYPE, 0,
|
||||
CW_ELEM_WTP_MAC_TYPE, NULL,cw_out_generic, cw_out_get_local,1}
|
||||
CW_ELEM_WTP_MAC_TYPE, NULL,cw_out_generic, cw_out_get_config,1}
|
||||
,
|
||||
|
||||
/* WTP MAC Type */
|
||||
{CW_MSG_JOIN_REQUEST, CW_ITEM_WTP_FRAME_TUNNEL_MODE, 0,
|
||||
CW_ELEM_WTP_FRAME_TUNNEL_MODE, NULL,cw_out_generic, cw_out_get_local,1}
|
||||
CW_ELEM_WTP_FRAME_TUNNEL_MODE, NULL,cw_out_generic, cw_out_get_config,1}
|
||||
,
|
||||
|
||||
/* Session ID */
|
||||
@ -275,6 +295,19 @@ cw_action_out_t capwap_actions_wtp_out[] = {
|
||||
CW_ELEM_AC_NAME, NULL, cw_out_generic, cw_out_get_local,1}
|
||||
,
|
||||
|
||||
/* AC Name with Priority */
|
||||
{CW_MSG_CONFIGURATION_STATUS_REQUEST, CW_ITEM_AC_NAME_WITH_PRIORITY, 0,
|
||||
CW_ELEM_AC_NAME_WITH_PRIORITY, NULL, cw_out_ac_name_with_priority, cw_out_get_config,1}
|
||||
,
|
||||
|
||||
/* Radio Admin State */
|
||||
{CW_MSG_CONFIGURATION_STATUS_REQUEST, CW_ITEM_RADIO_ADMINISTRATIVE_STATE, 0,
|
||||
CW_ELEM_RADIO_ADMINISTRATIVE_STATE, NULL, cw_out_radio_administrative_states, cw_out_get_config,1}
|
||||
,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------------
|
||||
|
@ -209,6 +209,10 @@ int cw_in_check_cipwap_join_req(struct conn *conn, struct cw_action_in *a, uint8
|
||||
|
||||
int cw_out_cisco_wtp_radio_cfg(struct conn *conn, struct cw_action_out *a, uint8_t * dst);
|
||||
|
||||
int cw_in_cisco_radio_administrative_state(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
|
||||
struct sockaddr *from);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
#define cw_addelem_cisco_rad(dst,acinfo)\
|
||||
|
@ -27,6 +27,7 @@ enum capwap_items {
|
||||
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,
|
||||
@ -48,6 +49,8 @@ enum capwap_items {
|
||||
CW_ITEM_IMAGE_IDENTIFIER,
|
||||
CW_ITEM_AC_HASH_VALUE,
|
||||
|
||||
CW_ITEM_AC_NAME_WITH_PRIORITY,
|
||||
|
||||
|
||||
|
||||
/* CIPWAP and Cisco */
|
||||
@ -58,12 +61,15 @@ enum capwap_items {
|
||||
CW_ITEM_AC_IMAGE_DIR, /* Path where WTP images are stored */
|
||||
CW_ITEM_IMAGE_FILENAME, /* Full path of image filename */
|
||||
CW_ITEM_DISCOVERIES,
|
||||
CW_ITEM_AC_PRIO_LIST, /* AC Name with Priority list */
|
||||
|
||||
/** FILE handle for uploading and downloading images */
|
||||
CW_ITEM_IMAGE_FILEHANDLE,
|
||||
|
||||
CW_ITEM_RADIO_CFG,
|
||||
CW_ITEM_AP_MODE_AND_TYPE,
|
||||
|
||||
CW_ITEM_CISCO_BOARD_DATA_OPTIONS,
|
||||
CW_ITEM_RADIOS
|
||||
|
||||
};
|
||||
|
||||
|
@ -13,7 +13,7 @@ struct cw_str capwap_strings_elem[] = {
|
||||
{CW_ELEM_ADD_STATION, "Add Station"},
|
||||
{CW_ELEM_RESERVED_9, "Reserved 9"},
|
||||
{CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS, "Control IPv4 Address"},
|
||||
{CW_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS, "Controll IPv6 Address"},
|
||||
{CW_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS, "Control IPv6 Address"},
|
||||
{CW_ELEM_CAPWAP_LOCAL_IPV4_ADDRESS, "CAWPAP Local IPv4 Address"},
|
||||
{CW_ELEM_CAPWAP_LOCAL_IPV6_ADDRESS, "CAPWAP Local IPv6 Address"},
|
||||
{CW_ELEM_CAPWAP_TIMERS, "CAPWAP Timers"},
|
||||
@ -37,7 +37,7 @@ struct cw_str capwap_strings_elem[] = {
|
||||
{CW_ELEM_LOCATION_DATA, "Location Data"},
|
||||
{CWMSGELEM_MAXIMUM_MESSAGE_LENGTH, "Maximum Message Length"},
|
||||
{CWMSGELEM_MTU_DISCOVERY_PADDING, "MTU Discovery Padding"},
|
||||
{CWMSGELEM_RADIO_ADMINISTRATIVE_STATE, "Radio Administrative State"},
|
||||
{CW_ELEM_RADIO_ADMINISTRATIVE_STATE, "Radio Administrative State"},
|
||||
{CW_ELEM_RADIO_OPERATIONAL_STATE, "Radio Operational State"},
|
||||
{CW_ELEM_RESULT_CODE, "Result Code"},
|
||||
{CW_ELEM_RETURNED_MESSAGE_ELEMENT, "Returned Message Element"},
|
||||
|
@ -24,7 +24,7 @@
|
||||
8,1028
|
||||
|
||||
/* For CIPWAP we allow a
|
||||
Session ID with 4 .. 16 bytes length */
|
||||
Session ID with 2 ... 16 bytes length */
|
||||
#define CW_ACTION_IN_CIPWAP_SESSION_ID \
|
||||
CW_ELEM_SESSION_ID, /* Element ID*/ \
|
||||
cw_in_generic, 0, /* start/end callback */ \
|
||||
|
@ -24,10 +24,16 @@
|
||||
#include "capwap_cisco.h"
|
||||
#include "strheap.h"
|
||||
|
||||
|
||||
#include "cipwap_actions.h"
|
||||
|
||||
cw_action_in_t cipwap_actions_wtp_in[] = {
|
||||
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------------
|
||||
* Configuration Update Request IN
|
||||
*/
|
||||
|
||||
{CW_VENDOR_ID_CISCO, 0, CW_STATE_RUN, CW_MSG_CONFIGURATION_UPDATE_REQUEST, CW_CISCO_RAD_NAME,
|
||||
cw_in_generic, 0, MBAG_BSTR16,CW_ITEM_WTP_NAME,0,512}
|
||||
,
|
||||
@ -35,8 +41,35 @@ cw_action_in_t cipwap_actions_wtp_in[] = {
|
||||
cw_in_generic, 0, MBAG_BSTR16,CW_ITEM_LOCATION_DATA,0,512}
|
||||
,
|
||||
|
||||
{CW_VENDOR_ID_CISCO, 0, CW_STATE_RUN, CW_MSG_CONFIGURATION_UPDATE_REQUEST, CW_CISCO_AC_NAME_WITH_INDEX,
|
||||
cw_in_ac_name_with_priority, 0, MBAG_BSTR16,CW_ITEM_AC_NAME_WITH_PRIORITY,0,512}
|
||||
,
|
||||
|
||||
|
||||
{CW_VENDOR_ID_CISCO, 0, CW_STATE_RUN, CW_MSG_CONFIGURATION_UPDATE_REQUEST,
|
||||
CW_ACTION_IN_CISCO_AP_MODE_AND_TYPE,
|
||||
1}
|
||||
,
|
||||
|
||||
{0, 0, CW_STATE_RUN, CW_MSG_CONFIGURATION_UPDATE_REQUEST,
|
||||
CW_ACTION_IN_CISCO_RADIO_ADMINISTRATIVE_STATE, 0}
|
||||
,
|
||||
|
||||
|
||||
|
||||
{CW_VENDOR_ID_CISCO, 0, CW_STATE_JOIN, CW_MSG_JOIN_REQUEST, CW_CISCO_AP_GROUP_NAME,
|
||||
cw_in_generic, 0, MBAG_BSTR16,CW_ITEM_WTP_GROUP_NAME,1,512}
|
||||
,
|
||||
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------------
|
||||
* Configuration Status Response IN
|
||||
*/
|
||||
{0, 0, CW_STATE_CONFIGURE, CW_MSG_CONFIGURATION_STATUS_RESPONSE,
|
||||
CW_ACTION_IN_RADIO_ADMINISTRATIVE_STATE, 0}
|
||||
,
|
||||
|
||||
|
||||
|
||||
{0, 0, 0}
|
||||
@ -54,19 +87,35 @@ cw_action_out_t cipwap_actions_wtp_out[] = {
|
||||
/* Cisco AP Groupname - Important to get the WTP a DTLS
|
||||
connection established*/
|
||||
{CW_MSG_DISCOVERY_REQUEST, CW_ITEM_WTP_GROUP_NAME, CW_VENDOR_ID_CISCO,
|
||||
CW_CISCO_AP_GROUP_NAME, NULL,cw_out_generic, cw_out_get_local, 0}
|
||||
CW_CISCO_AP_GROUP_NAME, NULL,cw_out_generic, cw_out_get_config, 0}
|
||||
,
|
||||
|
||||
/* -------------------------------------------------------------------------------
|
||||
* Join Request OUT
|
||||
*/
|
||||
|
||||
{CW_MSG_JOIN_REQUEST, CW_ITEM_CISCO_BOARD_DATA_OPTIONS, CW_VENDOR_ID_CISCO,
|
||||
CW_CISCO_BOARD_DATA_OPTIONS, NULL,cw_out_generic, cw_out_get_config, 1}
|
||||
,
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------------
|
||||
* Configuration Status Request OUT
|
||||
*/
|
||||
|
||||
|
||||
/* Cisco AP Groupname - Important to get the WTP a DTLS
|
||||
connection established*/
|
||||
{CW_MSG_CONFIGURATION_STATUS_REQUEST, CW_ITEM_RADIO_CFG, CW_VENDOR_ID_CISCO,
|
||||
CW_CISCO_AP_GROUP_NAME, NULL,cw_out_cisco_wtp_radio_cfg, cw_out_get_local, 1}
|
||||
CW_CISCO_AP_GROUP_NAME, NULL,cw_out_cisco_wtp_radio_cfg, cw_out_get_config, 1}
|
||||
,
|
||||
|
||||
{CW_MSG_CONFIGURATION_STATUS_REQUEST, CW_ITEM_AP_MODE_AND_TYPE, CW_VENDOR_ID_CISCO,
|
||||
CW_CISCO_AP_MODE_AND_TYPE, NULL,cw_out_generic, cw_out_get_config, 1}
|
||||
,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// {CW_MSG_DISCOVERY_REQUEST, CW_ITEM_NONE}
|
||||
|
@ -75,7 +75,7 @@ int cw_check_missing_mand(cw_action_in_t ** out, struct conn * conn, cw_action_i
|
||||
continue;
|
||||
|
||||
int i = ai->item_id;
|
||||
void * rc = avltree_del(conn->mand,&i);
|
||||
void * rc = mavl_get(conn->mand,&i);
|
||||
if (!rc) {
|
||||
out[n++]=ai;
|
||||
}
|
||||
|
@ -15,12 +15,15 @@ int cw_in_check_join_resp(struct conn *conn, struct cw_action_in *a, uint8_t * d
|
||||
|
||||
/* 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);
|
||||
if (n && conn->strict_capwap) {
|
||||
cw_dbg_missing_mand(DBG_MSG_ERR,conn,mlist,n,a);
|
||||
conn->capwap_state=CW_STATE_JOIN;
|
||||
errno=EAGAIN;
|
||||
return -1; //CW_RESULT_MISSING_MAND_ELEM;
|
||||
}
|
||||
if (n){
|
||||
cw_dbg_missing_mand(DBG_RFC,conn,mlist,n,a);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -7,13 +7,3 @@
|
||||
|
||||
|
||||
|
||||
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);
|
||||
|
||||
mbag_get_mbag(conn->radios,rid,NULL);
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -19,6 +19,14 @@ int cw_put_elem_radio_info(uint8_t*dst,int radio_id,mbag_t radio)
|
||||
|
||||
}
|
||||
|
||||
|
||||
int cw_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_RADIO_ADMIN_STATE,9));
|
||||
return 2 + cw_put_elem_hdr(dst,CW_ELEM_RADIO_ADMINISTRATIVE_STATE,2);
|
||||
}
|
||||
|
||||
int cw_out_radio_infos(struct conn *conn, struct cw_action_out *a, uint8_t * dst)
|
||||
{
|
||||
int l=0;
|
||||
@ -34,3 +42,61 @@ int cw_out_radio_infos(struct conn *conn, struct cw_action_out *a, uint8_t * dst
|
||||
return l;
|
||||
}
|
||||
|
||||
|
||||
int cw_out_radio_administrative_states(struct conn *conn, struct cw_action_out *a, uint8_t * dst)
|
||||
{
|
||||
int l=0;
|
||||
MAVLITER_DEFINE(it,conn->radios);
|
||||
mavliter_foreach(&it){
|
||||
struct mbag_item *i = mavliter_get(&it);
|
||||
if ( i->type != MBAG_MBAG ) {
|
||||
continue;
|
||||
}
|
||||
l+=cw_put_elem_radio_administrative_state(dst+l,i->id,i->data);
|
||||
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int set_radio_admin_state(mbag_t radios,int rid,int state)
|
||||
{
|
||||
|
||||
mbag_t radio = mbag_get_mbag(radios,rid,NULL);
|
||||
if (!radio){
|
||||
cw_dbg(DBG_ELEM_ERR,"Can't set radio administrative state for radio %d - radio does't exists",rid);
|
||||
return 0;
|
||||
}
|
||||
|
||||
mbag_set_byte(radio,CW_RADIO_ADMIN_STATE,state);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
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 state = cw_get_byte(data+1);
|
||||
return set_radio_admin_state(conn->radios,rid,state);
|
||||
}
|
||||
|
||||
|
||||
int cw_in_cisco_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 state = cw_get_byte(data+1);
|
||||
if (rid != 255)
|
||||
return set_radio_admin_state(conn->radios,rid,state);
|
||||
|
||||
|
||||
MAVLITER_DEFINE(it,conn->radios);
|
||||
mavliter_foreach(&it){
|
||||
mbag_item_t *i = mavliter_get(&it);
|
||||
mbag_set_byte(i->data,CW_RADIO_ADMIN_STATE,state);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -17,8 +17,6 @@ const struct mbag_typedef mbag_type_const_data = {
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
|
||||
const struct mbag_typedef mbag_type_bstr = {
|
||||
free
|
||||
};
|
||||
@ -77,6 +75,21 @@ static void mbag_del_fun(void *e)
|
||||
}
|
||||
|
||||
|
||||
static void strmbag_del_fun(void *e)
|
||||
{
|
||||
|
||||
mbag_del_data(e);
|
||||
free(e);
|
||||
}
|
||||
|
||||
|
||||
static int strmbag_cmp_fun(const void *x1, const void *x2)
|
||||
{
|
||||
return strcmp(( (struct mbag_item *) x1)->name , ((struct mbag_item *) x2)->name );
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int mbag_cmp_fun(const void *x1, const void *x2)
|
||||
{
|
||||
return ((struct mbag_item *) x1)->id - ((struct mbag_item *) x2)->id;
|
||||
@ -87,11 +100,19 @@ mbag_t mbag_create()
|
||||
return mavl_create(mbag_cmp_fun, mbag_del_fun);
|
||||
}
|
||||
|
||||
|
||||
mbag_t strmbag_create()
|
||||
{
|
||||
return mavl_create(strmbag_cmp_fun, strmbag_del_fun);
|
||||
|
||||
}
|
||||
|
||||
struct mbag_item *mbag_item_create(mbag_t s, uint32_t id)
|
||||
{
|
||||
struct mbag_item is;
|
||||
is.id = id;
|
||||
|
||||
|
||||
struct mbag_item *i = mavl_get(s, &is);
|
||||
if (i) {
|
||||
mbag_del_data(i);
|
||||
@ -106,5 +127,23 @@ struct mbag_item *mbag_item_create(mbag_t s, uint32_t id)
|
||||
}
|
||||
|
||||
|
||||
struct mbag_item *strmbag_item_create(mbag_t s, char *name)
|
||||
{
|
||||
struct mbag_item is;
|
||||
is.name = name;
|
||||
|
||||
|
||||
struct mbag_item *i = mavl_get(s, &is);
|
||||
if (i) {
|
||||
mbag_del_data(i);
|
||||
return i;
|
||||
}
|
||||
|
||||
i = malloc(sizeof(struct mbag_item));
|
||||
if (!i)
|
||||
return NULL;
|
||||
i->name = name;
|
||||
return mavl_add(s, i);
|
||||
}
|
||||
|
||||
|
||||
|
@ -42,7 +42,10 @@ typedef const struct mbagtype_def * mbagtype_t;
|
||||
|
||||
|
||||
struct mbag_item{
|
||||
union {
|
||||
uint32_t id;
|
||||
char *name;
|
||||
};
|
||||
const struct mbag_typedef * type;
|
||||
union {
|
||||
void *data;
|
||||
@ -88,6 +91,7 @@ extern const struct mbag_typedef mbag_type_const_data;
|
||||
extern mbag_t mbag_create();
|
||||
|
||||
extern struct mbag_item *mbag_item_create(mbag_t s, uint32_t id);
|
||||
extern struct mbag_item *strmbag_item_create(mbag_t s, char *name);
|
||||
|
||||
|
||||
|
||||
@ -172,6 +176,7 @@ static inline mbag_item_t *mbag_get(mbag_t s, uint32_t id)
|
||||
{
|
||||
mbag_item_t i;
|
||||
i.id = id;
|
||||
i.type=0;
|
||||
return mavl_get(s, &i);
|
||||
}
|
||||
|
||||
@ -179,6 +184,7 @@ static inline void mbag_del(mbag_t s,uint32_t id)
|
||||
{
|
||||
mbag_item_t i;
|
||||
i.id = id;
|
||||
i.type=0;
|
||||
mavl_del(s, &i);
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ enum radiodata{
|
||||
CW_RADIO_CFP_MAX_DURATION
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -20,8 +20,8 @@ ifndef ARCH
|
||||
endif
|
||||
|
||||
|
||||
CFLAGS += -O0 -Wall -g
|
||||
#CFLAGS += -Os -Wall
|
||||
#CFLAGS += -O0 -Wall -g
|
||||
CFLAGS += -Os -Wall
|
||||
LDFLAGS += -L../contrib/jsmn -L../../src/capwap/$(ARCH)
|
||||
|
||||
|
||||
|
364
src/wtp/cfg.c
364
src/wtp/cfg.c
@ -16,6 +16,7 @@
|
||||
|
||||
#include "capwap/file.h"
|
||||
#include "capwap/aciplist.h"
|
||||
#include "capwap/acpriolist.h"
|
||||
#include "capwap/sock.h"
|
||||
|
||||
|
||||
@ -25,6 +26,9 @@ int cfg_json_put_vendorstr(char *dst,const char * name, mbag_item_t *i,int n);
|
||||
int cfg_json_put_dword(char *dst, const char *name, mbag_item_t * i, int n);
|
||||
int cfg_json_put_word(char *dst, const char *name, mbag_item_t * i, int n);
|
||||
int cfg_json_put_ac_ip_list(char *dst, const char *name, mbag_item_t * i, int n);
|
||||
int cfg_json_put_acobj(char *dst, const char *name, mbag_item_t * i, int n);
|
||||
int cfg_json_put_byte(char *dst, const char *name, mbag_item_t * i, int n);
|
||||
int cfg_json_put_radios(char *dst, const char *name, mbag_item_t * i, int n);
|
||||
|
||||
|
||||
//static int scn_obj(char *js, jsmntok_t *t, int (vcb)(char*js,jsmntok_t*t,struct mbag_itemdef *defs,mbag_t mbag), struct mbag_itemdef *defs,mbag_t mbag);
|
||||
@ -41,6 +45,10 @@ typedef struct mbag_itemdef cfg_item_t;
|
||||
|
||||
int cfg_json_get_dword(struct mbag_itemdef *idef, char *js, jsmntok_t * t, mbag_t mbag);
|
||||
int cfg_json_get_word(struct mbag_itemdef *idef, char *js, jsmntok_t * t, mbag_t mbag);
|
||||
int cfg_json_get_byte(struct mbag_itemdef *idef, char *js, jsmntok_t * t, mbag_t mbag);
|
||||
int cfg_json_get_ac_name_with_priority(struct mbag_itemdef *idef, char *js, jsmntok_t * t,
|
||||
mbag_t mbag);
|
||||
|
||||
|
||||
|
||||
enum {
|
||||
@ -49,7 +57,10 @@ enum {
|
||||
};
|
||||
|
||||
|
||||
static int scn_obj(char *js, jsmntok_t *t, int (vcb)(char*js,jsmntok_t*t,struct mbag_itemdef *defs,mbag_t mbag), struct mbag_itemdef *defs,mbag_t mbag) {
|
||||
static int scn_obj(char *js, jsmntok_t * t,
|
||||
int (vcb) (char *js, jsmntok_t * t, struct mbag_itemdef * defs,
|
||||
mbag_t mbag), struct mbag_itemdef *defs, mbag_t mbag)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (t->type != JSMN_OBJECT) {
|
||||
@ -84,7 +95,8 @@ static int skip(jsmntok_t *t)
|
||||
int e = t->end;
|
||||
int n = 1;
|
||||
while (e > t->start) {
|
||||
t++;n++;
|
||||
t++;
|
||||
n++;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
@ -130,7 +142,8 @@ int cfg_json_put_ac_ip_list(char *dst,const char * name, mbag_item_t *i,int n)
|
||||
return d - dst;
|
||||
}
|
||||
|
||||
int cfg_json_get_ac_ip_list(struct mbag_itemdef *idef,char *js, jsmntok_t *t,mbag_t mbag)
|
||||
int cfg_json_get_ac_ip_list(struct mbag_itemdef *idef, char *js, jsmntok_t * t,
|
||||
mbag_t mbag)
|
||||
{
|
||||
|
||||
printf("Get AC IP List len = %d\n", t->size);
|
||||
@ -155,11 +168,14 @@ int cfg_json_get_ac_ip_list(struct mbag_itemdef *idef,char *js, jsmntok_t *t,mba
|
||||
continue;
|
||||
|
||||
/* convert IPv4 adddress */
|
||||
rc = inet_pton(AF_INET, js+t->start, &(((struct sockaddr_in *)(&acip->ip))->sin_addr) );
|
||||
rc = inet_pton(AF_INET, js + t->start,
|
||||
&(((struct sockaddr_in *) (&acip->ip))->sin_addr));
|
||||
((struct sockaddr *) (&acip->ip))->sa_family = AF_INET;
|
||||
if (!rc) {
|
||||
/* If it's not an IPv4 adress, try IPv6 */
|
||||
rc = inet_pton(AF_INET6, js+t->start, &(((struct sockaddr_in6 *)(&acip->ip))->sin6_addr) );
|
||||
rc = inet_pton(AF_INET6, js + t->start,
|
||||
&(((struct sockaddr_in6 *) (&acip->ip))->
|
||||
sin6_addr));
|
||||
((struct sockaddr *) (&acip->ip))->sa_family = AF_INET6;
|
||||
}
|
||||
|
||||
@ -169,7 +185,8 @@ int cfg_json_get_ac_ip_list(struct mbag_itemdef *idef,char *js, jsmntok_t *t,mba
|
||||
exit(0);
|
||||
}
|
||||
|
||||
cw_aciplist_t aciplist= mbag_get_mavl(mbag,CW_ITEM_AC_IP_LIST,cw_aciplist_create );
|
||||
cw_aciplist_t aciplist =
|
||||
mbag_get_mavl(mbag, CW_ITEM_AC_IP_LIST, cw_aciplist_create);
|
||||
mavl_replace(aciplist, acip);
|
||||
|
||||
|
||||
@ -180,7 +197,7 @@ int cfg_json_get_ac_ip_list(struct mbag_itemdef *idef,char *js, jsmntok_t *t,mba
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
int byte_local(struct mbag_itemdef *idef, char *js, jsmntok_t * t)
|
||||
{
|
||||
printf("GET BYTE\n");
|
||||
@ -198,9 +215,10 @@ printf("GET BYTE\n");
|
||||
mbag_set_byte(conn->local, idef->item_id, atoi(val));
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
int cfg_json_get_vendorstr(struct mbag_itemdef *idef,char *js, jsmntok_t *t,mbag_t mbag)
|
||||
int cfg_json_get_vendorstr(struct mbag_itemdef *idef, char *js, jsmntok_t * t,
|
||||
mbag_t mbag)
|
||||
{
|
||||
int item_id = idef->item_id;
|
||||
|
||||
@ -243,6 +261,7 @@ int cfg_json_get_bstr16(struct mbag_itemdef *idef,char *js, jsmntok_t *t,mbag_t
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int cfg_json_get_dword(struct mbag_itemdef *idef, char *js, jsmntok_t * t, mbag_t mbag)
|
||||
{
|
||||
|
||||
@ -278,6 +297,22 @@ int cfg_json_get_word(struct mbag_itemdef *idef,char *js, jsmntok_t *t,mbag_t mb
|
||||
}
|
||||
|
||||
|
||||
int cfg_json_get_byte(struct mbag_itemdef *idef, char *js, jsmntok_t * t, mbag_t mbag)
|
||||
{
|
||||
|
||||
struct conn *conn = get_conn();
|
||||
|
||||
int item_id = idef->item_id;
|
||||
*(js + t->end) = 0;
|
||||
// char *str = js+t->start;
|
||||
if (t->type != JSMN_STRING) {
|
||||
return 0;
|
||||
}
|
||||
*(js + t->end) = 0;
|
||||
uint32_t dw = atoi(js + t->start);
|
||||
mbag_set_byte(mbag, item_id, dw);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -296,7 +331,8 @@ int bstr16_local(struct mbag_itemdef *idef,char *js, jsmntok_t *t)
|
||||
}
|
||||
// *(js+t->end)=0;
|
||||
printf("Set str: %d %s\n", item_id, str);
|
||||
mbag_set_bstr16n(conn->local,item_id,(uint8_t*)js+t->start,t->end-t->start);
|
||||
mbag_set_bstr16n(conn->local, item_id, (uint8_t *) js + t->start,
|
||||
t->end - t->start);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -324,30 +360,53 @@ int bstr_local(struct mbag_itemdef *idef,char *js, jsmntok_t *t)
|
||||
|
||||
|
||||
|
||||
int cfg_json_get_ac_ip_list(struct mbag_itemdef *idef,char *js, jsmntok_t *t,mbag_t mbag);
|
||||
int cfg_json_get_ac_ip_list(struct mbag_itemdef *idef, char *js, jsmntok_t * t,
|
||||
mbag_t mbag);
|
||||
|
||||
int wtp_board_data_local(struct mbag_itemdef *idef, char *js, jsmntok_t * t, mbag_t mbag);
|
||||
int cfg_json_put_obj(char *dst, const char *name, mbag_item_t * i, int n);
|
||||
|
||||
int cfg_json_get_radios(struct mbag_itemdef *idef, char *js, jsmntok_t * t, mbag_t mbag);
|
||||
|
||||
|
||||
|
||||
|
||||
struct mbag_itemdef general_cfg[] = {
|
||||
{CW_ITEM_WTP_NAME, "wtp_name", cfg_json_get_bstr16, cfg_json_put_bstr16},
|
||||
{CW_ITEM_LOCATION_DATA,"location_data",cfg_json_get_bstr16,cfg_json_put_bstr16},
|
||||
{CW_ITEM_WTP_HARDWARE_VERSION, "hardware_version",cfg_json_get_vendorstr,cfg_json_put_vendorstr},
|
||||
{CW_ITEM_WTP_SOFTWARE_VERSION, "software_version",cfg_json_get_vendorstr,cfg_json_put_vendorstr},
|
||||
{CW_ITEM_WTP_BOARD_DATA,"wtp_board_data",wtp_board_data_local,cfg_json_put_obj},
|
||||
{CW_ITEM_WTP_GROUP_NAME, "wtp_group_name", cfg_json_get_bstr16,
|
||||
cfg_json_put_bstr16},
|
||||
{CW_ITEM_LOCATION_DATA, "location_data", cfg_json_get_bstr16,
|
||||
cfg_json_put_bstr16},
|
||||
{CW_ITEM_WTP_HARDWARE_VERSION, "hardware_version", cfg_json_get_vendorstr,
|
||||
cfg_json_put_vendorstr},
|
||||
{CW_ITEM_WTP_SOFTWARE_VERSION, "software_version", cfg_json_get_vendorstr,
|
||||
cfg_json_put_vendorstr},
|
||||
{CW_ITEM_WTP_BOARD_DATA, "wtp_board_data", wtp_board_data_local,
|
||||
cfg_json_put_obj},
|
||||
{CW_RADIO_BSSID, "bssid", cfg_json_get_bstr16, cfg_json_put_bstr16},
|
||||
{CW_ITEM_CAPWAP_TIMERS, "capwap_timers", cfg_json_get_word, cfg_json_put_word},
|
||||
{CW_ITEM_IDLE_TIMEOUT, "idle_timeout", cfg_json_get_dword, cfg_json_put_dword},
|
||||
{CW_ITEM_AC_IP_LIST,"ac_ip_list",cfg_json_get_ac_ip_list,cfg_json_put_ac_ip_list},
|
||||
{CW_ITEM_AC_IP_LIST, "ac_ip_list", cfg_json_get_ac_ip_list,
|
||||
cfg_json_put_ac_ip_list},
|
||||
|
||||
{CW_ITEM_AP_MODE_AND_TYPE, "ap_mode_and_type", cfg_json_get_word,
|
||||
cfg_json_put_word},
|
||||
|
||||
{CW_ITEM_WTP_FRAME_TUNNEL_MODE, "wtp_frame_tunnel_mode", cfg_json_get_byte,
|
||||
cfg_json_put_byte},
|
||||
{CW_ITEM_WTP_MAC_TYPE, "wtp_mac_type", cfg_json_get_byte, cfg_json_put_byte},
|
||||
|
||||
{CW_ITEM_RADIOS, "radios", cfg_json_get_radios, cfg_json_put_radios},
|
||||
|
||||
|
||||
{CW_ITEM_AC_NAME_WITH_PRIORITY, "ac_name_with_priority",
|
||||
cfg_json_get_ac_name_with_priority, cfg_json_put_acobj},
|
||||
|
||||
{CW_ITEM_AC_HASH_VALUE, "ac_hash_value",cfg_json_get_bstr16,cfg_json_put_bstr16},
|
||||
{CW_ITEM_AC_HASH_VALUE, "ac_hash_value", cfg_json_get_bstr16,
|
||||
cfg_json_put_bstr16},
|
||||
|
||||
{CW_ITEM_CISCO_BOARD_DATA_OPTIONS, "wtp_board_data_options", cfg_json_get_bstr16,
|
||||
cfg_json_put_bstr16},
|
||||
|
||||
|
||||
/* {CW_ITEM_WTP_FRAME_TUNNEL_MODE,"frame_tunnel_mode",byte_local},
|
||||
@ -362,13 +421,23 @@ struct mbag_itemdef general_cfg[] = {
|
||||
|
||||
struct mbag_itemdef board_data_cfg[] = {
|
||||
{CW_ITEM_WTP_BOARD_MODELNO, "model_no", cfg_json_get_bstr16, cfg_json_put_bstr16},
|
||||
{CW_ITEM_WTP_BOARD_SERIALNO, "serial_no",cfg_json_get_bstr16,cfg_json_put_bstr16},
|
||||
{CW_ITEM_WTP_BOARD_SERIALNO, "serial_no", cfg_json_get_bstr16,
|
||||
cfg_json_put_bstr16},
|
||||
{CW_ITEM_WTP_BOARD_VENDOR, "vendor_id", cfg_json_get_dword, cfg_json_put_dword},
|
||||
|
||||
{0, 0, 0}
|
||||
};
|
||||
|
||||
struct mbag_itemdef * get_idef_by_id(struct mbag_itemdef *cfg,uint32_t id){
|
||||
|
||||
struct mbag_itemdef radio_cfg[] = {
|
||||
{CW_RADIO_ADMIN_STATE, "admin_state", cfg_json_get_byte, cfg_json_put_byte}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
struct mbag_itemdef *get_idef_by_id(struct mbag_itemdef *cfg, uint32_t id)
|
||||
{
|
||||
int i = 0;
|
||||
for (i = 0; cfg[i].item_id; i++) {
|
||||
if (cfg[i].item_id == id) {
|
||||
@ -379,6 +448,10 @@ struct mbag_itemdef * get_idef_by_id(struct mbag_itemdef *cfg,uint32_t id){
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int cfg_json_put_bstr16(char *dst, const char *name, mbag_item_t * i, int n)
|
||||
{
|
||||
if (i->type != MBAG_BSTR16) {
|
||||
@ -389,7 +462,15 @@ int cfg_json_put_bstr16(char *dst,const char * name, mbag_item_t *i,int n)
|
||||
memset(d, '\t', n);
|
||||
d += n;
|
||||
d += sprintf(d, "\"%s\":", name);
|
||||
|
||||
int utf8 = cw_is_utf8(bstr16_data(i->data), bstr16_len(i->data));
|
||||
if (utf8) {
|
||||
d += sprintf(d, "\"%.*s\"", bstr16_len(i->data), bstr16_data(i->data));
|
||||
} else {
|
||||
d += sprintf(d, "\".x");
|
||||
d += cw_format_hex(d, bstr16_data(i->data), bstr16_len(i->data));
|
||||
d += sprintf(d, "\"");
|
||||
}
|
||||
return d - dst;
|
||||
}
|
||||
|
||||
@ -422,6 +503,20 @@ int cfg_json_put_word(char *dst,const char * name, mbag_item_t *i,int n)
|
||||
return d - dst;
|
||||
}
|
||||
|
||||
int cfg_json_put_byte(char *dst, const char *name, mbag_item_t * i, int n)
|
||||
{
|
||||
// if (i->type != MBAG_BSTR16){
|
||||
// return 0;
|
||||
// }
|
||||
|
||||
char *d = dst;
|
||||
memset(d, '\t', n);
|
||||
d += n;
|
||||
d += sprintf(d, "\"%s\":", name);
|
||||
d += sprintf(d, "\"%d\"", i->byte);
|
||||
return d - dst;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -438,9 +533,9 @@ int cfg_json_put_vendorstr(char *dst,const char * name, mbag_item_t *i,int n)
|
||||
d += sprintf(d, "[\"%d\",", vendorstr_get_vendor_id(i->data));
|
||||
|
||||
if (cw_is_utf8(vendorstr_data(i->data), vendorstr_len(i->data))) {
|
||||
d+=sprintf(d,"\"%.*s\"",vendorstr_len(i->data),vendorstr_data(i->data));
|
||||
}
|
||||
else{
|
||||
d += sprintf(d, "\"%.*s\"", vendorstr_len(i->data),
|
||||
vendorstr_data(i->data));
|
||||
} else {
|
||||
d += sprintf(d, "\".x");
|
||||
d += cw_format_hex(d, vendorstr_data(i->data), vendorstr_len(i->data));
|
||||
d += sprintf(d, "\"");
|
||||
@ -453,6 +548,7 @@ int cfg_json_put_vendorstr(char *dst,const char * name, mbag_item_t *i,int n)
|
||||
// d+=sprintf(d,"\"%.*s\",\n",bstr16_len(i->data),bstr16_data(i->data));
|
||||
return d - dst;
|
||||
}
|
||||
|
||||
int mbag_tojson(char *dst, mbag_t m, struct mbag_itemdef *defs, int n);
|
||||
|
||||
int cfg_json_put_obj(char *dst, const char *name, mbag_item_t * i, int n)
|
||||
@ -466,6 +562,82 @@ int cfg_json_put_obj(char *dst,const char * name, mbag_item_t *i,int n)
|
||||
|
||||
}
|
||||
|
||||
int cfg_json_put_radios(char *dst, const char *name, mbag_item_t * i, int n)
|
||||
{
|
||||
struct conn * conn = get_conn();
|
||||
char *d = dst;
|
||||
|
||||
|
||||
memset(d, '\t', n);
|
||||
d += n;
|
||||
d += sprintf(d, "\"radios\":{\n");
|
||||
|
||||
MAVLITER_DEFINE(radios,conn->radios);
|
||||
const char * comma="";
|
||||
mavliter_foreach(&radios) {
|
||||
mbag_item_t *i = mavliter_get(&radios);
|
||||
int rid = i->id;
|
||||
mbag_t radio = i->data;
|
||||
|
||||
d+=sprintf(d,"%s",comma);
|
||||
comma=",\n";
|
||||
memset(d, '\t', n+1);
|
||||
d += n+1;
|
||||
d += sprintf(d, "\"%d\":", i->id);
|
||||
|
||||
d += mbag_tojson(d, i->data, radio_cfg, n+1);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
d+=sprintf(d,"\n");
|
||||
memset(d, '\t', n);
|
||||
d += n;
|
||||
d += sprintf(d, "}");
|
||||
|
||||
|
||||
return d-dst;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
int cfg_json_put_acobj(char *dst, const char *name, mbag_item_t * i, int n)
|
||||
{
|
||||
char *d = dst;
|
||||
memset(d, '\t', n);
|
||||
d += n;
|
||||
d += sprintf(d, "\"%s\":{\n", name);
|
||||
|
||||
MAVLITER_DEFINE(it, i->data);
|
||||
char *comma = "";
|
||||
mavliter_foreach(&it) {
|
||||
cw_acprio_t *acprio = mavliter_get(&it);
|
||||
d += sprintf(d, "%s", comma);
|
||||
comma = ",\n";
|
||||
memset(d, '\t', n + 1);
|
||||
d += n + 1;
|
||||
d += sprintf(d, "\"%s\":\"%d\"", acprio->name, acprio->prio);
|
||||
|
||||
}
|
||||
d += sprintf(d, "\n");
|
||||
memset(d, '\t', n);
|
||||
d += n;
|
||||
d += sprintf(d, "}");
|
||||
|
||||
|
||||
|
||||
|
||||
// d+=mbag_tojson(d,i->data,board_data_cfg,n);
|
||||
return d - dst;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int mbag_tojson(char *dst, mbag_t m, struct mbag_itemdef *defs, int n)
|
||||
{
|
||||
char *d;
|
||||
@ -519,17 +691,19 @@ int cfg_json_save()
|
||||
{
|
||||
struct conn *conn = get_conn();
|
||||
char dst[4096];
|
||||
mbag_set_byte(conn->config,CW_ITEM_RADIOS,1);
|
||||
|
||||
int n = mbag_tojson(dst, conn->config, general_cfg, 0);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
////printf("DST:%s\n",dst);
|
||||
//exit(0);
|
||||
cw_save_file("cfg.json", dst, n);
|
||||
|
||||
}
|
||||
|
||||
struct mbag_itemdef * get_cfg(struct mbag_itemdef *cfg,const char *key){
|
||||
struct mbag_itemdef *get_cfg(struct mbag_itemdef *cfg, const char *key)
|
||||
{
|
||||
int i = 0;
|
||||
for (i = 0; cfg[i].item_id; i++) {
|
||||
if (!strcmp(key, cfg[i].cfgname)) {
|
||||
@ -570,8 +744,7 @@ static int wtp_board_data_cb(char *js,jsmntok_t *t,mbag_t mbag)
|
||||
if (idef->item_id == CW_ITEM_WTP_BOARD_VENDOR) {
|
||||
mbag_set_dword(bd, CW_ITEM_WTP_BOARD_VENDOR, atoi(val));
|
||||
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
bstr16_t v = bstr16cfgstr(val);
|
||||
mbag_set_bstr16n(bd, idef->item_id, bstr16_data(v), bstr16_len(v));
|
||||
free(v);
|
||||
@ -583,8 +756,134 @@ static int wtp_board_data_cb(char *js,jsmntok_t *t,mbag_t mbag)
|
||||
return skip(t + 1);
|
||||
|
||||
}
|
||||
|
||||
static int set_cfg(char *js, jsmntok_t * t, struct mbag_itemdef *defs, mbag_t mbag);
|
||||
|
||||
|
||||
|
||||
static int cfg_json_get_ac_name_with_priority_cb(char *js, jsmntok_t * t,
|
||||
struct mbag_itemdef *defs, mbag_t mbag)
|
||||
{
|
||||
|
||||
*(js + t->end) = 0;
|
||||
const char *key = js + t->start;
|
||||
*(js + (t + 1)->end) = 0;
|
||||
const char *val = js + (t + 1)->start;
|
||||
|
||||
|
||||
if ((t + 1)->type != JSMN_STRING) {
|
||||
printf("Errro no string acname with index");
|
||||
return skip(t + 1);
|
||||
|
||||
}
|
||||
|
||||
cw_acprio_t *ac = malloc(sizeof(cw_acprio_t));
|
||||
if (!ac) {
|
||||
return skip(t + 1);
|
||||
}
|
||||
|
||||
ac->name = strdup(key);
|
||||
ac->prio = atoi(val);
|
||||
|
||||
//mbag_item_t * i = mbag_item_create2(mbag,ac->name);
|
||||
// i->type = MBAG_ACPRIO;
|
||||
|
||||
|
||||
|
||||
// printf("ACNAMEKEY: %s\n",key);
|
||||
printf("Key: %s\n", key);
|
||||
printf("Val: %s\n", val);
|
||||
|
||||
mavl_replace(mbag, ac);
|
||||
return skip(t + 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int cfg_json_get_ac_name_with_priority(struct mbag_itemdef *idef, char *js, jsmntok_t * t,
|
||||
mbag_t mbag)
|
||||
{
|
||||
|
||||
if (t->type != JSMN_OBJECT) {
|
||||
printf("Error: AC_NAME_WITH PRIORITY should be an object\n");
|
||||
printf("Size: %d\n", t->size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct conn *conn = get_conn();
|
||||
cw_acpriolist_t al =
|
||||
mbag_get_mavl(conn->config, CW_ITEM_AC_NAME_WITH_PRIORITY,
|
||||
cw_acpriolist_create);
|
||||
if (!al)
|
||||
return skip(t + 1);
|
||||
|
||||
scn_obj(js, t, cfg_json_get_ac_name_with_priority_cb, NULL, al);
|
||||
|
||||
return skip(t + 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int cfg_json_get_radios_cb(char *js, jsmntok_t * t,
|
||||
struct mbag_itemdef *defs, mbag_t mbag)
|
||||
{
|
||||
|
||||
*(js + t->end) = 0;
|
||||
const char *key = js + t->start;
|
||||
*(js + (t + 1)->end) = 0;
|
||||
const char *val = js + (t + 1)->start;
|
||||
|
||||
printf("Key: %s\n",key);
|
||||
printf("Val: %s\n",val);
|
||||
|
||||
|
||||
|
||||
struct conn * conn = get_conn();
|
||||
|
||||
|
||||
mbag_t radio = mbag_get_mbag(conn->radios,atoi(key),NULL);
|
||||
if ( !radio ){
|
||||
printf("Radio %d not found\n",atoi(key));
|
||||
return skip(t+1);
|
||||
|
||||
}
|
||||
|
||||
scn_obj(js, t+1, set_cfg, radio_cfg, radio);
|
||||
|
||||
return skip(t+1);
|
||||
}
|
||||
|
||||
|
||||
int cfg_json_get_radios(struct mbag_itemdef *idef, char *js, jsmntok_t * t, mbag_t mbag)
|
||||
{
|
||||
|
||||
if (t->type != JSMN_OBJECT) {
|
||||
printf("Error: Radios is no object\n");
|
||||
printf("Size: %d\n", t->size);
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct conn *conn = get_conn();
|
||||
cw_acpriolist_t al =
|
||||
mbag_get_mavl(conn->config, CW_ITEM_AC_NAME_WITH_PRIORITY,
|
||||
cw_acpriolist_create);
|
||||
if (!al)
|
||||
return skip(t + 1);
|
||||
|
||||
scn_obj(js, t, cfg_json_get_radios_cb, NULL, NULL);
|
||||
|
||||
return skip(t + 1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int wtp_board_data_local(struct mbag_itemdef *idef, char *js, jsmntok_t * t, mbag_t mbag)
|
||||
{
|
||||
|
||||
@ -604,16 +903,14 @@ int wtp_board_data_local(struct mbag_itemdef *idef,char *js, jsmntok_t *t,mbag_t
|
||||
mbag_set_mbag(mbag, CW_ITEM_WTP_BOARD_DATA, bd);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
scn_obj(js, t, set_cfg, board_data_cfg, bd);
|
||||
return skip(t + 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int set_cfg(char *js,jsmntok_t *t,struct mbag_itemdef *defs,mbag_t mbag){
|
||||
static int set_cfg(char *js, jsmntok_t * t, struct mbag_itemdef *defs, mbag_t mbag)
|
||||
{
|
||||
|
||||
*(js + t->end) = 0;
|
||||
const char *key = js + t->start;
|
||||
@ -633,8 +930,7 @@ static int set_cfg(char *js,jsmntok_t *t,struct mbag_itemdef *defs,mbag_t mbag){
|
||||
if (!idef->setfun) {
|
||||
printf("Error no setfun: %s\n", key);
|
||||
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
idef->setfun(idef, js, t + 1, mbag);
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
{
|
||||
"idle_timeout":"300",
|
||||
"wtp_name":"Kaffe-Point22",
|
||||
"wtp_name":"Kaffe-Point",
|
||||
"wtp_mac_type":"1",
|
||||
"wtp_frame_tunnel_mode":"4",
|
||||
"hardware_version":["4232704",".x01000000"],
|
||||
"software_version":["4232704",".x08006e00"],
|
||||
"software_version":["4232704",".x08007300"],
|
||||
"wtp_board_data":{
|
||||
"vendor_id":"4232704",
|
||||
"model_no":"AIR-LAP1131AG-E-K9",
|
||||
@ -16,5 +18,20 @@
|
||||
"fe80::219:dbff:fee0:9327"
|
||||
],
|
||||
"location_data":"Germany",
|
||||
"ac_name_with_priority":{
|
||||
"":"2",
|
||||
"Master AC":"1"
|
||||
},
|
||||
"wtp_group_name":"tobias",
|
||||
"ap_mode_and_type":"512",
|
||||
"wtp_board_data_options":".x00010000",
|
||||
"radios":{
|
||||
"0":{
|
||||
"admin_state":"2"
|
||||
},
|
||||
"1":{
|
||||
"admin_state":"2"
|
||||
}
|
||||
},
|
||||
"bssid":""
|
||||
}
|
@ -55,7 +55,7 @@ cw_aciplist_t cw_select_ac(struct conn *conn, mbag_t dis)
|
||||
|
||||
/* get the AC Name with Priority list */
|
||||
cw_acpriolist_t priolist;
|
||||
priolist = mbag_get_avltree(conn->local, CW_ITEM_AC_PRIO_LIST);
|
||||
priolist = mbag_get_avltree(conn->config, CW_ITEM_AC_NAME_WITH_PRIORITY);
|
||||
|
||||
cw_aciplist_t resultlist=cw_aciplist_create();
|
||||
|
||||
@ -73,6 +73,8 @@ cw_aciplist_t cw_select_ac(struct conn *conn, mbag_t dis)
|
||||
prio = cw_acpriolist_get(priolist, ac_name);
|
||||
else
|
||||
prio = 256;
|
||||
printf("Prio for %s is %d\n",ac_name,prio);
|
||||
printf("nprio: %d\n",priolist->count);
|
||||
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ bstr_t get_base_rmac()
|
||||
{
|
||||
// static uint8_t rm[8]={0x00,0x4a,0x99,0x02,0xfa,0xc0};
|
||||
|
||||
static uint8_t rm[8]={0x00,0x3a,0x99,0x02,0xfa,0xc0};
|
||||
static uint8_t rm[8]={0x00,0x4a,0x99,0x02,0xfa,0xc0};
|
||||
return bstr_create(rm,6);
|
||||
}
|
||||
|
||||
@ -68,9 +68,6 @@ int handle_update_req(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
||||
int main()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
wtpconf_preinit();
|
||||
|
||||
if (!read_config("./wtp_uci.conf")) {
|
||||
@ -156,9 +153,8 @@ conn->config=mbag_create();
|
||||
cw_acpriolist_set(acprios,"Master AC",strlen("Master AC"),1);
|
||||
cw_acpriolist_set(acprios,"AC8new",strlen("AC8new"),12);
|
||||
|
||||
mbag_set_avltree(conn->local,CW_ITEM_AC_PRIO_LIST,acprios);
|
||||
|
||||
mbag_set_str(conn->local,CW_ITEM_LOCATION_DATA,"Berlin");
|
||||
// mbag_set_str(conn->local,CW_ITEM_LOCATION_DATA,"Berlin");
|
||||
// mbag_set_str(conn->local,CW_ITEM_WTP_NAME,"WTP Tube");
|
||||
|
||||
mbag_set_byte(conn->local,CW_ITEM_WTP_MAC_TYPE,0);
|
||||
@ -172,7 +168,7 @@ cw_set_msg_end_callback(conn,CW_STATE_CONFIGURE,CW_MSG_CONFIGURATION_STATUS_RESP
|
||||
|
||||
|
||||
|
||||
the_conn->strict_capwap=1;
|
||||
the_conn->strict_capwap=0;
|
||||
discovery();
|
||||
join();
|
||||
mavl_destroy(conn->incomming);
|
||||
|
Loading…
Reference in New Issue
Block a user