Strict capwap added to ac.conf
FossilOrigin-Name: 9b86298087cb4c758124a8b6afb9939c149ced4f8ea9abc7166a58deee417ef7
This commit is contained in:
parent
04954abe1b
commit
9e93c33be4
@ -54,6 +54,24 @@
|
||||
# cisco_software_version =
|
||||
|
||||
|
||||
# strict_capwap
|
||||
#
|
||||
# Strict CAPWAP protocol
|
||||
# If set to YES, AC-Tube for example complains about any message
|
||||
# with missing mandatory elements.
|
||||
#
|
||||
# Default:
|
||||
# strict_capwap = 1
|
||||
|
||||
# strict_headers
|
||||
#
|
||||
# If set to 1, any malformed packets wil b thrown away.
|
||||
#
|
||||
# Default:
|
||||
# strict_headers = 1
|
||||
|
||||
|
||||
|
||||
|
||||
# image_dir
|
||||
# Directorie where firmware images are stored
|
||||
|
@ -34,6 +34,11 @@ uint8_t conf_macaddress[12];
|
||||
uint8_t conf_macaddress_len=0;
|
||||
|
||||
|
||||
int conf_strict_capwap=1;
|
||||
int conf_strict_headers=1;
|
||||
|
||||
|
||||
|
||||
const char * conf_acname = NULL;
|
||||
int conf_acname_len = 0;
|
||||
|
||||
@ -585,6 +590,10 @@ int read_config(const char * filename){
|
||||
CFG_STR_LIST("bcast_addrs", "{}", CFGF_NONE),
|
||||
CFG_STR_LIST("ac_ips","{}",CFGF_NONE),
|
||||
CFG_SIMPLE_STR("control_port",&conf_control_port),
|
||||
|
||||
CFG_SIMPLE_BOOL("strict_capwap",&conf_strict_capwap),
|
||||
CFG_SIMPLE_BOOL("strict_headers",&conf_strict_headers),
|
||||
|
||||
|
||||
#ifdef WITH_LWAPP
|
||||
CFG_SIMPLE_STR("lw_control_port",&conf_lw_control_port),
|
||||
|
@ -125,6 +125,8 @@ extern long conf_debug_level;
|
||||
extern uint8_t conf_macaddress[12];
|
||||
extern uint8_t conf_macaddress_len;
|
||||
|
||||
extern int conf_strict_capwap;
|
||||
extern int conf_strict_headers;
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "capwap/timer.h"
|
||||
|
||||
|
||||
#include "conf.h"
|
||||
|
||||
#include "capwap/lwmsg.h"
|
||||
#include "capwap/lwapp.h"
|
||||
@ -110,8 +109,6 @@ static void wtpman_run_discovery(void *arg)
|
||||
|
||||
struct conn * conn = wtpman->conn;
|
||||
|
||||
conn->strict_capwap=0;
|
||||
conn->strict_hdr=1;
|
||||
|
||||
conn->capwap_mode=CW_MODE_CIPWAP;
|
||||
conn->config = mbag_create();
|
||||
@ -242,8 +239,6 @@ static int wtpman_join(void *arg, time_t timer)
|
||||
|
||||
struct conn * conn = wtpman->conn;
|
||||
|
||||
conn->strict_capwap=1;
|
||||
conn->strict_hdr=1;
|
||||
conn->capwap_mode=CW_MODE_CIPWAP;
|
||||
|
||||
|
||||
@ -482,6 +477,9 @@ struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wtpman->conn->strict_capwap = conf_strict_capwap;
|
||||
wtpman->conn->strict_hdr = conf_strict_headers;
|
||||
|
||||
return wtpman;
|
||||
}
|
||||
|
||||
|
@ -146,7 +146,7 @@ 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);
|
||||
// printf("Get AC IP List len = %d\n", t->size);
|
||||
if (t->type != JSMN_ARRAY) {
|
||||
printf("ac_ip_list is not a list\n");
|
||||
exit(0);
|
||||
@ -330,7 +330,7 @@ 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);
|
||||
// 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);
|
||||
return 0;
|
||||
@ -349,7 +349,7 @@ int bstr_local(struct mbag_itemdef *idef, char *js, jsmntok_t * t)
|
||||
|
||||
}
|
||||
// *(js+t->end)=0;
|
||||
printf("Set str: %d %s\n", item_id, str);
|
||||
// printf("Set str: %d %s\n", item_id, str);
|
||||
|
||||
bstr16_t v = bstr16cfgstr(str);
|
||||
|
||||
@ -793,8 +793,8 @@ static int cfg_json_get_ac_name_with_priority_cb(char *js, jsmntok_t * t,
|
||||
|
||||
|
||||
// printf("ACNAMEKEY: %s\n",key);
|
||||
printf("Key: %s\n", key);
|
||||
printf("Val: %s\n", val);
|
||||
// printf("Key: %s\n", key);
|
||||
// printf("Val: %s\n", val);
|
||||
|
||||
mavl_replace(mbag, ac);
|
||||
return skip(t + 1);
|
||||
@ -835,8 +835,8 @@ static int cfg_json_get_radios_cb(char *js, jsmntok_t * t,
|
||||
*(js + (t + 1)->end) = 0;
|
||||
const char *val = js + (t + 1)->start;
|
||||
|
||||
printf("Key: %s\n",key);
|
||||
printf("Val: %s\n",val);
|
||||
// printf("Key: %s\n",key);
|
||||
// printf("Val: %s\n",val);
|
||||
|
||||
|
||||
|
||||
|
@ -28,11 +28,11 @@
|
||||
"radios":{
|
||||
"0":{
|
||||
"admin_state":"2",
|
||||
"radio_type":"0"
|
||||
"radio_type":"7"
|
||||
},
|
||||
"1":{
|
||||
"admin_state":"2",
|
||||
"radio_type":"0"
|
||||
"radio_type":"8"
|
||||
}
|
||||
},
|
||||
"bssid":""
|
||||
|
Loading…
Reference in New Issue
Block a user