Cisco AP can connect up to a data channel
FossilOrigin-Name: 3019e0265c564fb45223620a60ea7f4f1702fa00804804d5c9351a4f7e7d4205
This commit is contained in:
parent
1bdaa652a4
commit
09b2c70b95
@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CodeLite_Workspace Name="actube" Database="">
|
||||
<Project Name="ac" Path="ac.project" Active="No"/>
|
||||
<Project Name="ac" Path="ac.project" Active="Yes"/>
|
||||
<Project Name="wtp" Path="wtp.project" Active="No"/>
|
||||
<Project Name="mod_cipwap" Path="mod_cipwap.project" Active="No"/>
|
||||
<Project Name="mod_capwap" Path="mod_capwap.project" Active="No"/>
|
||||
<Project Name="mod_cisco" Path="mod_cisco.project" Active="No"/>
|
||||
<Project Name="libcw" Path="libcw.project" Active="Yes"/>
|
||||
<Project Name="libcw" Path="libcw.project" Active="No"/>
|
||||
<Project Name="mod_capwap80211" Path="mod_capwap80211.project" Active="No"/>
|
||||
<Project Name="mod_fortinet" Path="mod_fortinet.project" Active="No"/>
|
||||
<BuildMatrix>
|
||||
|
@ -79,7 +79,7 @@ capwap-timers/data-check-timer: Word: 10
|
||||
capwap-timers/echo-interval :Byte: 30
|
||||
capwap-timers/max-discovery-interval :Byte: 10
|
||||
|
||||
radio.255/admin-state :Str: enabled
|
||||
radio.255/operational-state/cause :Str: Normal
|
||||
radio.255/operational-state/state :Str: enabled
|
||||
#radio.255/admin-state :Str: enabled
|
||||
#radio.255/operational-state/cause :Str: Normal
|
||||
#radio.255/operational-state/state :Str: enabled
|
||||
|
||||
|
@ -85,20 +85,78 @@ void show_aps (FILE *out)
|
||||
}
|
||||
|
||||
|
||||
void con (FILE *out)
|
||||
{
|
||||
struct connlist * cl;
|
||||
mavliter_t it;
|
||||
|
||||
|
||||
|
||||
wtplist_lock();
|
||||
|
||||
cl = wtplist_get_connlist();
|
||||
|
||||
|
||||
mavliter_init (&it, cl->by_addr);
|
||||
fprintf (out, "IP\t\t\twtp-name\n");
|
||||
mavliter_foreach (&it) {
|
||||
cw_KTV_t * result;
|
||||
char addr[SOCK_ADDR_BUFSIZE];
|
||||
char wtp_name[CAPWAP_MAX_WTP_NAME_LEN];
|
||||
struct conn * conn;
|
||||
conn = mavliter_get_ptr (&it);
|
||||
|
||||
sock_addr2str_p (&conn->addr, addr);
|
||||
|
||||
result = cw_ktv_get (conn->remote_cfg, "wtp-name", NULL);
|
||||
|
||||
if (result == NULL) {
|
||||
strcpy (wtp_name, "");
|
||||
|
||||
} else {
|
||||
result->type->to_str (result, wtp_name, CAPWAP_MAX_WTP_NAME_LEN);
|
||||
}
|
||||
|
||||
|
||||
fprintf (out, "Con!! %s\t\t%s\n", addr, wtp_name);
|
||||
|
||||
{
|
||||
mavl_t update;
|
||||
update = cw_ktv_create();
|
||||
cw_ktv_set_byte(update,"radio.255/admin-state",1);
|
||||
conn->update_cfg=update;
|
||||
}
|
||||
|
||||
|
||||
fprintf(out,"\n");
|
||||
|
||||
}
|
||||
wtplist_unlock();
|
||||
}
|
||||
|
||||
|
||||
void execute_cmd (FILE * out, const char *str)
|
||||
{
|
||||
char cmd[1024];
|
||||
char args[1024];
|
||||
int n;
|
||||
|
||||
|
||||
sscanf (str, "%s%s", cmd, args);
|
||||
n = sscanf (str, "%s%s", cmd, args);
|
||||
|
||||
if (n<=0)
|
||||
return;
|
||||
/*printf("CMD: %s, ARGS:\n",cmd);*/
|
||||
|
||||
if (strcmp (cmd, "s") == 0) {
|
||||
show_aps (out);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp (cmd, "con")==0){
|
||||
con(out);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -116,7 +174,7 @@ void shell_loop (FILE *file)
|
||||
do {
|
||||
fprintf (file, "actube[%d]:>", fileno (file));
|
||||
fflush (file);
|
||||
|
||||
str[0]=0;
|
||||
fgets (str, sizeof (str), file);
|
||||
execute_cmd (file, str);
|
||||
|
||||
|
@ -386,6 +386,9 @@ static void * wtpman_main(void *arg)
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
switch (conn->capwap_transition){
|
||||
case CW_TRANSITION(CAPWAP_STATE_DTLS_SETUP, CAPWAP_STATE_JOIN):
|
||||
@ -435,8 +438,25 @@ static void * wtpman_main(void *arg)
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
while (!cw_timer_timeout(timer)) {
|
||||
if (conn->update_cfg != NULL){
|
||||
mavl_t tmp;
|
||||
tmp = conn->local_cfg;
|
||||
|
||||
conn->local_cfg=conn->update_cfg;
|
||||
|
||||
cw_dbg(DBG_INFO, "Updating WTP %s",sock_addr2str(&conn->addr,sock_buf));
|
||||
|
||||
rc = cw_send_request(conn, CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST);
|
||||
conn->update_cfg=NULL;
|
||||
conn->local_cfg=tmp;
|
||||
}
|
||||
|
||||
|
||||
rc = cw_read_messages(wtpman->conn);
|
||||
if (rc < 0) {
|
||||
if (errno == EAGAIN)
|
||||
|
@ -73,7 +73,8 @@ struct conn {
|
||||
|
||||
|
||||
mavl_t remote_cfg;
|
||||
/* mavl_t default_cfg;*/
|
||||
mavl_t default_cfg;
|
||||
mavl_t update_cfg;
|
||||
mavl_t local_cfg;
|
||||
mavl_t global_cfg;
|
||||
|
||||
|
@ -70,3 +70,33 @@ int cw_ktv_idx_get(mavl_t ktv, const char *key)
|
||||
|
||||
return atoi(d+1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int cw_ktv_idx_get_next(mavl_t ktv, const char *key, int n)
|
||||
{
|
||||
char ikey[CW_KTV_MAX_KEY_LEN];
|
||||
cw_KTV_t search, * result;
|
||||
char *d;
|
||||
|
||||
sprintf(ikey,"%s.%d",key,n);
|
||||
|
||||
search.key=ikey;
|
||||
/*//result = ktvn(ktv,&search);*/
|
||||
|
||||
result = mavl_get_first(ktv,&search);
|
||||
|
||||
if (result == NULL){
|
||||
return -1;
|
||||
}
|
||||
|
||||
d = strchr(result->key,'.');
|
||||
if (d==NULL){
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (strncmp(result->key,ikey,d-result->key)!=0)
|
||||
return -1;
|
||||
|
||||
return atoi(d+1);
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ int cw_ktv_write_struct(mavl_t ktv, const cw_KTVStruct_t * stru, const char *pke
|
||||
printf("Type mismatch: %s != %s\n",stru[i].type->name,result->type->name);
|
||||
if (stru[i].type->cast != NULL){
|
||||
if (!stru[i].type->cast(result)){
|
||||
cw_log(LOG_ERR,"Can't cast from %s to %s",result->type->name,stru[i].type->name);
|
||||
cw_log(LOG_ERR,"Can't cast '%s' from %s to %s",key,result->type->name,stru[i].type->name);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,8 @@
|
||||
#include "cw.h"
|
||||
#include "dbg.h"
|
||||
|
||||
int cw_ktv_idx_get_next(mavl_t ktv, const char *key, int n);
|
||||
|
||||
int cw_out_radio_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params
|
||||
, uint8_t * dst)
|
||||
{
|
||||
@ -9,6 +11,15 @@ int cw_out_radio_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerP
|
||||
int radios;
|
||||
len =0;
|
||||
|
||||
/* int idx=0;*/
|
||||
|
||||
/* while(1){
|
||||
char key[CW_KTV_MAX_KEY_LEN];
|
||||
sprintf(key,"radio.%d",idx);
|
||||
idx = cw_ktv_idx_get_next(params->conn->local_cfg,key,idx);
|
||||
idx++;
|
||||
}
|
||||
*/
|
||||
radios = cw_ktv_get_byte(params->conn->local_cfg,"wtp-descriptor/max-radios",0);
|
||||
|
||||
for(i=0;i<radios;i++){
|
||||
|
@ -2,27 +2,43 @@
|
||||
#include "cw.h"
|
||||
#include "dbg.h"
|
||||
|
||||
int cw_ktv_idx_get_next(mavl_t ktv, const char *key, int n);
|
||||
|
||||
int cw_out_radio_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params
|
||||
, uint8_t * dst)
|
||||
{
|
||||
int i,l, offset;
|
||||
int radios;
|
||||
/* int radios;*/
|
||||
uint8_t * cdst;
|
||||
|
||||
cdst = dst;
|
||||
|
||||
radios = cw_ktv_get_byte(params->conn->local_cfg,"wtp-descriptor/max-radios",0);
|
||||
/* radios = cw_ktv_get_byte(params->conn->local_cfg,"wtp-descriptor/max-radios",0);*/
|
||||
|
||||
/* int idx=0;
|
||||
while(1){
|
||||
|
||||
idx = cw_ktv_idx_get_next(params->conn->local_cfg,"radio",idx);
|
||||
idx++;
|
||||
}
|
||||
*/
|
||||
|
||||
offset = params->conn->header_len(handler);
|
||||
for(i=0;i<radios;i++){
|
||||
/* for(i=0;i<radios;i++){*/
|
||||
i=-1;
|
||||
while(1){
|
||||
char basekey[CW_KTV_MAX_KEY_LEN];
|
||||
cw_KTV_t * result;
|
||||
|
||||
i = cw_ktv_idx_get_next(params->conn->local_cfg,"radio",i+1);
|
||||
if (i==-1)
|
||||
break;
|
||||
sprintf(basekey,"radio.%d/%s",i,handler->key);
|
||||
|
||||
result = cw_ktv_base_exists(params->conn->local_cfg,basekey);
|
||||
if (result == NULL)
|
||||
if (result == NULL){
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
l=0;
|
||||
@ -32,7 +48,7 @@ int cw_out_radio_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemH
|
||||
|
||||
cdst+=params->conn->write_header(handler,cdst,l);
|
||||
|
||||
|
||||
|
||||
/* l = cw_write_radio_element(handler,params,i,dst+len);
|
||||
cw_dbg_elem(DBG_ELEM_OUT,params->conn,params->msgdata->type,handler,dst,l);
|
||||
len+=l;*/
|
||||
|
@ -663,7 +663,7 @@ static struct cw_MsgDef messages[] = {
|
||||
{
|
||||
"Configuration Update Reponse", /* name */
|
||||
CAPWAP_MSG_CONFIGURATION_UPDATE_RESPONSE, /* msg type */
|
||||
CW_ROLE_WTP, /* role */
|
||||
CW_ROLE_AC, /* role */
|
||||
configuration_update_response_states, /* allowed states */
|
||||
configuration_update_response_elements /* msg elements */
|
||||
},
|
||||
|
@ -10,17 +10,17 @@ ac-descriptor/software/vendor :Dword: 4232704
|
||||
ac-descriptor/software/version :Bstr16: .x08007900
|
||||
ac-descriptor/station-limit :Word: 1000
|
||||
ac-descriptor/stations :Word: 0
|
||||
ac-name :Bstr16: CisAC
|
||||
ac-name :Bstr16: X1
|
||||
ac-name-with-index.0 :Bstr16: tabbe88
|
||||
ac-name-with-index.1 :Bstr16: nudelnudel
|
||||
ac-name-with-index.2 :Bstr16: nadelnalde
|
||||
ac-name-with-priority/X1 :Byte: 3
|
||||
ac-name-with-priority/ac2 :Byte: 5
|
||||
capwap-control-ip-address/address.0 :IPAddress: 192.168.0.180
|
||||
capwap-control-ip-address/address.1 :IPAddress: 192.168.0.180
|
||||
capwap-control-ip-address/address.0 :IPAddress: 192.168.0.14
|
||||
capwap-control-ip-address/address.1 :IPAddress: 192.168.0.14
|
||||
capwap-control-ip-address/address.2 :IPAddress: 192.168.0.173
|
||||
capwap-control-ip-address/wtps.0 :Word: 0
|
||||
capwap-control-ip-address/wtps.1 :Word: 1
|
||||
capwap-control-ip-address/wtps.0 :Word: 2
|
||||
capwap-control-ip-address/wtps.1 :Word: 2
|
||||
capwap-control-ip-address/wtps.2 :Word: 1
|
||||
capwap-local-ip-address :IPAddress: 192.168.56.1
|
||||
capwap-timers/echo-interval :Byte: 30
|
||||
@ -61,7 +61,7 @@ cisco/ap-regulatory-domain.1/slot :Byte: 1
|
||||
cisco/ap-sub-mode :Byte: 0
|
||||
cisco/ap-telnet-ssh/ssh :Bool: false
|
||||
cisco/ap-telnet-ssh/telnet :Bool: false
|
||||
cisco/ap-timesync/timestamp :Dword: 1525620931
|
||||
cisco/ap-timesync/timestamp :Dword: 1525727327
|
||||
cisco/ap-timesync/type :Byte: 0
|
||||
cisco/ap-username-and-password/802.1x-credentials/option :Word: 2
|
||||
cisco/ap-username-and-password/802.1x-credentials/password :Str:
|
||||
@ -152,7 +152,7 @@ radio.0/cisco/wtp-radio-config/cfg-period :Byte: 4
|
||||
radio.0/cisco/wtp-radio-config/cfg-type :Byte: 1
|
||||
radio.0/cisco/wtp-radio-config/cfp-maximum-duration :Word: 60
|
||||
radio.0/cisco/wtp-radio-config/country-str1 :Str: DE
|
||||
radio.0/cisco/wtp-radio-config/country-str2 :Str: DE
|
||||
radio.0/cisco/wtp-radio-config/country-str2 :Str: DE
|
||||
radio.0/cisco/wtp-radio-config/gpr-period :Byte: 10
|
||||
radio.0/cisco/wtp-radio-config/max-stations :Byte: 200
|
||||
radio.0/cisco/wtp-radio-config/occupancy-limit :Word: 100
|
||||
@ -160,7 +160,7 @@ radio.0/cisco/wtp-radio-config/reg :Dword: 65536
|
||||
radio.0/cisco/wtp-radio-config/unknown75 :Byte: 0
|
||||
radio.0/decryption-error-report-period :Word: 120
|
||||
radio.0/operational-state/cause :Byte: Normal
|
||||
radio.0/operational-state/state :Byte: enabled
|
||||
radio.0/operational-state/state :Byte: 0
|
||||
radio.0/rate_set :Bstr16: .x82848b960c1218243048606c
|
||||
radio.0/wlan.0/allow-aaa-override :Byte: 0
|
||||
radio.0/wlan.0/broadcast-ssid :Bool: true
|
||||
@ -201,7 +201,7 @@ radio.1/cisco/wtp-radio-config/cfg-period :Byte: 4
|
||||
radio.1/cisco/wtp-radio-config/cfg-type :Byte: 1
|
||||
radio.1/cisco/wtp-radio-config/cfp-maximum-duration :Word: 60
|
||||
radio.1/cisco/wtp-radio-config/country-str1 :Str: DE
|
||||
radio.1/cisco/wtp-radio-config/country-str2 :Str: DE
|
||||
radio.1/cisco/wtp-radio-config/country-str2 :Str: DE
|
||||
radio.1/cisco/wtp-radio-config/gpr-period :Byte: 10
|
||||
radio.1/cisco/wtp-radio-config/max-stations :Byte: 200
|
||||
radio.1/cisco/wtp-radio-config/occupancy-limit :Word: 100
|
||||
@ -209,7 +209,7 @@ radio.1/cisco/wtp-radio-config/reg :Dword: 65536
|
||||
radio.1/cisco/wtp-radio-config/unknown75 :Byte: 1
|
||||
radio.1/decryption-error-report-period :Word: 120
|
||||
radio.1/operational-state/cause :Byte: Normal
|
||||
radio.1/operational-state/state :Byte: enabled
|
||||
radio.1/operational-state/state :Byte: 0
|
||||
radio.1/rate_set :Bstr16: .x8c129824b048606c
|
||||
radio.1/wlan.0/allow-aaa-override :Byte: 0
|
||||
radio.1/wlan.0/broadcast-ssid :Bool: true
|
||||
|
Loading…
Reference in New Issue
Block a user