Added config etry to ac.conf for capwap_mode

FossilOrigin-Name: bdbad2d11f21777bf7abe717a506d94c875cfa61be73bd262416aab233dd8e07
This commit is contained in:
7u83@mail.ru 2015-04-26 13:12:44 +00:00
parent 9e93c33be4
commit 434305390b
4 changed files with 50 additions and 6 deletions

View File

@ -71,7 +71,18 @@
# strict_headers = 1
# capwap_mode
#
# can be either "capwap" or "cipwap"
#
# If mode is set to "capwap", AC-Tube knows only to deal with *real* "CAPWAP"
# If mode is seto cipwap, AC-Tube tries to detec the connecting client. So
# a Cisco WTP has a chance to connect. For Cisco WPTs this works only in conjunction
# with strict_headers = 0
#
# Default:
# capwap_mpode = capwap
#
# image_dir
# Directorie where firmware images are stored

View File

@ -163,8 +163,18 @@ int main (int argc, const char * argv[])
DBGX("Attention! %s","DBGX is ON!");
cw_register_actions_capwap_ac(&capwap_actions);
/* Locad CAPWAP base protocol */
if (conf_capwap_mode==CW_MODE_CIPWAP){
cw_register_actions_cipwap_ac(&capwap_actions);
}
else {
cw_register_actions_capwap_ac(&capwap_actions);
}
/* Bindings */
cw_register_actions_capwap_80211_ac(&capwap_actions);
//cw_register_actions_capwap_80211_ac(&capwap_actions);

View File

@ -29,13 +29,16 @@
#include "capwap/log.h"
#include "capwap/dbg.h"
#include "capwap/cw_util.h"
#include "capwap/action.h"
uint8_t conf_macaddress[12];
uint8_t conf_macaddress_len=0;
int conf_strict_capwap=1;
int conf_strict_headers=1;
long conf_strict_capwap=1;
long conf_strict_headers=1;
char * conf_capwap_mode_str=NULL;
int conf_capwap_mode=CW_MODE_STD;
@ -570,6 +573,22 @@ static int conf_read_dbg_level(cfg_t *cfg)
return 1;
}
void conf_init_capwap_mode()
{
if ( conf_capwap_mode_str==NULL)
return;
if ( 0==strcmp(conf_capwap_mode_str,"cipwap")){
conf_capwap_mode=CW_MODE_CIPWAP;
}
if ( 0==strcmp(conf_capwap_mode_str,"capwap")){
conf_capwap_mode=CW_MODE_STD;
}
}
int read_config(const char * filename){
int i,n;
@ -593,6 +612,7 @@ int read_config(const char * filename){
CFG_SIMPLE_BOOL("strict_capwap",&conf_strict_capwap),
CFG_SIMPLE_BOOL("strict_headers",&conf_strict_headers),
CFG_SIMPLE_STR("capwap_mode",&conf_capwap_mode_str),
#ifdef WITH_LWAPP
@ -692,6 +712,8 @@ int read_config(const char * filename){
if (!conf_image_dir)
conf_image_dir=CONF_DEFAULT_IMAGE_DIR;
conf_init_capwap_mode();
init_listen_addrs();
init_mcast_groups();

View File

@ -125,8 +125,9 @@ 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;
extern long conf_strict_capwap;
extern long conf_strict_headers;
extern int conf_capwap_mode;
#endif