Work on cw_select_ac function
FossilOrigin-Name: e245853b773869ddbf45dc5f454a61e8c7c32817659fe3d629c79eebfd6fbc45
This commit is contained in:
parent
fa785fe348
commit
4c9d1746c0
@ -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="wtp" Path="wtp.project" Active="No"/>
|
||||
<Project Name="wtp" Path="wtp.project" Active="Yes"/>
|
||||
<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>
|
||||
|
@ -16,11 +16,53 @@
|
||||
#include "wtp.h"
|
||||
|
||||
|
||||
int cw_select_ac(mlist_t aclist){
|
||||
mlistelem_t * e;
|
||||
mavl_t best_ac;
|
||||
|
||||
best_ac=NULL;
|
||||
|
||||
mlist_foreach(e,aclist){
|
||||
char str[1024];
|
||||
char key[CW_KTV_MAX_KEY_LEN];
|
||||
mavl_t cfg;
|
||||
int i;
|
||||
|
||||
cw_KTV_t * val;
|
||||
cfg = mlistelem_get_ptr(e);
|
||||
val = cw_ktv_get(cfg,"ac-name", CW_TYPE_BSTR16);
|
||||
if (val==NULL)
|
||||
continue;
|
||||
if (best_ac==NULL){
|
||||
best_ac=cfg;
|
||||
}
|
||||
|
||||
|
||||
val->type->to_str(val,str,1024);
|
||||
|
||||
i=0;
|
||||
do {
|
||||
sprintf(key,"%s.%d","capwap-control-ip-address/wtps",i);
|
||||
val = cw_ktv_get(cfg,key,CW_TYPE_WORD);
|
||||
if (val == NULL)
|
||||
break;
|
||||
|
||||
}while(1);
|
||||
printf("Here we have an AC: %s\n",str);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int run_discovery(struct conn *conn)
|
||||
{
|
||||
/*// conn->incomming = mbag_create();*/
|
||||
time_t timer;
|
||||
uint8_t dtype=0;
|
||||
/* uint8_t dtype=0;*/
|
||||
mlist_t discovery_results;
|
||||
struct sockaddr_storage from;
|
||||
|
||||
@ -58,7 +100,7 @@ static int run_discovery(struct conn *conn)
|
||||
conn->remote_cfg=cw_ktv_create();
|
||||
}
|
||||
|
||||
|
||||
cw_select_ac(discovery_results);
|
||||
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user