mod_capwap for WTP can handle discovery resp.
FossilOrigin-Name: 61394aa98b11d7b8576d1fa648b00dac6518d387597c131ec4ea8f4f712b2b22
This commit is contained in:
parent
d1bd7f3b27
commit
fca1378eaa
@ -3,11 +3,22 @@
|
||||
|
||||
#include "mavl.h"
|
||||
#include "mbag.h"
|
||||
//#include "mavl.h"
|
||||
|
||||
/**
|
||||
* Used to store AC Name With Priority elements.
|
||||
*/
|
||||
struct cw_acprio{
|
||||
/**
|
||||
* AC Name
|
||||
*/
|
||||
char *name;
|
||||
/**
|
||||
* IP of AC
|
||||
*/
|
||||
struct sockaddr_storage * addr;
|
||||
/**
|
||||
* Priority
|
||||
*/
|
||||
uint8_t prio;
|
||||
};
|
||||
|
||||
|
@ -109,6 +109,7 @@ struct cw_itemdef capwap_itemdefs[] = {
|
||||
{CW_ITEM_CAPWAP_TIMERS,CW_ITEM_NONE,MBAG_WORD},
|
||||
|
||||
{CW_ITEM_AC_NAME_WITH_PRIORITY,CW_ITEM_ANY,MBAG_STR},
|
||||
{CW_ITEM_AC_NAME,CW_ITEM_NONE,MBAG_STR},
|
||||
|
||||
|
||||
{CW_ITEM_AP_MODE_AND_TYPE,CW_ITEM_NONE,MBAG_WORD},
|
||||
|
@ -8,7 +8,76 @@
|
||||
|
||||
static cw_action_in_t actions_in[] = {
|
||||
|
||||
/* Message Discovery Response */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.end = cw_in_check_disc_resp
|
||||
}
|
||||
,
|
||||
|
||||
/* AC Descriptor - Discovery Response */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.elem_id = CW_ELEM_AC_DESCRIPTOR,
|
||||
.item_id = CW_ITEM_AC_DESCRIPTOR,
|
||||
.start = cw_in_ac_descriptor,
|
||||
.min_len = 12,
|
||||
.max_len = 8192,
|
||||
.mand = 1
|
||||
}
|
||||
,
|
||||
|
||||
/* AC Name - Discovery Response */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.elem_id = CW_ELEM_AC_NAME,
|
||||
.item_id = CW_ITEM_AC_NAME,
|
||||
.start = cw_in_generic2,
|
||||
.min_len = 1,
|
||||
.max_len = 512,
|
||||
.mand = 1
|
||||
}
|
||||
,
|
||||
|
||||
/* CAPWAP Control IPv4 Address - Discovery Response*/
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.elem_id = CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS,
|
||||
.item_id = CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST,
|
||||
.start = cw_in_capwap_control_ipv4_address,
|
||||
.min_len = 6,
|
||||
.max_len = 6,
|
||||
.mand = 1
|
||||
}
|
||||
|
||||
,
|
||||
|
||||
/* CAPWAP Control IPv6 Address - Discovery Response*/
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.elem_id = CW_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS,
|
||||
.item_id = CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST,
|
||||
.start = cw_in_capwap_control_ipv4_address, // Change to v6 handler
|
||||
.min_len = 6,
|
||||
.max_len = 6,
|
||||
.mand = 1
|
||||
}
|
||||
,
|
||||
|
||||
/* Vendor Specific Payload - Discovery Response*/
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_VENDOR_SPECIFIC_PAYLOAD,
|
||||
.start = cw_in_vendor_specific_payload
|
||||
}
|
||||
,
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -44,6 +44,13 @@
|
||||
|
||||
cw_aciplist_t cw_select_ac(struct conn *conn, mbag_t dis)
|
||||
{
|
||||
/* create a list for results */
|
||||
cw_aciplist_t resultlist=cw_aciplist_create();
|
||||
if (!resultlist)
|
||||
return NULL;
|
||||
if (dis)
|
||||
return resultlist;
|
||||
|
||||
|
||||
cw_aciplist_t aciplist = cw_aciplist_create();
|
||||
if (!aciplist) {
|
||||
@ -61,7 +68,6 @@ cw_aciplist_t cw_select_ac(struct conn *conn, mbag_t dis)
|
||||
// if (priolist )
|
||||
priolist=cw_acpriolist_create();
|
||||
|
||||
cw_aciplist_t resultlist=cw_aciplist_create();
|
||||
|
||||
|
||||
DEFINE_AVLITER(i, dis);
|
||||
|
@ -145,9 +145,9 @@ mavl_destroy(b);
|
||||
conn->base_rmac = get_base_rmac();
|
||||
|
||||
conn->capwap_mode = CW_MODE_CAPWAP;
|
||||
conn->capwap_mode = CW_MODE_CISCO;
|
||||
//conn->capwap_mode = CW_MODE_CISCO;
|
||||
|
||||
the_conn->strict_capwap = 0;
|
||||
the_conn->strict_capwap = 1;
|
||||
|
||||
|
||||
conn->config = mbag_create();
|
||||
|
Loading…
Reference in New Issue
Block a user