Cisco support ... more
FossilOrigin-Name: b58fc76b825799dba82404f86b1e927fa902e5825fe06210d9894f1d2b4168b8
This commit is contained in:
parent
4a20f80250
commit
36750c3b44
@ -11,7 +11,7 @@ ifndef ARCH
|
||||
endif
|
||||
|
||||
LDFLAGS+=-g -D_REENTRANT -L/usr/local/lib -L../capwap/$(ARCH)
|
||||
CFLAGS += -Wall -g -O0 -D_REENTRANT -DIPV6 -I/usr/local/include -I../capwap
|
||||
CFLAGS += -Wall -g -O3 -D_REENTRANT -DIPV6 -I/usr/local/include -I../capwap
|
||||
|
||||
|
||||
LIBS+=-lcapwap
|
||||
|
@ -318,8 +318,6 @@ static int init_listen_addrs()
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (ifa->ifa_addr->sa_family==AF_INET && conf_ipv4){
|
||||
sock_addrtostr(ifa->ifa_addr,str,100);
|
||||
*strchr(str,':')=0;
|
||||
|
@ -369,6 +369,13 @@ static void wtpman_run_discovery(void *arg)
|
||||
cwread_discovery_request(&wtpman->wtpinfo,cwrmsg->msgelems,cwrmsg->msgelems_len);
|
||||
|
||||
|
||||
|
||||
printf("RMAC-LEN:%d\n",cwrmsg->rmac[0]);
|
||||
|
||||
printf("HW: %s\n",sock_hwaddr2str(bstr_data(cwrmsg->rmac),bstr_len(cwrmsg->rmac)));
|
||||
|
||||
|
||||
|
||||
conn_detect_capwap(wtpman->conn,&wtpman->wtpinfo);
|
||||
|
||||
char wtpinfostr[8192];
|
||||
@ -379,6 +386,8 @@ static void wtpman_run_discovery(void *arg)
|
||||
|
||||
struct radioinfo radioinfo;
|
||||
radioinfo.rid = cwrmsg->rid;
|
||||
radioinfo.rmac = 0; //&cwrmsg->rmac;
|
||||
|
||||
// memcpy(radioinfo.rmac, cwrmsg->rmac,8);
|
||||
// radioinfo.rmac[0]=0;
|
||||
|
||||
@ -530,6 +539,8 @@ static int wtpman_join(void *arg,time_t timer)
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
process_join_request(&wtpman->wtpinfo,cwrmsg->msgelems,cwrmsg->msgelems_len);
|
||||
conn_detect_capwap(wtpman->conn,&wtpman->wtpinfo);
|
||||
|
||||
|
@ -196,8 +196,8 @@ O:=$(OBJS);
|
||||
|
||||
OBJS:=$(patsubst %.o,$(ARCH)/%.o,$(OBJS))
|
||||
|
||||
#CFLAGS = -Wall -g -O3 -D_REENTRANT -DWITH_IPV6
|
||||
CFLAGS = -Wall -g -O0 -D_REENTRANT -DWITH_IPV6 -DWITH_RMAC_SUPPORT
|
||||
CFLAGS = -Wall -g -O3 -D_REENTRANT -DWITH_IPV6 -DWITH_RMAC_SUPPORT
|
||||
#CFLAGS = -Wall -g -O0 -D_REENTRANT -DWITH_IPV6 -DWITH_RMAC_SUPPORT
|
||||
|
||||
CFLAGS += $(GNUTLS_CFLAGS) \
|
||||
-DWITH_CW_LOG \
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include <string.h>
|
||||
#include "capwap.h"
|
||||
|
||||
|
||||
void cwmsg_addelem_ac_descriptor(struct cwmsg *msg,struct ac_info * acinfo)
|
||||
{
|
||||
uint8_t buffer[12+2048];
|
||||
@ -27,14 +26,11 @@ void cwmsg_addelem_ac_descriptor(struct cwmsg *msg,struct ac_info * acinfo)
|
||||
|
||||
*((uint32_t*)(acd))=htonl((acinfo->stations<<16) | (acinfo->limit));
|
||||
*((uint32_t*)(acd+4))=htonl((acinfo->active_wtps<<16) | acinfo->max_wtps);
|
||||
|
||||
//printf("(((((((((((((((((((((((((((((((((((((((((((((((((((((((( %d\n",acinfo->dtls_policy);
|
||||
*((uint32_t*)(acd+8))=htonl((acinfo->security<<24) | (acinfo->rmac<<16) | acinfo->dtls_policy );
|
||||
|
||||
|
||||
int len = 12;
|
||||
int sublen;
|
||||
//goto u;
|
||||
|
||||
sublen = 4;
|
||||
|
||||
@ -44,14 +40,14 @@ void cwmsg_addelem_ac_descriptor(struct cwmsg *msg,struct ac_info * acinfo)
|
||||
len+=4;
|
||||
*(acd+len)=5; len++;
|
||||
*(acd+len)=0; len++;
|
||||
*(acd+len)=19; len++;
|
||||
*(acd+len)=2; len++;
|
||||
*(acd+len)=72; len++;
|
||||
*(acd+len)=71; len++;
|
||||
*(acd+len)=5; len++;
|
||||
*(acd+len)=6; len++;
|
||||
*(acd+len)=7; len++;
|
||||
*(acd+len)=8; len++;
|
||||
|
||||
/*
|
||||
|
||||
*((uint32_t*)(acd+len))=htonl(CW_VENDOR_ID_CISCO);
|
||||
len+=4;
|
||||
*((uint32_t*)(acd+len))=htonl((1<<16)|sublen);
|
||||
@ -65,18 +61,17 @@ void cwmsg_addelem_ac_descriptor(struct cwmsg *msg,struct ac_info * acinfo)
|
||||
*(acd+len)=7; len++;
|
||||
*(acd+len)=8; len++;
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
goto b;
|
||||
//u:
|
||||
|
||||
/* software version subelement */
|
||||
|
||||
*((uint32_t*)(acd+len))=htonl(CW_VENDOR_ID_CISCO);
|
||||
len+=4;
|
||||
sublen=strlen((const char*)acinfo->software_version);
|
||||
*((uint32_t*)(acd+len))=htonl((5<<16)|sublen);
|
||||
*((uint32_t*)(acd+len))=htonl((1<<16)|sublen);
|
||||
len+=4;
|
||||
memcpy(acd+len,acinfo->software_version,sublen);
|
||||
len+=sublen;
|
||||
|
@ -21,8 +21,10 @@
|
||||
#include "capwap_cisco.h"
|
||||
|
||||
|
||||
void cwmsg_addelem_vendor_cisco_ap_timesync(struct cwmsg * cwmsg)
|
||||
void cwmsg_addelem_vendor_cisco_ap_timesync(struct cwmsg *cwmsg)
|
||||
{
|
||||
time_t t = htonl(time(NULL));
|
||||
cwmsg_addelem_vendor_specific_payload(cwmsg,CW_VENDOR_ID_CISCO,CWVENDOR_CISCO_AP_TIMESYNC,(uint8_t*)&t,sizeof(t));
|
||||
//time_t t = htonl(time(NULL));
|
||||
uint32_t t = htonl(time(NULL));
|
||||
cwmsg_addelem_vendor_specific_payload(cwmsg, CW_VENDOR_ID_CISCO, CWVENDOR_CISCO_AP_TIMESYNC,
|
||||
(uint8_t *) & t, sizeof(t));
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ void cwmsg_addelem_wtp_radio_info(struct cwmsg * msg,struct radioinfo *radioinfo
|
||||
void cwmsg_addelem_wtp_radio_infos(struct cwmsg * msg,struct radioinfo * radioinfos)
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<2; i++)
|
||||
for (i=1; i<=4; i++)
|
||||
{
|
||||
// if (radioinfos[i].rid!=0)
|
||||
cwmsg_addelem_wtp_radio_info(msg,&radioinfos[i]);
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include "capwap.h"
|
||||
#include "cwmsg.h"
|
||||
|
||||
#include "sock.h" //Tube
|
||||
|
||||
void cwmsg_init(struct cwmsg * cwmsg, uint8_t *buffer, int type, int seqnum, struct radioinfo * radioinfo)
|
||||
{
|
||||
int hlen=8;
|
||||
@ -39,12 +41,16 @@ void cwmsg_init(struct cwmsg * cwmsg, uint8_t *buffer, int type, int seqnum, str
|
||||
*(buffer+8)=rmaclen;
|
||||
memcpy(buffer+9,bstr_data(radioinfo->rmac),rmaclen);
|
||||
cwmsg->flags=CWTH_FLAGS_M;
|
||||
rmaclen++;
|
||||
}
|
||||
}
|
||||
|
||||
hlen+=rmaclen+1;
|
||||
if (hlen%4)
|
||||
hlen+=rmaclen;
|
||||
if (hlen%4){
|
||||
int n = hlen;
|
||||
hlen = (hlen>>2)*4+4;
|
||||
memset(buffer+n,0,hlen-n);
|
||||
}
|
||||
|
||||
|
||||
cwmsg->ctrlhdr=cwmsg->trnsprthdr+hlen;
|
||||
|
@ -45,9 +45,9 @@ void cwsend_discovery_response(struct conn * conn,int seqnum, struct radioinfo *
|
||||
|
||||
|
||||
/* Send Cisco-specific message elements if needed */
|
||||
if (conn->capwap_mode == CWMODE_CISCO){
|
||||
cwmsg_addelem_vendor_cisco_ap_timesync(cwmsg);
|
||||
}
|
||||
// if (conn->capwap_mode == CWMODE_CISCO){
|
||||
// cwmsg_addelem_vendor_cisco_ap_timesync(cwmsg);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
@ -80,12 +80,24 @@ static int msg_cb(void *priv,struct cwrmsg * cwrmsg)
|
||||
|
||||
acinfo.aciplist = di->aciplist;
|
||||
|
||||
|
||||
|
||||
|
||||
cwread_discovery_response(&acinfo,cwrmsg->msgelems,cwrmsg->msgelems_len);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
char ai [4096];
|
||||
acinfo_print(ai,&acinfo);
|
||||
printf("AC INFO\n%s",ai);
|
||||
|
||||
|
||||
printf("CWRHW: %s\n",sock_hwaddr2str(bstr_data(cwrmsg->rmac),bstr_len(cwrmsg->rmac)));
|
||||
exit(0);
|
||||
|
||||
|
||||
/*
|
||||
printf("AC NAME %s\n",acinfo.ac_name);
|
||||
printf("AC Software version %s\n",acinfo.software_version);
|
||||
|
Loading…
Reference in New Issue
Block a user