Working on differences from 7.3 to 7.5 version

FossilOrigin-Name: 02bf967f2dfcb1349d8c843daab6b16ac998a5b857ffb4ee71d7e84f44313ef8
This commit is contained in:
7u83@mail.ru
2018-04-23 05:51:56 +00:00
parent 34e2d016fe
commit 0607147daa
11 changed files with 193 additions and 45 deletions

View File

@ -535,6 +535,7 @@ static struct cw_ElemDef echo_request_elements[] ={
static int echo_response_states[] = {CAPWAP_STATE_RUN,0};
static struct cw_ElemDef echo_response_elements[] ={
{0,0,CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD, 0, CW_IGNORE},
{0,0,0,0,0}
};

View File

@ -36,7 +36,7 @@
#define CW_CISCO_RAD_SLOT 4
#define CISCO_ELEM_RAD_NAME LWAPP_ELEM_WTP_NAME /* 5 */
#define CW_CISCO_MWAR LW_ELEM_AC_DESCRIPTOR /* 6 */
#define CW_CISCO_ADD_WLAN LW_ELEM_80211_ADD_WLAN /* 7 */
#define CISCO_ELEM_ADD_WLAN LW_ELEM_80211_ADD_WLAN /* 7 */
#define CISCO_ELEM_WTP_RADIO_CONFIGURATION 8
#define CISCO_ELEM_MULTI_DOMAIN_CAPABILITY LW_ELEM_80211_MULTI_DOMAIN_CAPABILITY /* 10 */

View File

@ -237,6 +237,24 @@ int cisco_out_ap_regulatory_domain(struct cw_ElemHandler * eh,
idx = 0;
ob = dst;
type = NULL;
result = cw_ktv_get(params->conn->local_cfg,"ac-descriptor/software/version",CW_TYPE_BSTR16);
if (result!=NULL){
if(result->type->len(result)==4){
uint32_t rv;
rv = cw_get_dword(result->type->data(result));
if (rv >= 0x07056600){
type = cisco_ap_regulatory_domain5;
}
else{
type = cisco_ap_regulatory_domain4;
}
}
}
do {
sprintf(key,"%s.%d",eh->key,idx);
@ -247,13 +265,15 @@ int cisco_out_ap_regulatory_domain(struct cw_ElemHandler * eh,
if (strncmp(result->key,key,strlen(key))!=0)
break;
sprintf(testkey,"%s/%s",key,"band-id");
result = cw_ktv_get(params->conn->local_cfg,key,CW_TYPE_BYTE);
if (result==NULL){
type = cisco_ap_regulatory_domain4;
}
else{
type = cisco_ap_regulatory_domain5;
if(type == NULL){
sprintf(testkey,"%s/%s",key,"band-id");
result = cw_ktv_get(params->conn->local_cfg,key,CW_TYPE_BYTE);
if (result==NULL){
type = cisco_ap_regulatory_domain4;
}
else{
type = cisco_ap_regulatory_domain5;
}
}
start = params->conn->header_len(eh);
@ -266,12 +286,6 @@ int cisco_out_ap_regulatory_domain(struct cw_ElemHandler * eh,
sprintf(key,"%s.%d",eh->key,idx+1);
/* if(len==4)
type = cisco_ap_regulatory_domain4;
if(len==5)
type = cisco_ap_regulatory_domain5;
cw_ktv_read_struct(params->conn->remote_cfg,type,key,data,len);
*/
return ob-dst;
}
@ -387,7 +401,40 @@ static cw_KTVStruct_t cisco_ap_mode_and_type[]={
{NULL,NULL,0,0}
};
static cw_KTVStruct_t cisco_add_wlan[]={
{CW_TYPE_BYTE,"radio-id",1,-1},
{CW_TYPE_WORD,"wlan-capability",2,-1},
{CW_TYPE_BYTE,"wlan-id",1,-1},
{CW_TYPE_DWORD,"encryption-policy",4,-1},
{CW_TYPE_BSTR16,"wep-key",13,9},
{CW_TYPE_BYTE,"encryption",1,42},
{CW_TYPE_BOOL,"broadcast-ssid",1,426},
{CW_TYPE_WORD,"session-timout",2,475},
{CW_TYPE_BYTE, "dtim-period",1,541},
{CW_TYPE_STR, "ssid-a",30,545},
{CW_TYPE_BYTE, "allow-aaa-override",1,578},
{CW_TYPE_BYTE, "max-stations",1,580},
{NULL,NULL,0,0}
};
static int cisoc_add_wlan_mkkey(const char *pkey, uint8_t*data, int len, char *dst)
{
int wlan_id,radio_id;
radio_id = cw_get_byte(data);
wlan_id = cw_get_byte(data+3);
sprintf(dst,"radio.%d/wlan.%d",radio_id,wlan_id);
return 1;
}
static cw_KTVStruct_t cisco_ssc_hash[]={
{CW_TYPE_BOOL,"validate",1,-1},
{CW_TYPE_BSTR16,"hash",-1,-1},
{NULL,NULL,0,0}
};
static struct cw_ElemHandler handlers[] = {
@ -974,6 +1021,42 @@ static struct cw_ElemHandler handlers[] = {
}
,
{
"Add Cisco WLAN", /* name */
CISCO_ELEM_ADD_WLAN, /* Element ID */
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
7,1117, /* min/max length */
cisco_add_wlan, /* type */
"radio/wlan", /* Key */
cw_in_generic_struct, /* get */
cw_out_generic_struct, /* put */
cisoc_add_wlan_mkkey
}
,
{
"SSC Hash Validation", /* name */
CISCO_LWELEM_SSC_HASH_VALIDATION, /* Element ID */
CW_VENDOR_ID_CISCO,CW_PROTO_LWAPP, /* Vendor / Proto */
1,1, /* min/max length */
CW_TYPE_BOOL, /* type */
"cisco/ssh-hash-validation", /* Key */
cw_in_generic, /* get */
cw_out_generic /* put */
}
,
{
"SSC Hash", /* name */
CISCO_LWELEM_SSC_HASH, /* Element ID */
CW_VENDOR_ID_CISCO,CW_PROTO_LWAPP, /* Vendor / Proto */
1,331, /* min/max length */
cisco_ssc_hash, /* type */
"cisco/hash", /* Key */
cw_in_generic_struct, /* get */
cw_out_generic_struct /* put */
}
,
{0,0,0,0,0,0,0,0}
@ -1125,6 +1208,8 @@ static struct cw_ElemDef configuration_update_request_elements[] ={
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_AC_NAME_WITH_INDEX, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_AP_VENUE_SETTINGS, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_ADD_WLAN, 0, CW_IGNORE},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_AP_USERNAME_PASSWORD, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_AP_LOGHOST_CONFIG, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_AP_TELNET_SSH, 0, 0},
@ -1133,6 +1218,9 @@ static struct cw_ElemDef configuration_update_request_elements[] ={
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_AC_IP_ADDR_WITH_INDEX, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_AP_FAILOVER_PRIORITY, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_VLAN, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_SSC_HASH_VALIDATION, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_SSC_HASH, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_TCP_ADJUST_MSS, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_ROUGE_DETECTION, 0, 0},
@ -1155,6 +1243,13 @@ static struct cw_ElemDef wtp_event_response_elements[] ={
{0,0,0,0,0}
};
static int wtp_echo_response_states[] = {CAPWAP_STATE_RUN,0};
static struct cw_ElemDef wtp_echo_response_elements[] ={
{0,CW_VENDOR_ID_CISCO, CISCO_ELEM_AP_TIMESYNC, 1, 0},
{0,0,0,0,0}
};
static struct cw_MsgDef messages[] = {
{
NULL, /* name */
@ -1234,6 +1329,14 @@ static struct cw_MsgDef messages[] = {
},
{
NULL, /* name */
CAPWAP_MSG_ECHO_RESPONSE, /* msg type */
CW_ROLE_WTP, /* role */
wtp_echo_response_states, /* allowed states */
wtp_echo_response_elements /* msg elements */
},
{0,0,0,0}
};

View File

@ -55,8 +55,9 @@
#define LW_CISCO_ADD_WLAN 128
#define CISCO_LWELEM_VLAN 123
#define LW_CISCO_SSC_HASH_VALIDATION 133
#define LW_CISCO_MWAR_HASH_VALUE_1 132
#define CISCO_LWELEM_SSC_HASH_VALIDATION 133
#define CISCO_LWELEM_SSC_HASH 132
#define CISCO_LWELEM_MWAR_HASH_VALUE 134
#define LW_CISCO_DOT11R_WLC_MAC_AND_IP 135