Init state machine
FossilOrigin-Name: 05b6545a5e1640a5f904ba9c07dd2734df2dfd9ade87d4cfcaaee24bfdc6a638
This commit is contained in:
parent
d1c04bc7fd
commit
7d1ef1ff01
@ -11,13 +11,62 @@
|
|||||||
#include "cw/dbg.h"
|
#include "cw/dbg.h"
|
||||||
|
|
||||||
|
|
||||||
void execute_cmd(const char *str)
|
#include "cw/connlist.h"
|
||||||
|
|
||||||
|
|
||||||
|
#include "wtplist.h"
|
||||||
|
|
||||||
|
void show_aps(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,"%s\t\t%s\n",addr,wtp_name);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
wtplist_unlock();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void execute_cmd(FILE * out, const char *str)
|
||||||
{
|
{
|
||||||
char cmd[1024];
|
char cmd[1024];
|
||||||
char args[1024];
|
char args[1024];
|
||||||
|
|
||||||
sscanf(str,"%s%s",cmd,args);
|
sscanf(str,"%s%s",cmd,args);
|
||||||
printf("CMD: %s, ARGS: %s\n",cmd,args);
|
printf("CMD: %s, ARGS:\n",cmd);
|
||||||
|
|
||||||
|
show_aps(out);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -39,7 +88,7 @@ void shell_loop(FILE *file)
|
|||||||
fflush(file);
|
fflush(file);
|
||||||
|
|
||||||
fgets(str,sizeof(str),file);
|
fgets(str,sizeof(str),file);
|
||||||
execute_cmd(str);
|
execute_cmd(file,str);
|
||||||
|
|
||||||
}while (c!=EOF);
|
}while (c!=EOF);
|
||||||
|
|
||||||
|
@ -103,6 +103,10 @@ void wtplist_remove(struct wtpman * wtpman)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct connlist * wtplist_get_connlist(void)
|
||||||
|
{
|
||||||
|
return connlist;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,6 +14,6 @@ extern void wtplist_remove(struct wtpman * wtpman);
|
|||||||
extern void wtplist_lock();
|
extern void wtplist_lock();
|
||||||
extern void wtplist_unlock();
|
extern void wtplist_unlock();
|
||||||
extern struct wtpman * wtplist_get_by_session_id(uint8_t *session_id);
|
extern struct wtpman * wtplist_get_by_session_id(uint8_t *session_id);
|
||||||
|
struct connlist * wtplist_get_connlist(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -19,7 +19,7 @@ ac-name-with-priority/ac2 :Byte: 5
|
|||||||
capwap-control-ip-address/address.0 :IPAddress: 192.168.0.175
|
capwap-control-ip-address/address.0 :IPAddress: 192.168.0.175
|
||||||
capwap-control-ip-address/address.1 :IPAddress: 192.168.0.175
|
capwap-control-ip-address/address.1 :IPAddress: 192.168.0.175
|
||||||
capwap-control-ip-address/address.2 :IPAddress: 192.168.0.173
|
capwap-control-ip-address/address.2 :IPAddress: 192.168.0.173
|
||||||
capwap-control-ip-address/wtps.0 :Word: 0
|
capwap-control-ip-address/wtps.0 :Word: 1
|
||||||
capwap-control-ip-address/wtps.1 :Word: 1
|
capwap-control-ip-address/wtps.1 :Word: 1
|
||||||
capwap-control-ip-address/wtps.2 :Word: 1
|
capwap-control-ip-address/wtps.2 :Word: 1
|
||||||
capwap-local-ip-address :IPAddress: 192.168.56.1
|
capwap-local-ip-address :IPAddress: 192.168.56.1
|
||||||
@ -61,7 +61,7 @@ cisco/ap-regulatory-domain.1/slot :Byte: 1
|
|||||||
cisco/ap-sub-mode :Byte: 0
|
cisco/ap-sub-mode :Byte: 0
|
||||||
cisco/ap-telnet-ssh/ssh :Bool: false
|
cisco/ap-telnet-ssh/ssh :Bool: false
|
||||||
cisco/ap-telnet-ssh/telnet :Bool: false
|
cisco/ap-telnet-ssh/telnet :Bool: false
|
||||||
cisco/ap-timesync/timestamp :Dword: 1525248241
|
cisco/ap-timesync/timestamp :Dword: 1525354079
|
||||||
cisco/ap-timesync/type :Byte: 0
|
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/option :Word: 2
|
||||||
cisco/ap-username-and-password/802.1x-credentials/password :Str:
|
cisco/ap-username-and-password/802.1x-credentials/password :Str:
|
||||||
|
Loading…
Reference in New Issue
Block a user