Join to a real vWLC works
FossilOrigin-Name: 924b4e58697b9cd2c2326f541e8cc302be46496c4b5ffb29d73fc305b5d7bf56
This commit is contained in:
parent
d53b45ccb9
commit
572e1b6d97
@ -4,9 +4,9 @@
|
|||||||
<Project Name="wtp" Path="wtp.project" Active="No"/>
|
<Project Name="wtp" Path="wtp.project" Active="No"/>
|
||||||
<Project Name="mod_cipwap" Path="mod_cipwap.project" Active="No"/>
|
<Project Name="mod_cipwap" Path="mod_cipwap.project" Active="No"/>
|
||||||
<Project Name="mod_capwap" Path="mod_capwap.project" Active="No"/>
|
<Project Name="mod_capwap" Path="mod_capwap.project" Active="No"/>
|
||||||
<Project Name="mod_cisco" Path="mod_cisco.project" Active="Yes"/>
|
<Project Name="mod_cisco" Path="mod_cisco.project" Active="No"/>
|
||||||
<Project Name="libcw" Path="libcw.project" Active="No"/>
|
<Project Name="libcw" Path="libcw.project" Active="No"/>
|
||||||
<Project Name="mod_capwap80211" Path="mod_capwap80211.project" Active="No"/>
|
<Project Name="mod_capwap80211" Path="mod_capwap80211.project" Active="Yes"/>
|
||||||
<Project Name="mod_fortinet" Path="mod_fortinet.project" Active="No"/>
|
<Project Name="mod_fortinet" Path="mod_fortinet.project" Active="No"/>
|
||||||
<BuildMatrix>
|
<BuildMatrix>
|
||||||
<WorkspaceConfiguration Name="Debug" Selected="yes">
|
<WorkspaceConfiguration Name="Debug" Selected="yes">
|
||||||
|
@ -215,8 +215,8 @@
|
|||||||
#define CW_ELEM_ADD_MAC_ACL_ENTRY 7
|
#define CW_ELEM_ADD_MAC_ACL_ENTRY 7
|
||||||
#define CW_ELEM_ADD_STATION 8
|
#define CW_ELEM_ADD_STATION 8
|
||||||
#define CW_ELEM_RESERVED_9 9
|
#define CW_ELEM_RESERVED_9 9
|
||||||
#define CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS 10
|
#define CAPWAP_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS 10
|
||||||
#define CW_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS 11
|
#define CAPWAP_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS 11
|
||||||
/**@}*/
|
/**@}*/
|
||||||
#define CAPWAP_ELEM_CAPWAP_LOCAL_IPV4_ADDRESS 30
|
#define CAPWAP_ELEM_CAPWAP_LOCAL_IPV4_ADDRESS 30
|
||||||
#define CAPWAP_ELEM_CAPWAP_LOCAL_IPV6_ADDRESS 50
|
#define CAPWAP_ELEM_CAPWAP_LOCAL_IPV6_ADDRESS 50
|
||||||
|
@ -13,8 +13,8 @@ struct cw_StrListElem capwap_strings_elem[] = {
|
|||||||
{CW_ELEM_ADD_MAC_ACL_ENTRY, "Add MAC ACL Entry"},
|
{CW_ELEM_ADD_MAC_ACL_ENTRY, "Add MAC ACL Entry"},
|
||||||
{CW_ELEM_ADD_STATION, "Add Station"},
|
{CW_ELEM_ADD_STATION, "Add Station"},
|
||||||
{CW_ELEM_RESERVED_9, "Reserved 9"},
|
{CW_ELEM_RESERVED_9, "Reserved 9"},
|
||||||
{CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS, "Control IPv4 Address"},
|
{CAPWAP_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS, "Control IPv4 Address"},
|
||||||
{CW_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS, "Control IPv6 Address"},
|
{CAPWAP_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS, "Control IPv6 Address"},
|
||||||
{CAPWAP_ELEM_CAPWAP_LOCAL_IPV4_ADDRESS, "CAWPAP Local IPv4 Address"},
|
{CAPWAP_ELEM_CAPWAP_LOCAL_IPV4_ADDRESS, "CAWPAP Local IPv4 Address"},
|
||||||
{CAPWAP_ELEM_CAPWAP_LOCAL_IPV6_ADDRESS, "CAPWAP Local IPv6 Address"},
|
{CAPWAP_ELEM_CAPWAP_LOCAL_IPV6_ADDRESS, "CAPWAP Local IPv6 Address"},
|
||||||
{CW_ELEM_CAPWAP_TIMERS, "CAPWAP Timers"},
|
{CW_ELEM_CAPWAP_TIMERS, "CAPWAP Timers"},
|
||||||
|
@ -295,14 +295,23 @@ static int process_elements(struct conn *conn, uint8_t * rawmsg, int len,
|
|||||||
|
|
||||||
if (!message){
|
if (!message){
|
||||||
/* Message is unknown */
|
/* Message is unknown */
|
||||||
|
if (search.type & 1){
|
||||||
|
cw_dbg(DBG_MSG_ERR,
|
||||||
|
"Message type %d [%s] unrecognized, sending response.",
|
||||||
|
search.type, cw_strmsg(search.type),
|
||||||
|
cw_strstate(conn->capwap_state));
|
||||||
|
result_code = CAPWAP_RESULT_MSG_UNRECOGNIZED;
|
||||||
|
cw_send_error_response(conn, rawmsg, result_code);
|
||||||
|
errno = EAGAIN;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
cw_dbg(DBG_MSG_ERR,
|
cw_dbg(DBG_MSG_ERR,
|
||||||
"Message type %d (%s) unrecognized, sending response.",
|
"Message type %d [%s] unrecognized, discarding.",
|
||||||
search.type, cw_strmsg(search.type),
|
search.type, cw_strmsg(search.type),
|
||||||
cw_strstate(conn->capwap_state));
|
cw_strstate(conn->capwap_state));
|
||||||
result_code = CAPWAP_RESULT_MSG_UNRECOGNIZED;
|
|
||||||
cw_send_error_response(conn, rawmsg, result_code);
|
|
||||||
errno = EAGAIN;
|
errno = EAGAIN;
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Throw away unexpected messages */
|
/* Throw away unexpected messages */
|
||||||
|
@ -10,9 +10,6 @@ cw_KTV_t * cw_ktv_add(mavl_t kvtstore, const char *key, const struct cw_Type *ty
|
|||||||
cw_KTV_t mdata, *mresult;
|
cw_KTV_t mdata, *mresult;
|
||||||
int exists;
|
int exists;
|
||||||
|
|
||||||
/* cw_dbg(DBG_ELEM,"KVStore (%p,%d) add elem (%s): %s", kvstore, kvstore->count,
|
|
||||||
type->name, key );
|
|
||||||
*/
|
|
||||||
mdata.key=cw_strdup(key);
|
mdata.key=cw_strdup(key);
|
||||||
if (!mdata.key){
|
if (!mdata.key){
|
||||||
cw_log(LOG_ERR, "Can't allocate memory for KTV key %s: %s",
|
cw_log(LOG_ERR, "Can't allocate memory for KTV key %s: %s",
|
||||||
@ -27,7 +24,8 @@ cw_KTV_t * cw_ktv_add(mavl_t kvtstore, const char *key, const struct cw_Type *ty
|
|||||||
free(mdata.key);
|
free(mdata.key);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mavl_del(kvtstore,&mdata);
|
||||||
mresult = mavl_add(kvtstore, &mdata, &exists);
|
mresult = mavl_add(kvtstore, &mdata, &exists);
|
||||||
if (exists){
|
if (exists){
|
||||||
cw_log(LOG_ERR, "Element already exists %s", key);
|
cw_log(LOG_ERR, "Element already exists %s", key);
|
||||||
|
@ -134,7 +134,7 @@ static struct cw_ElemHandler handlers[] = {
|
|||||||
|
|
||||||
{
|
{
|
||||||
"CAPWAP Control IPv4 Address", /* name */
|
"CAPWAP Control IPv4 Address", /* name */
|
||||||
CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS, /* Element ID */
|
CAPWAP_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS, /* Element ID */
|
||||||
0,0, /* Vendor / Proto */
|
0,0, /* Vendor / Proto */
|
||||||
6,6, /* min/max length */
|
6,6, /* min/max length */
|
||||||
CW_TYPE_BSTR16, /* type */
|
CW_TYPE_BSTR16, /* type */
|
||||||
@ -145,7 +145,7 @@ static struct cw_ElemHandler handlers[] = {
|
|||||||
|
|
||||||
{
|
{
|
||||||
"CAPWAP Control IPv6 Address", /* name */
|
"CAPWAP Control IPv6 Address", /* name */
|
||||||
CW_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS, /* Element ID */
|
CAPWAP_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS, /* Element ID */
|
||||||
0,0, /* Vendor / Proto */
|
0,0, /* Vendor / Proto */
|
||||||
18,18, /* min/max length */
|
18,18, /* min/max length */
|
||||||
CW_TYPE_BSTR16, /* type */
|
CW_TYPE_BSTR16, /* type */
|
||||||
@ -272,8 +272,8 @@ static int discovery_response_states[] = {CAPWAP_STATE_DISCOVERY,0};
|
|||||||
static struct cw_ElemDef discovery_response_elements[] ={
|
static struct cw_ElemDef discovery_response_elements[] ={
|
||||||
{0,0,CAPWAP_ELEM_AC_DESCRIPTOR, 1, 0},
|
{0,0,CAPWAP_ELEM_AC_DESCRIPTOR, 1, 0},
|
||||||
{0,0,CAPWAP_ELEM_AC_NAME, 1, 0},
|
{0,0,CAPWAP_ELEM_AC_NAME, 1, 0},
|
||||||
{0,0,CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS, 1, 0},
|
{0,0,CAPWAP_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS, 1, 0},
|
||||||
{0,0,CW_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS, 1, 0},
|
{0,0,CAPWAP_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS, 1, 0},
|
||||||
{0,0,CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD, 0, CW_IGNORE},
|
{0,0,CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD, 0, CW_IGNORE},
|
||||||
{0,0,0,0,0}
|
{0,0,0,0,0}
|
||||||
|
|
||||||
@ -312,6 +312,14 @@ static struct cw_ElemDef join_response_elements[] ={
|
|||||||
{0,0,CAPWAP_ELEM_AC_DESCRIPTOR, 1, 0},
|
{0,0,CAPWAP_ELEM_AC_DESCRIPTOR, 1, 0},
|
||||||
{0,0,CAPWAP_ELEM_AC_NAME, 1, 0},
|
{0,0,CAPWAP_ELEM_AC_NAME, 1, 0},
|
||||||
{0,0,CAPWAP_ELEM_ECN_SUPPORT, 1, 0},
|
{0,0,CAPWAP_ELEM_ECN_SUPPORT, 1, 0},
|
||||||
|
{0,0,CAPWAP_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS, 1, 0},
|
||||||
|
{0,0,CAPWAP_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS, 1, 0},
|
||||||
|
{0,0,CAPWAP_ELEM_CAPWAP_LOCAL_IPV4_ADDRESS, 1, 0},
|
||||||
|
{0,0,CAPWAP_ELEM_CAPWAP_LOCAL_IPV6_ADDRESS, 1, 0},
|
||||||
|
|
||||||
|
{0,0,CAPWAP_ELEM_MAXIMUM_MESSAGE_LENGTH, 0, 0},
|
||||||
|
{0,0,CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD, 0, CW_IGNORE},
|
||||||
|
|
||||||
/* {0,0,CAPWAP_ELEM_AC_DESCRIPTOR, 1, 0},
|
/* {0,0,CAPWAP_ELEM_AC_DESCRIPTOR, 1, 0},
|
||||||
{0,0,CAPWAP_ELEM_AC_NAME, 1, 0},
|
{0,0,CAPWAP_ELEM_AC_NAME, 1, 0},
|
||||||
{0,0,CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS, 1, 0},
|
{0,0,CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS, 1, 0},
|
||||||
|
@ -46,7 +46,7 @@ static cw_action_in_t actions_in[] = {
|
|||||||
{
|
{
|
||||||
.capwap_state = CAPWAP_STATE_DISCOVERY,
|
.capwap_state = CAPWAP_STATE_DISCOVERY,
|
||||||
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||||
.elem_id = CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS,
|
.elem_id = CAPWAP_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS,
|
||||||
.item_id = CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST,
|
.item_id = CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST,
|
||||||
.start = cw_in_capwap_control_ip_address,
|
.start = cw_in_capwap_control_ip_address,
|
||||||
.min_len = 6,
|
.min_len = 6,
|
||||||
@ -60,7 +60,7 @@ static cw_action_in_t actions_in[] = {
|
|||||||
{
|
{
|
||||||
.capwap_state = CAPWAP_STATE_DISCOVERY,
|
.capwap_state = CAPWAP_STATE_DISCOVERY,
|
||||||
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||||
.elem_id = CW_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS,
|
.elem_id = CAPWAP_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS,
|
||||||
.item_id = CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST,
|
.item_id = CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST,
|
||||||
.start = cw_in_capwap_control_ip_address, // Change to v6 handler
|
.start = cw_in_capwap_control_ip_address, // Change to v6 handler
|
||||||
.min_len = 18,
|
.min_len = 18,
|
||||||
@ -163,7 +163,7 @@ static cw_action_in_t actions_in[] = {
|
|||||||
{
|
{
|
||||||
.capwap_state = CAPWAP_STATE_JOIN,
|
.capwap_state = CAPWAP_STATE_JOIN,
|
||||||
.msg_id = CAPWAP_MSG_JOIN_RESPONSE,
|
.msg_id = CAPWAP_MSG_JOIN_RESPONSE,
|
||||||
.elem_id = CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS,
|
.elem_id = CAPWAP_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS,
|
||||||
.item_id = CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST,
|
.item_id = CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST,
|
||||||
.start = cw_in_capwap_control_ip_address,
|
.start = cw_in_capwap_control_ip_address,
|
||||||
.min_len = 6,
|
.min_len = 6,
|
||||||
@ -176,7 +176,7 @@ static cw_action_in_t actions_in[] = {
|
|||||||
{
|
{
|
||||||
.capwap_state = CAPWAP_STATE_JOIN,
|
.capwap_state = CAPWAP_STATE_JOIN,
|
||||||
.msg_id = CAPWAP_MSG_JOIN_RESPONSE,
|
.msg_id = CAPWAP_MSG_JOIN_RESPONSE,
|
||||||
.elem_id = CW_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS,
|
.elem_id = CAPWAP_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS,
|
||||||
.item_id = CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST,
|
.item_id = CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST,
|
||||||
.start = cw_in_capwap_control_ip_address, // Change to v6 handler
|
.start = cw_in_capwap_control_ip_address, // Change to v6 handler
|
||||||
.min_len = 18,
|
.min_len = 18,
|
||||||
|
@ -76,12 +76,12 @@ int capwap_out_capwap_control_ip_address(struct cw_ElemHandler * eh,
|
|||||||
l = address->type->len(address);
|
l = address->type->len(address);
|
||||||
|
|
||||||
switch(eh->id){
|
switch(eh->id){
|
||||||
case CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS:
|
case CAPWAP_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS:
|
||||||
if (l!=4){
|
if (l!=4){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CW_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS:
|
case CAPWAP_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS:
|
||||||
if (l!=16){
|
if (l!=16){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -43,6 +43,13 @@ static struct cw_ElemDef join_request_elements[] = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int join_response_states[] = { CAPWAP_STATE_JOIN, 0 };
|
||||||
|
static struct cw_ElemDef join_response_elements[] = {
|
||||||
|
{0, 0, CAPWAP80211_ELEM_WTP_RADIO_INFORMATION, 1, 0},
|
||||||
|
{0, 0, 0, 0, 0}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
static struct cw_MsgDef messages[] = {
|
static struct cw_MsgDef messages[] = {
|
||||||
{
|
{
|
||||||
@ -61,6 +68,14 @@ static struct cw_MsgDef messages[] = {
|
|||||||
join_request_elements
|
join_request_elements
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
|
{
|
||||||
|
"Join Request",
|
||||||
|
CAPWAP_MSG_JOIN_RESPONSE,
|
||||||
|
CW_ROLE_AC,
|
||||||
|
join_response_states,
|
||||||
|
join_response_elements
|
||||||
|
}
|
||||||
|
,
|
||||||
{0, 0, 0, 0, 0}
|
{0, 0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -268,8 +268,16 @@ static struct cw_ElemDef join_request_elements[] ={
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int join_response_states[] = {CAPWAP_STATE_JOIN,0};
|
||||||
|
static struct cw_ElemDef join_response_elements[] ={
|
||||||
|
{0,CW_VENDOR_ID_CISCO, CISCO_ELEM_SPAM_VENDOR_SPECIFIC,1, CW_IGNORE},
|
||||||
|
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_PATH_MTU, 0, 0},
|
||||||
|
|
||||||
|
|
||||||
|
{0,0,0,00}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
static struct cw_MsgDef messages[] = {
|
static struct cw_MsgDef messages[] = {
|
||||||
{
|
{
|
||||||
NULL, /* name */
|
NULL, /* name */
|
||||||
@ -292,6 +300,14 @@ static struct cw_MsgDef messages[] = {
|
|||||||
join_request_states,
|
join_request_states,
|
||||||
join_request_elements
|
join_request_elements
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
NULL, /* name */
|
||||||
|
CAPWAP_MSG_JOIN_RESPONSE, /* type */
|
||||||
|
CW_ROLE_WTP,
|
||||||
|
join_response_states,
|
||||||
|
join_response_elements
|
||||||
|
},
|
||||||
|
|
||||||
{0,0,0,0}
|
{0,0,0,0}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user