2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include "capwap/wtpinfo.h"
|
|
|
|
#include "capwap/acinfo.h"
|
|
|
|
#include "capwap/conn.h"
|
2015-03-14 10:15:12 +01:00
|
|
|
#include "capwap/capwap_ieee80211.h"
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
#include "wtp_conf.h"
|
|
|
|
#include "wtp_interface.h"
|
|
|
|
|
|
|
|
|
|
|
|
struct wtpinfo * get_wtpinfo()
|
|
|
|
{
|
|
|
|
struct wtpinfo * wtpinfo;
|
2015-03-12 23:21:57 +01:00
|
|
|
|
|
|
|
|
2014-07-11 22:12:11 +02:00
|
|
|
wtpinfo=malloc(sizeof(struct wtpinfo));
|
|
|
|
memset(wtpinfo,0,sizeof(struct wtpinfo));
|
|
|
|
|
2015-03-14 21:41:50 +01:00
|
|
|
wtpinfo->name = conf_wtpname;
|
|
|
|
|
2015-03-14 10:15:12 +01:00
|
|
|
wtpinfo->location = (uint8_t*)"default location";
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
wtpinfo->max_radios=wtpdrv_get_num_radios();
|
2015-03-14 10:15:12 +01:00
|
|
|
int i;
|
2014-07-11 22:12:11 +02:00
|
|
|
for (i=0; i<wtpdrv_get_num_radios(); i++){
|
2015-03-14 10:15:12 +01:00
|
|
|
wtpdrv_get_radioinfo(i,&(wtpinfo->radioinfo[i]));
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
}
|
2015-03-14 10:15:12 +01:00
|
|
|
|
2015-03-14 21:41:50 +01:00
|
|
|
wtpinfo->encryption_cap=1;
|
|
|
|
|
2015-03-12 23:21:57 +01:00
|
|
|
wtpinfo->serial_no=conf_serial_no;
|
2015-02-01 16:55:45 +01:00
|
|
|
wtpinfo->vendor_id=conf_vendor_id;
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2015-02-01 16:55:45 +01:00
|
|
|
wtpinfo->model_no=conf_model_no;
|
2014-07-11 22:12:11 +02:00
|
|
|
|
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
|
|
|
|
2015-02-01 16:55:45 +01:00
|
|
|
wtpinfo->software_version=conf_software_version;
|
2015-03-14 10:15:12 +01:00
|
|
|
wtpinfo->hardware_version=conf_hardware_version;
|
|
|
|
wtpinfo->bootloader_version=conf_bootloader_version;
|
|
|
|
|
|
|
|
|
2015-03-14 21:41:50 +01:00
|
|
|
wtpinfo->board_id = conf_board_id;
|
|
|
|
wtpinfo->board_revision = conf_board_revision;
|
2015-03-14 10:15:12 +01:00
|
|
|
|
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
|
|
|
|
|
|
|
|
2015-03-14 10:15:12 +01:00
|
|
|
// wtpinfo->session_id = malloc(8);
|
|
|
|
// wtpinfo->session_id_len = cw_rand(wtpinfo->session_id,8);
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2015-03-14 10:15:12 +01:00
|
|
|
uint8_t sessid[4];
|
|
|
|
int sidl = cw_rand(sessid,4);
|
|
|
|
wtpinfo->session_id = bstr_create(sessid,sidl);
|
2014-07-11 22:12:11 +02:00
|
|
|
|
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;
|
|
|
|
}
|
2015-01-18 21:01:28 +01:00
|
|
|
conn->mtu_discovery=conf_mtu_discovery;
|
2014-07-11 22:12:11 +02:00
|
|
|
}
|
|
|
|
return conn;
|
|
|
|
}
|