From 434305390b0d7b09e66bc30f47d7f22f83b25c21 Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Sun, 26 Apr 2015 13:12:44 +0000 Subject: [PATCH] Added config etry to ac.conf for capwap_mode FossilOrigin-Name: bdbad2d11f21777bf7abe717a506d94c875cfa61be73bd262416aab233dd8e07 --- src/ac/ac.default.conf | 13 ++++++++++++- src/ac/ac_main.c | 12 +++++++++++- src/ac/conf.c | 26 ++++++++++++++++++++++++-- src/ac/conf.h | 5 +++-- 4 files changed, 50 insertions(+), 6 deletions(-) diff --git a/src/ac/ac.default.conf b/src/ac/ac.default.conf index 4d703995..c776251f 100644 --- a/src/ac/ac.default.conf +++ b/src/ac/ac.default.conf @@ -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 diff --git a/src/ac/ac_main.c b/src/ac/ac_main.c index 5153affe..a14c3200 100644 --- a/src/ac/ac_main.c +++ b/src/ac/ac_main.c @@ -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); diff --git a/src/ac/conf.c b/src/ac/conf.c index 32119797..fcb58a43 100644 --- a/src/ac/conf.c +++ b/src/ac/conf.c @@ -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(); diff --git a/src/ac/conf.h b/src/ac/conf.h index 1ae7387a..bf9592bb 100644 --- a/src/ac/conf.h +++ b/src/ac/conf.h @@ -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