2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include "capwap/wtpinfo.h"
|
|
|
|
#include "capwap/acinfo.h"
|
|
|
|
#include "capwap/conn.h"
|
|
|
|
|
|
|
|
#include "wtp_conf.h"
|
|
|
|
#include "wtp_interface.h"
|
|
|
|
|
|
|
|
|
|
|
|
struct wtpinfo * get_wtpinfo()
|
|
|
|
{
|
|
|
|
struct wtpinfo * wtpinfo;
|
|
|
|
wtpinfo=malloc(sizeof(struct wtpinfo));
|
|
|
|
memset(wtpinfo,0,sizeof(struct wtpinfo));
|
|
|
|
|
|
|
|
wtpinfo->name = (uint8_t*)"wtp";
|
|
|
|
wtpinfo->location = (uint8_t*)"Unknown";
|
|
|
|
|
|
|
|
wtpinfo->max_radios=wtpdrv_get_num_radios();
|
|
|
|
/* int i;
|
|
|
|
for (i=0; i<wtpdrv_get_num_radios(); i++){
|
|
|
|
wtpdrv_get_radioinfo(i+1,&wtpinfo.radioinfo[i+1]);
|
|
|
|
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
wtpinfo->serial_no="123456789";
|
|
|
|
wtpinfo->vendor_id=909090;
|
|
|
|
|
|
|
|
wtpinfo->model_no="WNDR 3700";
|
|
|
|
|
2014-09-14 22:46:14 +02:00
|
|
|
wtpinfo->bootloader_version="";
|
2015-01-18 20:33:56 +01:00
|
|
|
wtpinfo->bootloader_vendor_id=CW_VENDOR_ID_CISCO;
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2014-09-14 22:46:14 +02:00
|
|
|
wtpinfo->hardware_version="\0\0";
|
2015-01-18 20:33:56 +01:00
|
|
|
wtpinfo->hardware_vendor_id=CW_VENDOR_ID_CISCO;
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2014-09-14 22:46:14 +02:00
|
|
|
wtpinfo->software_version="2.23(UJA.6)";
|
2015-01-18 20:33:56 +01:00
|
|
|
wtpinfo->software_vendor_id=CW_VENDOR_ID_CISCO;
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
wtpinfo->macaddress=conf_macaddress;
|
|
|
|
wtpinfo->macaddress_len=conf_macaddress_len;
|
|
|
|
|
2014-09-14 22:46:14 +02:00
|
|
|
wtpinfo->mac_type=0;
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
wtpinfo->session_id = malloc(8);
|
|
|
|
wtpinfo->session_id_len = cw_rand(wtpinfo->session_id,8);
|
|
|
|
|
|
|
|
|
2014-09-14 22:46:14 +02:00
|
|
|
wtpinfo->frame_tunnel_mode=1;
|
2014-07-11 22:12:11 +02:00
|
|
|
return wtpinfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
void destroy_wtpinfo(struct wtpinfo* wtpinfo)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ACIPLIST * order_aciplist(ACIPLIST *aciplistin)
|
|
|
|
{
|
|
|
|
// ACIPLIST * aciplist = aciplist_create();
|
|
|
|
|
|
|
|
// aciplist_foreach(aciplistin);
|
|
|
|
|
|
|
|
return aciplistin;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static struct conn * conn=0;
|
|
|
|
struct conn * get_conn()
|
|
|
|
{
|
|
|
|
if (!conn){
|
2014-07-20 19:33:50 +02:00
|
|
|
conn = conn_create_noq(-1,0);
|
2015-01-18 20:33:56 +01:00
|
|
|
if (conf_mtu){
|
|
|
|
conn->mtu=conf_mtu;
|
|
|
|
}
|
2014-07-11 22:12:11 +02:00
|
|
|
}
|
|
|
|
return conn;
|
|
|
|
}
|