can partially read wtp descriptor

FossilOrigin-Name: 87c986decab2956c060dc9212e5bd4d89bed829ec528477817f8ab795c396853
This commit is contained in:
7u83@mail.ru
2018-03-06 02:08:14 +00:00
parent 8817d54d14
commit 14a9c95eb8
30 changed files with 329 additions and 382 deletions

View File

@ -44,23 +44,14 @@
#include "cw/cw_types.h"
static struct cw_ElemHandler handlers[] = {
{
"Discovery Type", /* name */
CAPWAP_ELEM_DISCOVERY_TYPE, /* Element ID */
"WTP Descriptor (Draft 7)", /* name */
CAPWAP_ELEM_WTP_DESCRIPTOR, /* Element ID */
0,0, /* Vendor / Proto */
1,1, /* min/max length */
CW_TYPE_BYTE, /* type */
"discovery_type" /* Key */
}
,
{
"WTP Mac Type", /* name */
CAPWAP_ELEM_WTP_MAC_TYPE, /* Element ID */
0,0, /* Vendor / Proto */
1,1, /* min/max length */
CW_TYPE_BYTE, /* type */
"wtp_mac_type" /* Key */
4,128, /* min/max length */
NULL, /* type */
"wtp_descriptor", /* Key */
cisco_in_wtp_descriptor /* get */
}
,
{0,0,0,0,0,0,0,0}
@ -70,7 +61,7 @@ static struct cw_ElemHandler handlers[] = {
static int discovery_request_states[] = {CAPWAP_STATE_DISCOVERY,0};
static struct cw_ElemDef discovery_request_elements[] ={
{0,0,CAPWAP_ELEM_DISCOVERY_TYPE, 1, 0},
{0,0,CAPWAP_ELEM_WTP_DESCRIPTOR, 1, 0},
{0,0,0,00}
};
@ -136,7 +127,7 @@ static cw_action_in_t actions_in[] = {
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
.vendor_id = CW_VENDOR_ID_CISCO,
.elem_id = CW_CISCO_RAD_NAME,
.start=cw_in_generic2,
.start=cw_in_generic,
.item_id = "wtp_name",
.min_len=1,
.max_len=512,
@ -224,7 +215,7 @@ static cw_action_in_t actions_in[] = {
.msg_id = CAPWAP_MSG_JOIN_REQUEST,
.elem_id = CW_ELEM_ECN_SUPPORT,
.item_id = CW_ITEM_ECN_SUPPORT,
.start = cw_in_generic2,
.start = cw_in_generic,
.mand = 0,
.min_len = 1,
.max_len = 1
@ -245,7 +236,7 @@ static cw_action_in_t actions_in[] = {
.msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST,
.elem_id = CW_ELEM_AC_NAME,
.item_id = CW_ITEM_AC_NAME,
.start = cw_in_generic2,
.start = cw_in_generic,
.min_len = 0,
.max_len = 512,
.mand = 1
@ -273,7 +264,7 @@ static cw_action_in_t actions_in[] = {
.vendor_id = CW_VENDOR_ID_CISCO,
.elem_id = CW_CISCO_AP_LED_STATE_CONFIG,
.item_id = CISCO_ITEM_AP_LED_STATE_CONFIG,
.start = cw_in_generic2
.start = cw_in_generic
}
,
@ -285,7 +276,7 @@ static cw_action_in_t actions_in[] = {
.vendor_id = CW_VENDOR_ID_CISCO,
.elem_id = CW_CISCO_AP_LED_FLASH_CONFIG,
.item_id = CISCO_ITEM_AP_LED_FLASH_CONFIG,
.start = cw_in_generic2
.start = cw_in_generic
}
,
@ -329,7 +320,7 @@ static cw_action_in_t actions_in[] = {
.vendor_id = CW_VENDOR_ID_CISCO,
.elem_id = CW_CISCO_AP_MODE_AND_TYPE,
.item_id = CISCO_ITEM_AP_MODE_AND_TYPE,
.start = cw_in_generic2
.start = cw_in_generic
}
,
@ -341,7 +332,7 @@ static cw_action_in_t actions_in[] = {
.vendor_id = CW_VENDOR_ID_CISCO,
.elem_id = CW_CISCO_AP_LOG_FACILITY,
.item_id = CIPWAP_ITEM_LOG_FACILITY,
.start = cw_in_generic2
.start = cw_in_generic
}
,

View File

@ -70,7 +70,7 @@ static cw_action_in_t actions_in[] = {
.msg_id = CAPWAP_MSG_JOIN_RESPONSE,
.elem_id = CW_ELEM_ECN_SUPPORT,
.item_id = CW_ITEM_ECN_SUPPORT,
.start = cw_in_generic2,
.start = cw_in_generic,
.mand = 0,
.min_len = 1,
.max_len = 1
@ -103,7 +103,7 @@ static cw_action_in_t actions_in[] = {
.msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST,
.elem_id = LW_ELEM_LOCATION_DATA,
.item_id = CW_ITEM_LOCATION_DATA,
.start = cw_in_generic2,
.start = cw_in_generic,
.min_len = 0,
.max_len = 1024,
.mand = 0
@ -117,7 +117,7 @@ static cw_action_in_t actions_in[] = {
.msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST,
.elem_id = CW_CISCO_RAD_NAME,
.item_id = CW_ITEM_WTP_NAME,
.start = cw_in_generic2,
.start = cw_in_generic,
.min_len = 0,
.max_len = 1024,
.mand = 0
@ -132,7 +132,7 @@ static cw_action_in_t actions_in[] = {
.msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST,
.elem_id = CW_CISCO_AP_GROUP_NAME,
.item_id = CIPWAP_ITEM_WTP_GROUP_NAME,
.start = cw_in_generic2,
.start = cw_in_generic,
.min_len = 0,
.max_len = 1024,
.mand = 0
@ -162,7 +162,7 @@ static cw_action_in_t actions_in[] = {
.vendor_id = CW_VENDOR_ID_CISCO,
.elem_id = CW_CISCO_AP_MODE_AND_TYPE,
.item_id = CISCO_ITEM_AP_MODE_AND_TYPE,
.start = cw_in_generic2
.start = cw_in_generic
}
,
@ -250,7 +250,7 @@ static cw_action_in_t actions_in[] = {
.vendor_id = LW_VENDOR_ID_CISCO,
.elem_id = LW_CISCO_MWAR_HASH_VALUE,
.item_id = CIPWAP_ITEM_AC_HASH_VALUE,
.start = cw_in_generic2, //cisco_in_telnet_ssh
.start = cw_in_generic, //cisco_in_telnet_ssh
}
,
@ -473,7 +473,7 @@ static cw_action_in_t actions80211_in[] = {
.vendor_id = LW_VENDOR_ID_CISCO,
.elem_id = LW_CISCO_ADD_WLAN,
// .item_id = CIPWAP_ITEM_AC_HASH_VALUE,
// .start = cw_in_generic2, //cisco_in_telnet_ssh
// .start = cw_in_generic, //cisco_in_telnet_ssh
.start = cisco_in_add_wlan
}

View File

@ -8,7 +8,7 @@
int cisco_in_ac_descriptor(struct conn *conn, struct cw_action_in *a, uint8_t * data,
int len, struct sockaddr *from)
{
static struct cw_descriptor_subelem_def allowed[] = {
static struct cw_DescriptorSubelemDef allowed[] = {
{CW_VENDOR_ID_CISCO,0, CW_ITEM_AC_HARDWARE_VERSION, 1024,1},
{CW_VENDOR_ID_CISCO,1, CW_ITEM_AC_SOFTWARE_VERSION, 1024,1},
{0,0, NULL,0, 0}

View File

@ -22,11 +22,11 @@
#include "cw/capwap_items.h"
int cisco_in_wtp_descriptor(struct conn *conn, struct cw_action_in *a, uint8_t * data,
int cisco_in_wtp_descriptor(struct conn *conn, struct cw_ElemHandler *eh, uint8_t * data,
int len, struct sockaddr *from)
{
static struct cw_descriptor_subelem_def allowed[] = {
static struct cw_DescriptorSubelemDef allowed[] = {
{CW_VENDOR_ID_CISCO,CW_SUBELEM_WTP_HARDWARE_VERSION, CW_ITEM_WTP_HARDWARE_VERSION, 1024,0},
{CW_VENDOR_ID_CISCO,CW_SUBELEM_WTP_SOFTWARE_VERSION, CW_ITEM_WTP_SOFTWARE_VERSION, 1024.0},
{CW_VENDOR_ID_CISCO,CW_SUBELEM_WTP_BOOTLOADER_VERSION, CW_ITEM_WTP_BOOTLOADER_VERSION, 1024.0},
@ -35,7 +35,7 @@ int cisco_in_wtp_descriptor(struct conn *conn, struct cw_action_in *a, uint8_t *
};
return cw_read_wtp_descriptor_7(conn->incomming, conn, a, data, len, allowed);
return cw_read_wtp_descriptor_7(conn->incomming, conn, eh, data, len, allowed);
}

View File

@ -26,14 +26,19 @@ static struct cw_MsgSet * register_messages(struct cw_MsgSet *set, int mode)
switch (mode) {
case CW_MOD_MODE_CAPWAP:
{
cw_dbg(DBG_MOD,"Cisco: loading base med capwap");
struct cw_Mod *cmod = cw_mod_load("capwap");// NULL; //modload_ac("cipwap");
struct cw_Mod *cmod = cw_mod_load("capwap");
if (!cmod) {
cw_log(LOG_ERR,
"Can't initialize mod_cisco, failed to load base module mod_cipwap");
return 1;
}
\
cmod->register_messages(set, CW_MOD_MODE_CAPWAP);
cw_dbg(DBG_MOD,"Cisco: loading cisco message set");
cisco_register_msg_set(set,CW_MOD_MODE_CAPWAP);
cw_dbg(DBG_INFO, "Initialized mod_cisco with %d messafe", 7);
return 0;