More cisco-compatibility.
FossilOrigin-Name: 04ec8be34c8f04e70ce803fb8f47f72f426bdc7cf85edced8f09d3a9f1f0c50d
This commit is contained in:
@ -182,6 +182,18 @@ int read_config(const char * filename){
|
||||
}
|
||||
|
||||
|
||||
str = uci_lookup_option_string(ctx,section,"board_id");
|
||||
if (str){
|
||||
uint8_t * s = bstr_create_from_cfgstr(str);
|
||||
bstr_replace(&conf_board_id,s);
|
||||
}
|
||||
|
||||
str = uci_lookup_option_string(ctx,section,"board_revision");
|
||||
if (str){
|
||||
uint8_t * s = bstr_create_from_cfgstr(str);
|
||||
bstr_replace(&conf_board_revision,s);
|
||||
}
|
||||
|
||||
|
||||
str = uci_lookup_option_string(ctx,section,"serial_no");
|
||||
if (str){
|
||||
|
@ -134,6 +134,9 @@ static int do_discover_conn(struct conn * conn,struct discovery_info * di)
|
||||
struct radioinfo ri;
|
||||
memset(&ri,0,sizeof(ri));
|
||||
|
||||
struct radioinfo * rip = &wtpinfo->radioinfo[0];
|
||||
|
||||
/*
|
||||
ri.rmac[0]=6;
|
||||
ri.rmac[2]=14;
|
||||
ri.rmac[3]=14;
|
||||
@ -141,7 +144,7 @@ static int do_discover_conn(struct conn * conn,struct discovery_info * di)
|
||||
ri.rmac[5]=14;
|
||||
ri.rmac[6]=14;
|
||||
ri.rmac[7]=14;
|
||||
|
||||
*/
|
||||
|
||||
#ifdef WITH_CW_LOG_DEBUG
|
||||
char str[100];
|
||||
@ -153,7 +156,7 @@ static int do_discover_conn(struct conn * conn,struct discovery_info * di)
|
||||
|
||||
do {
|
||||
conn->capwap_mode=CWMODE_CISCO;
|
||||
rc = cwsend_discovery_request(conn,&ri,wtpinfo);
|
||||
rc = cwsend_discovery_request(conn,rip,wtpinfo);
|
||||
if (rc<0){
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
|
@ -20,6 +20,7 @@ void acinfo_log_(int level,const struct ac_info *acinfo,const char * xstr)
|
||||
{
|
||||
char str[8192];
|
||||
acinfo_print(str,acinfo);
|
||||
cw_dbg(DBG_CW_INFO,"%s",str);
|
||||
// cw_log_debug(level,"%s\n%s",xstr,str);
|
||||
return;
|
||||
}
|
||||
@ -35,37 +36,54 @@ int join_state(struct conn * conn)
|
||||
memset(&ri,0,sizeof(ri));
|
||||
int rc;
|
||||
|
||||
|
||||
struct radioinfo *rip = &(wtpinfo->radioinfo[0]);
|
||||
|
||||
#ifdef WITH_CW_LOG_DEBUG
|
||||
char str[64];
|
||||
sock_addrtostr(&conn->addr,str,64);
|
||||
// cw_log_debug0("Sending join request to %s",str);
|
||||
#endif
|
||||
printf("Seqnum before = %i\n",conn->seqnum);
|
||||
rc = cwsend_join_request(conn,&ri,wtpinfo);
|
||||
rc = cwsend_join_request(conn,rip,wtpinfo);
|
||||
printf("Seqnum after = %i\n",conn->seqnum);
|
||||
|
||||
|
||||
struct cwrmsg * cwrmsg;
|
||||
// do {
|
||||
int i;
|
||||
for(int i=0; i<10; i++){
|
||||
|
||||
cwrmsg = conn_get_message(conn);
|
||||
if ( cwrmsg)
|
||||
break;
|
||||
}
|
||||
printf("Received %08p\n",cwrmsg);
|
||||
// }while(cwrmsg==0);
|
||||
|
||||
|
||||
exit(0);
|
||||
|
||||
printf("SEQQQQS %d %d\n",cwrmsg->seqnum,conn->seqnum);
|
||||
|
||||
// cw_log_debug0("Received message %i",cwrmsg->seqnum);
|
||||
|
||||
if (cwrmsg->type != CWMSG_JOIN_RESPONSE || cwrmsg->seqnum != conn->seqnum){
|
||||
printf("Wrong message\n");
|
||||
printf("Wrong messagei %d %d\n",cwrmsg->seqnum,conn->seqnum);
|
||||
|
||||
}
|
||||
|
||||
struct ac_info acinfo;
|
||||
memset(&acinfo,0,sizeof(acinfo));
|
||||
|
||||
printf("cwrad\n");
|
||||
|
||||
cwread_join_response(&acinfo,cwrmsg->msgelems,cwrmsg->msgelems_len);
|
||||
printf("Done reading\n");
|
||||
|
||||
acinfo_log(0,&acinfo,"Connectet to the following AC");
|
||||
|
||||
printf("Result_code: %d\n",acinfo.result_code);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -74,6 +74,13 @@ uint8_t * conf_model_no;
|
||||
uint8_t * conf_serial_no;
|
||||
|
||||
|
||||
|
||||
bstr_t conf_board_id;
|
||||
bstr_t conf_board_revision;
|
||||
|
||||
|
||||
|
||||
|
||||
LONGSTRS conf_timer_cfgstrs[] = {
|
||||
"max_discovery_interval",&conf_max_discovery_interval,
|
||||
"discovery_interval",&conf_discovery_interval,
|
||||
@ -204,7 +211,8 @@ int wtpconf_preinit()
|
||||
conf_software_version = bstr_create_from_cfgstr(CONF_DEFAULT_SOFTWARE_VERSION);
|
||||
conf_serial_no = bstr_create_from_cfgstr(CONF_DEFAULT_SERIAL_NO);
|
||||
|
||||
|
||||
conf_board_id = bstr_create_from_cfgstr(CONF_DEFAULT_BOARD_ID);
|
||||
conf_board_revision = bstr_create_from_cfgstr(CONF_DEFAULT_BOARD_REVISION);
|
||||
}
|
||||
|
||||
int wtpconf_init()
|
||||
|
@ -4,6 +4,10 @@
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include "capwap/capwap.h"
|
||||
#include "capwap/bstr.h"
|
||||
|
||||
|
||||
|
||||
|
||||
extern int read_config(const char * filename);
|
||||
extern char * conf_wtpname;
|
||||
@ -25,6 +29,9 @@ extern uint8_t * conf_model_no;
|
||||
extern uint8_t * conf_serial_no;
|
||||
|
||||
|
||||
extern bstr_t conf_board_id;
|
||||
extern bstr_t conf_board_revision;
|
||||
|
||||
|
||||
extern struct sockaddr_storage * conf_preffered_ac_sa;
|
||||
extern char * conf_primary_if;
|
||||
@ -71,8 +78,13 @@ extern uint8_t conf_macaddress_len;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef CONF_DEFAULT_BOARD_ID
|
||||
#define CONF_DEFAULT_BOARD_ID "00"
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef CONF_DEFAULT_BOARD_REVISION
|
||||
#define CONF_DEFAULT_BOARD_REVISION "00"
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef CONF_DEFAULT_MAX_DISCOVERY_INTERVAL
|
||||
|
@ -19,7 +19,8 @@ struct wtpinfo * get_wtpinfo()
|
||||
wtpinfo=malloc(sizeof(struct wtpinfo));
|
||||
memset(wtpinfo,0,sizeof(struct wtpinfo));
|
||||
|
||||
wtpinfo->name = (uint8_t*)"wtpXY";
|
||||
wtpinfo->name = conf_wtpname;
|
||||
|
||||
wtpinfo->location = (uint8_t*)"default location";
|
||||
|
||||
wtpinfo->max_radios=wtpdrv_get_num_radios();
|
||||
@ -29,6 +30,8 @@ struct wtpinfo * get_wtpinfo()
|
||||
|
||||
}
|
||||
|
||||
wtpinfo->encryption_cap=1;
|
||||
|
||||
wtpinfo->serial_no=conf_serial_no;
|
||||
wtpinfo->vendor_id=conf_vendor_id;
|
||||
|
||||
@ -45,6 +48,8 @@ struct wtpinfo * get_wtpinfo()
|
||||
wtpinfo->bootloader_version=conf_bootloader_version;
|
||||
|
||||
|
||||
wtpinfo->board_id = conf_board_id;
|
||||
wtpinfo->board_revision = conf_board_revision;
|
||||
|
||||
wtpinfo->software_vendor_id=CW_VENDOR_ID_CISCO;
|
||||
|
||||
|
@ -1217,6 +1217,11 @@ int wtpdrv_get_radioinfo(int rid,struct radioinfo * radioinfo)
|
||||
{
|
||||
|
||||
radioinfo->rid=rid;
|
||||
//uint8_t rm[8]="12345600";
|
||||
uint8_t rm[8]={0x00,0x19,0xdb,0xe0,0x93,0x27};
|
||||
|
||||
radioinfo->rmac = bstr_create(rm,6);
|
||||
|
||||
radioinfo->type|=CW_IEEE80211_RADIO_TYPE_B; //CWRADIO_TYPE_N;
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user