2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include "capwap.h"
|
2014-08-17 18:44:22 +02:00
|
|
|
#include "capwap_cisco.h"
|
2014-07-11 22:12:11 +02:00
|
|
|
#include "conn.h"
|
|
|
|
|
2015-03-17 01:10:08 +01:00
|
|
|
void cwsend_join_response(struct conn *conn, int seqnum, int rc, struct radioinfo *radioinfo,
|
|
|
|
struct ac_info *acinfo, struct wtpinfo *wtpinfo)
|
2014-07-11 22:12:11 +02:00
|
|
|
{
|
2015-03-17 01:10:08 +01:00
|
|
|
struct cwmsg *cwmsg = &conn->resp_msg;
|
2015-03-30 07:56:42 +02:00
|
|
|
cwmsg_init(cwmsg, conn->resp_buffer, CW_MSG_JOIN_RESPONSE, seqnum, NULL);
|
2015-03-17 01:10:08 +01:00
|
|
|
cwmsg->capwap_mode = conn->capwap_mode;
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2014-08-17 18:44:22 +02:00
|
|
|
/* mandatory messagesg elements */
|
2015-03-17 01:10:08 +01:00
|
|
|
cwmsg_addelem_result_code(cwmsg, rc);
|
2014-08-17 18:44:22 +02:00
|
|
|
|
2015-03-17 01:10:08 +01:00
|
|
|
cwmsg_addelem_ac_descriptor(cwmsg, acinfo,wtpinfo);
|
2015-03-23 07:48:27 +01:00
|
|
|
cwmsg_addelem(cwmsg, CW_ELEM_AC_NAME, acinfo->ac_name, strlen((char *) acinfo->ac_name));
|
2015-03-17 01:10:08 +01:00
|
|
|
cwmsg_addelem(cwmsg, CWMSGELEM_ECN_SUPPORT, &acinfo->ecn_support, sizeof(uint8_t));
|
2015-04-05 02:07:59 +02:00
|
|
|
// cwmsg_addelem_ctrl_ip_addrs(cwmsg, acinfo);
|
2015-03-17 01:10:08 +01:00
|
|
|
// cwmsg_addelem_cw_local_ip_addr(cwmsg,conn);
|
2014-08-17 18:44:22 +02:00
|
|
|
|
|
|
|
|
2015-03-17 01:10:08 +01:00
|
|
|
/* */
|
|
|
|
// cwmsg_addelem_image_identifier(cwmsg,CW_VENDOR_ID_CISCO,(uint8_t*)"/tobias",strlen("/tobias"));
|
2014-08-17 18:44:22 +02:00
|
|
|
|
2014-08-25 07:56:14 +02:00
|
|
|
|
2015-03-17 01:10:08 +01:00
|
|
|
uint8_t buffer[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
|
|
buffer[0] = 0; /* Mwar Type */
|
|
|
|
buffer[1] = 1; /* h/w version */
|
|
|
|
buffer[2] = 2; /* h/w Release */
|
|
|
|
buffer[3] = 0; /* h/w Maint */
|
|
|
|
buffer[4] = 3; /* h/w Build */
|
2014-08-25 07:56:14 +02:00
|
|
|
|
2015-03-17 01:10:08 +01:00
|
|
|
buffer[5] = 5; /* s/w version */
|
|
|
|
buffer[6] = 0; /* s/w Release */
|
|
|
|
buffer[7] = 19; /* s/w Maint */
|
|
|
|
buffer[8] = 2; /* s/w Build */
|
2014-08-17 18:44:22 +02:00
|
|
|
|
2015-03-17 01:10:08 +01:00
|
|
|
*((uint16_t *) (buffer + 9)) = htons(13); /* Active MS */
|
|
|
|
*((uint16_t *) (buffer + 9 + 2)) = htons(23); /* Supported MS */
|
|
|
|
*((uint16_t *) (buffer + 9 + 4)) = htons(5); /* Active RAD's */
|
|
|
|
*((uint16_t *) (buffer + 9 + 6)) = htons(15); /* Supported RAD's */
|
|
|
|
// cwmsg_addelem_vendor_specific_payload(cwmsg,CW_VENDOR_ID_CISCO, CWVENDOR_CISCO_MWAR, buffer,34);
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
2015-03-17 01:10:08 +01:00
|
|
|
conn_send_response(conn, cwmsg, seqnum);
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2015-03-17 01:10:08 +01:00
|
|
|
}
|