Compare commits
No commits in common. "0078c07e583b8c3467093ae37c4a4e51e5a797c7" and "1e8b52fd034ded7d8a89e771519f108a070f211d" have entirely different histories.
0078c07e58
...
1e8b52fd03
@ -53,13 +53,6 @@ actube/rpc/listen: tcp:127.0.0.1:5000
|
|||||||
actube/rpc/enable: true
|
actube/rpc/enable: true
|
||||||
actube/rpc/macros-dir: ./rpc-macros
|
actube/rpc/macros-dir: ./rpc-macros
|
||||||
|
|
||||||
#
|
|
||||||
# This catches the initial config af a connecting WTP
|
|
||||||
# From Discovery to CFG Update
|
|
||||||
# The config is saved to a file named
|
|
||||||
# wtp-<wtpname-or-ip>.cfg
|
|
||||||
#
|
|
||||||
actube/save-initial-wtp-config: true
|
|
||||||
|
|
||||||
capwap/ac-descriptor/dtls-policy: 1
|
capwap/ac-descriptor/dtls-policy: 1
|
||||||
capwap/ac-descriptor/hardware/vendor: 4232704
|
capwap/ac-descriptor/hardware/vendor: 4232704
|
||||||
|
111
src/ac/wtpman.c
111
src/ac/wtpman.c
@ -415,70 +415,42 @@ static void copy(struct cw_ElemHandlerParams * params)
|
|||||||
cw_cfg_copy(params->cfg, params->conn->remote_cfg,DBG_CFG_UPDATES,"GlobalCfg");
|
cw_cfg_copy(params->cfg, params->conn->remote_cfg,DBG_CFG_UPDATES,"GlobalCfg");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void catch_cfg(struct cw_ElemHandlerParams * params, int create, const char *format, ...)
|
|
||||||
{
|
|
||||||
const char *wtpname;
|
|
||||||
char filename[200];
|
|
||||||
FILE *f;
|
|
||||||
cw_Cfg_t * cfg_list[3];
|
|
||||||
|
|
||||||
if (!cw_cfg_get_bool(params->conn->global_cfg,"actube/save-initial-wtp-config",0))
|
|
||||||
return;
|
|
||||||
|
|
||||||
cfg_list[0]=params->cfg;
|
|
||||||
cfg_list[1]=params->conn->remote_cfg;
|
|
||||||
cfg_list[2]=NULL;
|
|
||||||
|
|
||||||
wtpname = cw_cfg_get_l(cfg_list,"capwap/wtp-name","default");
|
|
||||||
sprintf(filename,"wtp-initial-%s.ckv",wtpname);
|
|
||||||
|
|
||||||
if (create)
|
|
||||||
f = fopen(filename,"w");
|
|
||||||
else
|
|
||||||
f = fopen(filename,"a");
|
|
||||||
if (f==NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (create)
|
|
||||||
fprintf(f,"#\n# Initial config for WTP '%s' - catched by ACTube\n#\n\n",wtpname);
|
|
||||||
|
|
||||||
if (format !=NULL){
|
|
||||||
va_list args;
|
|
||||||
va_start(args,format);
|
|
||||||
vfprintf(f,format,args);
|
|
||||||
va_end(args);
|
|
||||||
}
|
|
||||||
cw_cfg_write_to_file(f, params->cfg);
|
|
||||||
fclose(f);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int discovery_cb(struct cw_ElemHandlerParams * params, struct cw_MsgCb_data * d)
|
static int discovery_cb(struct cw_ElemHandlerParams * params, struct cw_MsgCb_data * d)
|
||||||
{
|
{
|
||||||
|
struct cw_Conn * conn = (struct cw_Conn*)params->conn;
|
||||||
|
char filename[200];
|
||||||
|
|
||||||
cw_dbg(DBG_X,"DISCOVERY Callback");
|
cw_dbg(DBG_X,"DISCOVERY Callback");
|
||||||
copy(params);
|
copy(params);
|
||||||
catch_cfg(params,1,"\n#\n# Discovery Request\n#\n");
|
|
||||||
|
|
||||||
|
const char * wtpname = cw_cfg_get(conn->remote_cfg,"capwap/wtp-name","default");
|
||||||
|
sprintf(filename,"wtp-discovery-%s.ckv",wtpname);
|
||||||
|
cw_cfg_save(filename,params->cfg,NULL);
|
||||||
cw_cfg_clear(params->cfg);
|
cw_cfg_clear(params->cfg);
|
||||||
if (d->parent)
|
|
||||||
return d->parent->fun(params,d->parent);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
static int join_cb(struct cw_ElemHandlerParams * params, struct cw_MsgCb_data *d)
|
static int join_cb(struct cw_ElemHandlerParams * params, struct cw_MsgCb_data *d)
|
||||||
{
|
{
|
||||||
catch_cfg(params,0,"\n#\n# Join Request\n#\n");
|
struct cw_Conn * conn = (struct cw_Conn*)params->conn;
|
||||||
if (d->parent)
|
char filename[200];
|
||||||
return d->parent->fun(params,d->parent);
|
int rc;
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
rc = 0;
|
||||||
|
if (d->parent)
|
||||||
|
rc =d->parent->fun(params,d->parent);
|
||||||
|
|
||||||
|
cw_dbg(DBG_X,"JOIN Callback");
|
||||||
|
copy(params);
|
||||||
|
const char * wtpname = cw_cfg_get(conn->remote_cfg,"capwap/wtp-name","default");
|
||||||
|
sprintf(filename,"wtp-join-%s.ckv",wtpname);
|
||||||
|
cw_cfg_save(filename,params->cfg,NULL);
|
||||||
|
cw_cfg_clear(params->cfg);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
static int fill_update_cfg(struct cw_Conn * conn)
|
static int fill_update_cfg(struct cw_Conn * conn)
|
||||||
@ -507,11 +479,24 @@ static int fill_update_cfg(struct cw_Conn * conn)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int cfg_status_cb(struct cw_ElemHandlerParams * params, struct cw_MsgCb_data *d)
|
static int update_cb(struct cw_ElemHandlerParams * params, struct cw_MsgCb_data *d)
|
||||||
{
|
{
|
||||||
catch_cfg(params,0,"\n#\n# Configuration Status Request\n#\n");
|
struct cw_Conn * conn = (struct cw_Conn*)params->conn;
|
||||||
|
char filename[200];
|
||||||
|
|
||||||
|
int rc = 0;
|
||||||
if (d->parent)
|
if (d->parent)
|
||||||
return d->parent->fun(params,d->parent);
|
rc =d->parent->fun(params,d->parent);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cw_dbg(DBG_X,"UPDATE Callback");
|
||||||
|
//fill_update_cfg(params->conn);
|
||||||
|
|
||||||
|
const char * wtpname = cw_cfg_get(conn->remote_cfg,"capwap/wtp-name","default");
|
||||||
|
sprintf(filename,"wtp-status-%s.ckv",wtpname);
|
||||||
|
cw_cfg_save(filename,params->cfg,NULL);
|
||||||
|
//stop();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -606,10 +591,6 @@ struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
cw_conn_register_msg_cb(wtpman->conn,
|
|
||||||
CAPWAP_MSG_DISCOVERY_REQUEST,
|
|
||||||
discovery_cb);
|
|
||||||
|
|
||||||
|
|
||||||
wtpman->conn->global_cfg = global_cfg;
|
wtpman->conn->global_cfg = global_cfg;
|
||||||
wtpman->conn->local_cfg = cw_cfg_create();
|
wtpman->conn->local_cfg = cw_cfg_create();
|
||||||
@ -670,12 +651,16 @@ struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr,
|
|||||||
|
|
||||||
|
|
||||||
cw_conn_register_msg_cb(wtpman->conn,
|
cw_conn_register_msg_cb(wtpman->conn,
|
||||||
CAPWAP_MSG_JOIN_REQUEST,
|
CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||||
join_cb);
|
discovery_cb);
|
||||||
|
|
||||||
cw_conn_register_msg_cb(wtpman->conn,
|
/* cw_conn_set_msg_cb(wtpman->conn,
|
||||||
|
CAPWAP_MSG_JOIN_REQUEST,
|
||||||
|
join_cb);*/
|
||||||
|
|
||||||
|
/* cw_conn_register_msg_cb(wtpman->conn,
|
||||||
CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST,
|
CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST,
|
||||||
cfg_status_cb);
|
update_cb);*/
|
||||||
|
|
||||||
cw_conn_register_msg_cb(wtpman->conn,
|
cw_conn_register_msg_cb(wtpman->conn,
|
||||||
CAPWAP_MSG_WTP_EVENT_REQUEST,
|
CAPWAP_MSG_WTP_EVENT_REQUEST,
|
||||||
@ -700,7 +685,7 @@ struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr,
|
|||||||
|
|
||||||
void wtpman_addpacket(struct wtpman *wtpman, uint8_t * packet, int len)
|
void wtpman_addpacket(struct wtpman *wtpman, uint8_t * packet, int len)
|
||||||
{
|
{
|
||||||
cw_dbg(DBG_X,"ADD PACKET DETECTED %d",wtpman->conn->detected);
|
// cw_dbg(DBG_X,"ADD PACKET DETECTED %d",wtpman->conn->detected);
|
||||||
conn_q_add_packet(wtpman->conn, packet, len);
|
conn_q_add_packet(wtpman->conn, packet, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,11 +40,6 @@ struct wtpman {
|
|||||||
|
|
||||||
cw_Cfg_t * wtp_cfg;
|
cw_Cfg_t * wtp_cfg;
|
||||||
|
|
||||||
cw_Cfg_t * discovery_cfg;
|
|
||||||
cw_Cfg_t * join_cfg;
|
|
||||||
cw_Cfg_t * config_status_cfg;
|
|
||||||
|
|
||||||
|
|
||||||
int update;
|
int update;
|
||||||
int ctr;
|
int ctr;
|
||||||
};
|
};
|
||||||
|
@ -90,7 +90,6 @@ int cw_cfg_get_first_index(cw_Cfg_t * cfg, const char *key, int n);
|
|||||||
int cw_cfg_get_first_index_l(cw_Cfg_t ** cfgs, const char *key, int n);
|
int cw_cfg_get_first_index_l(cw_Cfg_t ** cfgs, const char *key, int n);
|
||||||
|
|
||||||
int cw_cfg_get_int(cw_Cfg_t * cfg, const char *key, int def);
|
int cw_cfg_get_int(cw_Cfg_t * cfg, const char *key, int def);
|
||||||
int cw_cfg_write_to_file(FILE *f, cw_Cfg_t * cfg);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
3074
src/mod/cisco/cisco_actions.c
Normal file
3074
src/mod/cisco/cisco_actions.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -16,17 +16,10 @@ int cisco_out_lw_path_mtu(struct cw_ElemHandler * eh,
|
|||||||
int len,max;
|
int len,max;
|
||||||
|
|
||||||
int hl = params->msgset->header_len(eh);
|
int hl = params->msgset->header_len(eh);
|
||||||
|
|
||||||
/* get the current length of message */
|
|
||||||
int cl = dst-params->rawmsg;
|
int cl = dst-params->rawmsg;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int wl = 1400-cl-hl;
|
int wl = 1400-cl-hl;
|
||||||
|
|
||||||
printf("HL:%d CL:%d WL: %d\n",hl,cl,wl);
|
printf("HL:%d CL:%d WL: %d\n",hl,cl,wl);
|
||||||
if (wl<=40)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
sprintf(key,"%s/%s",eh->key,"len");
|
sprintf(key,"%s/%s",eh->key,"len");
|
||||||
len = cw_cfg_get_word_l(params->cfg_list,key,0);
|
len = cw_cfg_get_word_l(params->cfg_list,key,0);
|
||||||
|
@ -678,26 +678,26 @@ static cw_ValStruct_t dtls_data_cfg[]={
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
static cw_ValStruct_t cisco_add_wlan[]={
|
static cw_ValStruct_t cisco_add_wlan[]={
|
||||||
{CW_TYPE_BYTE,"radio-id",1,-1},
|
{CW_TYPE_BYTE,"radio-id",1,-1},
|
||||||
{CW_TYPE_WORD,"capwap80211/capability",2,-1},
|
{CW_TYPE_WORD,"wlan-capability",2,-1},
|
||||||
{CW_TYPE_BYTE,"wlan-id",1,-1},
|
{CW_TYPE_BYTE,"wlan-id",1,-1},
|
||||||
{CW_TYPE_DWORD,"cisco/encryption-policy",4,-1},
|
{CW_TYPE_DWORD,"encryption-policy",4,-1},
|
||||||
|
|
||||||
{CW_TYPE_BSTR16,"cisco/wep-key",13,9},
|
{CW_TYPE_BSTR16,"wep-key",13,9},
|
||||||
{CW_TYPE_BYTE,"cisco/wep-encryption",1,42},
|
{CW_TYPE_BYTE,"encryption",1,42},
|
||||||
|
|
||||||
{CW_TYPE_BOOL,"cisco/broadcast-ssid",1,426},
|
{CW_TYPE_BOOL,"broadcast-ssid",1,426},
|
||||||
{CW_TYPE_WORD,"cisco/session-timout",2,475},
|
{CW_TYPE_WORD,"session-timout",2,475},
|
||||||
{CW_TYPE_BYTE, "cisco/dtim-period",1,541},
|
{CW_TYPE_BYTE, "dtim-period",1,541},
|
||||||
{CW_TYPE_STR, "cisco/ssid-a",30,545},
|
{CW_TYPE_STR, "ssid-a",30,545},
|
||||||
{CW_TYPE_BYTE, "cisco/allow-aaa-override",1,578},
|
{CW_TYPE_BYTE, "allow-aaa-override",1,578},
|
||||||
{CW_TYPE_BYTE, "cisco/max-stations",1,580},
|
{CW_TYPE_BYTE, "max-stations",1,580},
|
||||||
|
|
||||||
{NULL,NULL,0,0}
|
{NULL,NULL,0,0}
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
static cw_ValStruct_t cisco_add_wlan70[]={
|
static cw_ValStruct_t cisco_add_wlan70[]={
|
||||||
{CW_TYPE_BYTE,"radio-id",1,-1},
|
{CW_TYPE_BYTE,"radio-id",1,-1},
|
||||||
@ -966,7 +966,7 @@ static struct cw_ElemHandler handlers70[] = {
|
|||||||
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
|
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
|
||||||
1,512, /* min/max length */
|
1,512, /* min/max length */
|
||||||
CW_TYPE_BSTR16, /* type */
|
CW_TYPE_BSTR16, /* type */
|
||||||
"capwap/wtp-name", /* Key */
|
"cisco/rad-name", /* Key */
|
||||||
cw_in_generic, /* get */
|
cw_in_generic, /* get */
|
||||||
cw_out_generic /* put */
|
cw_out_generic /* put */
|
||||||
}
|
}
|
||||||
@ -2479,10 +2479,9 @@ static struct cw_ElemDef configuration_status_request_elements[] ={
|
|||||||
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_HARDWARE_INFO, 0, 0},
|
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_HARDWARE_INFO, 0, 0},
|
||||||
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_ROUGE_DETECTION, 0, 0},
|
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_ROUGE_DETECTION, 0, 0},
|
||||||
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_AP_DTLS_DATA_CFG, 0, 0},
|
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_AP_DTLS_DATA_CFG, 0, 0},
|
||||||
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_PATH_MTU, 0, 0},
|
// {CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_PATH_MTU, 0, 0},
|
||||||
|
|
||||||
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_DISCOVERY_PROTOCOL, 1, 0},
|
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_DISCOVERY_PROTOCOL, 1, 0},
|
||||||
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_RAD_EXTENDED_CONFIG, 0, 0},
|
|
||||||
{0,0,0,00}
|
{0,0,0,00}
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -2877,7 +2876,7 @@ static struct cw_ElemHandler handlers73[] = {
|
|||||||
"AP LED State Config (>= v7.3)", /* name */
|
"AP LED State Config (>= v7.3)", /* name */
|
||||||
CISCO_ELEM_AP_LED_STATE_CONFIG, /* Element ID */
|
CISCO_ELEM_AP_LED_STATE_CONFIG, /* Element ID */
|
||||||
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
|
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
|
||||||
2,2, /* min/max length */
|
1,1, /* min/max length */
|
||||||
CW_TYPE_STRUCT, /* type */
|
CW_TYPE_STRUCT, /* type */
|
||||||
"cisco/ap-led-state-config", /* Key */
|
"cisco/ap-led-state-config", /* Key */
|
||||||
cw_in_generic, /* get */
|
cw_in_generic, /* get */
|
||||||
@ -3305,7 +3304,6 @@ static int join_cb_ac(struct cw_ElemHandlerParams *params, struct cw_MsgCb_data
|
|||||||
cw_dbg(DBG_X,"My Radio Information: %d",ri);
|
cw_dbg(DBG_X,"My Radio Information: %d",ri);
|
||||||
/* Send our radio information as "radio id 0" to the WTP */
|
/* Send our radio information as "radio id 0" to the WTP */
|
||||||
cw_cfg_set_int(params->conn->update_cfg,"radio.0/capwap80211/wtp-radio-information",ri);
|
cw_cfg_set_int(params->conn->update_cfg,"radio.0/capwap80211/wtp-radio-information",ri);
|
||||||
set_ac_version(params);
|
|
||||||
|
|
||||||
|
|
||||||
/* for (i=0; (i=cw_cfg_get_first_index(params->cfg,"radio",i))!=-1; i++){
|
/* for (i=0; (i=cw_cfg_get_first_index(params->cfg,"radio",i))!=-1; i++){
|
||||||
|
Loading…
Reference in New Issue
Block a user