Working on Cisoc support.
FossilOrigin-Name: 3b605a558b58d0288e1ee3c60277c74967b120fcb500e3458b3b7c7d71903bae
This commit is contained in:
@ -21,17 +21,30 @@
|
||||
#include "capwap.h"
|
||||
#include "capwap_cisco.h"
|
||||
|
||||
#include "lwapp_cisco.h"
|
||||
|
||||
#include "conn.h"
|
||||
#include "cwmsg.h"
|
||||
|
||||
#include "sock.h"
|
||||
|
||||
#include "acinfo.h" //Tube
|
||||
|
||||
|
||||
int cwsend_join_request(struct conn *conn, struct radioinfo *radioinfo, struct wtpinfo *wtpinfo)
|
||||
{
|
||||
uint8_t buffer[CWMSG_MAX_SIZE];
|
||||
struct cwmsg cwmsg;
|
||||
|
||||
|
||||
|
||||
//radioinfo->rmac=0;
|
||||
|
||||
cwmsg_init(&cwmsg, buffer, CWMSG_JOIN_REQUEST, conn_get_next_seqnum(conn), radioinfo);
|
||||
cwmsg.capwap_mode = conn->capwap_mode;
|
||||
|
||||
// printf("Rad info rmac %s\n",sock_hwaddr2str(bstr_data(radioinfo->rmac),bstr_len(radioinfo->rmac)));
|
||||
|
||||
/* Mandatory elements */
|
||||
|
||||
/* location data */
|
||||
@ -57,20 +70,38 @@ int cwsend_join_request(struct conn *conn, struct radioinfo *radioinfo, struct w
|
||||
/* WTP MAC type */
|
||||
cwmsg_addelem(&cwmsg, CWMSGELEM_WTP_MAC_TYPE, &wtpinfo->mac_type, sizeof(uint8_t));
|
||||
|
||||
/* WTP radio information elements */
|
||||
cwmsg_addelem_wtp_radio_infos(&cwmsg, wtpinfo->radioinfo);
|
||||
|
||||
/* local ip address */
|
||||
cwmsg_addelem_cw_local_ip_addr(&cwmsg, conn);
|
||||
|
||||
/* maximum message length */
|
||||
uint16_t l = htons(wtpinfo->max_msg_len);
|
||||
cwmsg_addelem(&cwmsg, CWMSGELEM_MAXIMUM_MESSAGE_LENGTH, (uint8_t *) & l, sizeof(l));
|
||||
|
||||
|
||||
|
||||
|
||||
switch (conn->capwap_mode) {
|
||||
case CWMODE_CISCO:
|
||||
cwmsg_addelem_vendor_cisco_mwar_addr(&cwmsg,conn);
|
||||
|
||||
uint8_t data207[4] = {11,77,30,31};
|
||||
uint8_t data207[4] = {1,1,0,1};
|
||||
|
||||
cwmsg_addelem_vendor_specific_payload(&cwmsg,CW_VENDOR_ID_CISCO,
|
||||
CWVENDOR_CISCO_BOARD_DATA_OPTIONS,data207,4);
|
||||
CW_CISCO_BOARD_DATA_OPTIONS,data207,4);
|
||||
|
||||
cwmsg_addelem_vendor_specific_payload(&cwmsg,CW_VENDOR_ID_CISCO,
|
||||
|
||||
|
||||
// cwmsg_ae(cw_addelem_vendor_specific_payload(&cwmsg,CW_VENDOR_ID_CISCO,
|
||||
// CWVENDOR_CISCO_BOARD_DATA_OPTIONS,data207,4);
|
||||
|
||||
/* cwmsg_addelem_vendor_specific_payload(&cwmsg,CW_VENDOR_ID_CISCO,
|
||||
CWVENDOR_CISCO_AP_GROUP_NAME,(uint8_t*)"Tobias",strlen("Tobias"));
|
||||
*/
|
||||
|
||||
|
||||
cwmsg_addelem_vendor_s_payload(&cwmsg, CW_VENDOR_ID_CISCO,
|
||||
CW_CISCO_AP_GROUP_NAME,(uint8_t *)"default-group",strlen("default-group"));
|
||||
|
||||
|
||||
break;
|
||||
@ -80,15 +111,38 @@ int cwsend_join_request(struct conn *conn, struct radioinfo *radioinfo, struct w
|
||||
sizeof(uint8_t));
|
||||
}
|
||||
|
||||
/* local ip address */
|
||||
cwmsg_addelem_cw_local_ip_addr(&cwmsg, conn);
|
||||
/* WTP radio information elements */
|
||||
cwmsg_addelem_wtp_radio_infos(&cwmsg, wtpinfo->radioinfo);
|
||||
|
||||
|
||||
/* Non-mandatory elements */
|
||||
|
||||
/* maximum message length */
|
||||
uint16_t l = htons(wtpinfo->max_msg_len);
|
||||
cwmsg_addelem(&cwmsg, CWMSGELEM_MAXIMUM_MESSAGE_LENGTH, (uint8_t *) & l, sizeof(l));
|
||||
switch (conn->capwap_mode) {
|
||||
case CWMODE_CISCO:
|
||||
{
|
||||
uint8_t mtu[2048];
|
||||
int l = lw_put_cisco_path_mtu(mtu,1485,1101);
|
||||
|
||||
printf("Len = %d\n",l);
|
||||
|
||||
// cwmsg_addelem_vendor_specific_payload(&cwmsg,LW_VENDOR_CISCO,
|
||||
// LW_ELEM_VENDOR_SPECIFIC,mtu,l);
|
||||
|
||||
|
||||
// (&cwmsg)->pos+=4;
|
||||
struct ac_info acinfo;
|
||||
extern struct ac_info wtp_acinfo;
|
||||
|
||||
// memset(&acinfo,0,sizeof(struct ac_info));
|
||||
// cwmsg_addelem_ac_descriptor(&cwmsg,&wtp_acinfo,wtpinfo);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
printf("MTU %d\n",conn->mtu);
|
||||
return conn_send_cwmsg(conn, &cwmsg);
|
||||
}
|
||||
|
Reference in New Issue
Block a user