2016-03-12 01:54:46 +01:00
|
|
|
/*
|
|
|
|
This file is part of libcapwap.
|
|
|
|
|
|
|
|
libcapwap is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
libcapwap is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Foobar. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-19 20:00:58 +01:00
|
|
|
|
|
|
|
|
2016-03-12 01:54:46 +01:00
|
|
|
#include "cw/strheap.h"
|
|
|
|
#include "cw/radio.h"
|
|
|
|
#include "cw/capwap_cisco.h"
|
|
|
|
#include "cw/capwap80211.h"
|
2018-03-19 20:00:58 +01:00
|
|
|
|
2016-04-02 16:53:04 +02:00
|
|
|
#include "cw/lwapp_cisco.h"
|
2016-03-12 01:54:46 +01:00
|
|
|
|
2018-03-19 20:00:58 +01:00
|
|
|
|
|
|
|
|
2016-04-02 17:07:35 +02:00
|
|
|
|
2018-03-17 12:32:40 +01:00
|
|
|
/*#include "mod_cisco.h"*/
|
2016-03-12 01:54:46 +01:00
|
|
|
|
2016-03-20 15:55:18 +01:00
|
|
|
#include "cisco.h"
|
2016-03-17 20:04:07 +01:00
|
|
|
#include "cisco80211.h"
|
|
|
|
|
2016-03-12 03:57:43 +01:00
|
|
|
|
2016-03-12 01:54:46 +01:00
|
|
|
static cw_action_in_t actions_in[] = {
|
|
|
|
|
2016-03-19 12:57:47 +01:00
|
|
|
/* ----------------------------------------------------------------
|
|
|
|
* Discovery Response
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2016-03-15 00:31:31 +01:00
|
|
|
/* AC Descriptor - Discovery Response */
|
|
|
|
{
|
2018-02-23 20:14:10 +01:00
|
|
|
.capwap_state = CAPWAP_STATE_DISCOVERY,
|
2018-02-23 14:18:22 +01:00
|
|
|
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
2018-02-23 17:57:13 +01:00
|
|
|
.elem_id = CAPWAP_ELEM_AC_DESCRIPTOR,
|
2016-03-15 00:31:31 +01:00
|
|
|
.item_id = CW_ITEM_AC_DESCRIPTOR,
|
|
|
|
.start = cisco_in_ac_descriptor,
|
|
|
|
.min_len = 12,
|
|
|
|
.max_len = 8192,
|
|
|
|
.mand = 1
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
|
|
|
|
2016-03-19 12:57:47 +01:00
|
|
|
/* ----------------------------------------------------------------
|
|
|
|
* Join Response
|
|
|
|
*/
|
|
|
|
|
2016-03-12 01:54:46 +01:00
|
|
|
|
2016-03-15 00:31:31 +01:00
|
|
|
/* ECN Support - Join Response */
|
2016-03-14 08:20:46 +01:00
|
|
|
{
|
2016-03-19 12:57:47 +01:00
|
|
|
/* Make ECN Support non-mand */
|
2018-02-28 07:38:02 +01:00
|
|
|
.capwap_state = CAPWAP_STATE_JOIN,
|
2018-02-23 17:36:11 +01:00
|
|
|
.msg_id = CAPWAP_MSG_JOIN_RESPONSE,
|
2018-03-09 07:44:17 +01:00
|
|
|
.elem_id = CAPWAP_ELEM_ECN_SUPPORT,
|
2016-03-14 08:20:46 +01:00
|
|
|
.item_id = CW_ITEM_ECN_SUPPORT,
|
2018-03-06 03:08:14 +01:00
|
|
|
.start = cw_in_generic,
|
2016-03-14 08:20:46 +01:00
|
|
|
.mand = 0,
|
|
|
|
.min_len = 1,
|
|
|
|
.max_len = 1
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
2016-03-15 00:31:31 +01:00
|
|
|
/* AC Descriptor - Join Response */
|
|
|
|
{
|
2016-03-19 12:57:47 +01:00
|
|
|
/* Cisco's AC Descriptor */
|
2018-02-28 07:38:02 +01:00
|
|
|
.capwap_state = CAPWAP_STATE_JOIN,
|
2018-02-23 17:36:11 +01:00
|
|
|
.msg_id = CAPWAP_MSG_JOIN_RESPONSE,
|
2018-02-23 17:57:13 +01:00
|
|
|
.elem_id = CAPWAP_ELEM_AC_DESCRIPTOR,
|
2016-03-15 00:31:31 +01:00
|
|
|
.item_id = CW_ITEM_AC_DESCRIPTOR,
|
|
|
|
.start = cisco_in_ac_descriptor,
|
|
|
|
.min_len = 12,
|
|
|
|
.max_len = 8192,
|
|
|
|
.mand = 1
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
2016-03-18 09:05:36 +01:00
|
|
|
|
2016-03-19 12:57:47 +01:00
|
|
|
/* ----------------------------------------------------------------
|
|
|
|
* Configuration Update Request
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Location Data - Conf Update Req */
|
|
|
|
{
|
|
|
|
.capwap_state = CW_STATE_RUN,
|
|
|
|
.vendor_id = CW_VENDOR_ID_CISCO,
|
2018-03-05 07:24:48 +01:00
|
|
|
.msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST,
|
2016-03-19 12:57:47 +01:00
|
|
|
.elem_id = LW_ELEM_LOCATION_DATA,
|
|
|
|
.item_id = CW_ITEM_LOCATION_DATA,
|
2018-03-06 03:08:14 +01:00
|
|
|
.start = cw_in_generic,
|
2016-03-19 12:57:47 +01:00
|
|
|
.min_len = 0,
|
|
|
|
.max_len = 1024,
|
|
|
|
.mand = 0
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
|
|
|
/* WTP Name - Conf Update Req */
|
|
|
|
{
|
|
|
|
.capwap_state = CW_STATE_RUN,
|
|
|
|
.vendor_id = CW_VENDOR_ID_CISCO,
|
2018-03-05 07:24:48 +01:00
|
|
|
.msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST,
|
2016-03-19 12:57:47 +01:00
|
|
|
.elem_id = CW_CISCO_RAD_NAME,
|
|
|
|
.item_id = CW_ITEM_WTP_NAME,
|
2018-03-06 03:08:14 +01:00
|
|
|
.start = cw_in_generic,
|
2016-03-19 12:57:47 +01:00
|
|
|
.min_len = 0,
|
|
|
|
.max_len = 1024,
|
|
|
|
.mand = 0
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
2016-04-18 07:40:30 +02:00
|
|
|
|
|
|
|
/* WTP Name - Conf Update Req */
|
|
|
|
{
|
|
|
|
.capwap_state = CW_STATE_RUN,
|
|
|
|
.vendor_id = CW_VENDOR_ID_CISCO,
|
2018-03-05 07:24:48 +01:00
|
|
|
.msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST,
|
2016-04-18 07:40:30 +02:00
|
|
|
.elem_id = CW_CISCO_AP_GROUP_NAME,
|
|
|
|
.item_id = CIPWAP_ITEM_WTP_GROUP_NAME,
|
2018-03-06 03:08:14 +01:00
|
|
|
.start = cw_in_generic,
|
2016-04-18 07:40:30 +02:00
|
|
|
.min_len = 0,
|
|
|
|
.max_len = 1024,
|
|
|
|
.mand = 0
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-11 03:29:06 +02:00
|
|
|
/* Radio Admin State - Config Update Request */
|
2016-03-18 09:05:36 +01:00
|
|
|
{
|
2016-03-19 12:57:47 +01:00
|
|
|
.capwap_state = CW_STATE_RUN,
|
2018-03-05 07:24:48 +01:00
|
|
|
.msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST,
|
2016-03-19 12:57:47 +01:00
|
|
|
.elem_id = CW_ELEM_RADIO_ADMINISTRATIVE_STATE,
|
2016-04-02 09:05:07 +02:00
|
|
|
.item_id = CW_RADIOITEM_ADMIN_STATE,
|
2016-04-18 07:40:30 +02:00
|
|
|
.start = cisco_in_radio_administrative_state,
|
|
|
|
.min_len=2,
|
|
|
|
.max_len=2,
|
2016-04-12 07:46:03 +02:00
|
|
|
.mand = 0
|
2016-03-18 09:05:36 +01:00
|
|
|
}
|
|
|
|
,
|
2016-03-19 12:57:47 +01:00
|
|
|
|
2016-04-11 03:29:06 +02:00
|
|
|
/* AP Mode and Type */
|
|
|
|
{
|
|
|
|
|
|
|
|
.capwap_state = CW_STATE_RUN,
|
2018-03-05 07:24:48 +01:00
|
|
|
.msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST,
|
2016-04-11 03:29:06 +02:00
|
|
|
.vendor_id = CW_VENDOR_ID_CISCO,
|
|
|
|
.elem_id = CW_CISCO_AP_MODE_AND_TYPE,
|
|
|
|
.item_id = CISCO_ITEM_AP_MODE_AND_TYPE,
|
2018-03-06 03:08:14 +01:00
|
|
|
.start = cw_in_generic
|
2016-04-11 03:29:06 +02:00
|
|
|
}
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-09 14:19:23 +02:00
|
|
|
/* Element Cisco 802.11 Radio Config - Config Update Resp */
|
2016-04-04 07:28:50 +02:00
|
|
|
{
|
|
|
|
.capwap_state = CW_STATE_RUN,
|
2018-03-05 07:24:48 +01:00
|
|
|
.msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST,
|
2016-04-04 07:28:50 +02:00
|
|
|
.vendor_id = CW_VENDOR_ID_CISCO,
|
|
|
|
.elem_id = CW_CISCO_WTP_RADIO_CFG,
|
|
|
|
.start=cisco80211_in_wtp_radio_configuration,
|
|
|
|
.item_id = "cisco_radio_cfg",
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
2016-03-19 12:57:47 +01:00
|
|
|
|
2016-03-12 01:54:46 +01:00
|
|
|
|
2016-04-02 16:53:04 +02:00
|
|
|
/* ----------------------------------------------------------------
|
|
|
|
* Configuration Status Response
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2016-04-02 18:44:56 +02:00
|
|
|
/* Element Cisco 802.11 Radio Conffig - Config Status Resp */
|
|
|
|
{
|
|
|
|
.capwap_state = CW_STATE_CONFIGURE,
|
2018-03-05 07:24:48 +01:00
|
|
|
.msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_RESPONSE,
|
2016-04-02 18:44:56 +02:00
|
|
|
.vendor_id = CW_VENDOR_ID_CISCO,
|
|
|
|
.elem_id = CW_CISCO_WTP_RADIO_CFG,
|
|
|
|
.start=cisco80211_in_wtp_radio_configuration,
|
|
|
|
.item_id = "cisco_radio_cfg",
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
|
|
|
|
2016-04-12 07:46:03 +02:00
|
|
|
/* Radio Admin State - Config Status Response */
|
|
|
|
{
|
2016-04-18 07:40:30 +02:00
|
|
|
.capwap_state = CW_STATE_CONFIGURE,
|
2018-03-05 07:24:48 +01:00
|
|
|
.msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_RESPONSE,
|
2016-04-12 07:46:03 +02:00
|
|
|
.elem_id = CW_ELEM_RADIO_ADMINISTRATIVE_STATE,
|
|
|
|
.item_id = CW_RADIOITEM_ADMIN_STATE,
|
2016-04-18 07:40:30 +02:00
|
|
|
// .start = cw_in_radio_generic,
|
|
|
|
.start = cisco_in_radio_administrative_state,
|
2016-04-12 07:46:03 +02:00
|
|
|
.mand = 1
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
2016-04-02 18:44:56 +02:00
|
|
|
|
|
|
|
|
2018-02-19 17:29:35 +01:00
|
|
|
/* Cisco's Vendor specific encapsulation
|
|
|
|
* of LWAPP elements */
|
|
|
|
|
2016-04-02 16:53:04 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
.capwap_state = CW_STATE_CONFIGURE,
|
2018-03-05 07:24:48 +01:00
|
|
|
.msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_RESPONSE,
|
2016-04-02 16:53:04 +02:00
|
|
|
.vendor_id = CW_VENDOR_ID_CISCO,
|
|
|
|
.elem_id = CW_CISCO_SPAM_VENDOR_SPECIFIC,
|
|
|
|
.start = lw_in_vendor_specific,
|
|
|
|
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
2018-02-19 17:29:35 +01:00
|
|
|
{
|
|
|
|
.capwap_state = CW_STATE_RUN,
|
2018-03-05 07:24:48 +01:00
|
|
|
.msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST,
|
2018-02-19 17:29:35 +01:00
|
|
|
.vendor_id = CW_VENDOR_ID_CISCO,
|
|
|
|
.elem_id = CW_CISCO_SPAM_VENDOR_SPECIFIC,
|
|
|
|
.start = lw_in_vendor_specific,
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
2016-04-02 16:53:04 +02:00
|
|
|
|
|
|
|
/* LWAPP Vendor spec Messages */
|
2016-04-09 14:19:23 +02:00
|
|
|
|
|
|
|
/* MWAR Hash Value */
|
2016-04-02 16:53:04 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
.proto = CW_ACTION_PROTO_LWAPP,
|
|
|
|
.capwap_state = CW_STATE_CONFIGURE,
|
2018-03-05 07:24:48 +01:00
|
|
|
.msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_RESPONSE,
|
2016-04-02 16:53:04 +02:00
|
|
|
.vendor_id = LW_VENDOR_ID_CISCO,
|
|
|
|
.elem_id = LW_CISCO_MWAR_HASH_VALUE,
|
2016-04-09 11:03:50 +02:00
|
|
|
.item_id = CIPWAP_ITEM_AC_HASH_VALUE,
|
2018-03-06 03:08:14 +01:00
|
|
|
.start = cw_in_generic, //cisco_in_telnet_ssh
|
2016-04-02 16:53:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
,
|
2016-03-12 01:54:46 +01:00
|
|
|
/* End of list */
|
|
|
|
{0, 0}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static cw_action_out_t actions_out[]={
|
|
|
|
|
2016-03-20 15:55:18 +01:00
|
|
|
/* ----------------------------------------------------------------
|
|
|
|
* Message Discover Request
|
|
|
|
*/
|
|
|
|
|
2016-03-12 01:54:46 +01:00
|
|
|
|
2016-03-13 09:33:40 +01:00
|
|
|
/* WTP Descriptor - Discovery */
|
2016-03-12 03:57:43 +01:00
|
|
|
{
|
2018-02-23 13:59:36 +01:00
|
|
|
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
2018-02-23 20:14:10 +01:00
|
|
|
.elem_id = CAPWAP_ELEM_WTP_DESCRIPTOR,
|
2016-03-12 03:57:43 +01:00
|
|
|
.item_id = CW_ITEM_WTP_DESCRIPTOR,
|
|
|
|
.out = cisco_out_wtp_descriptor,
|
|
|
|
.mand = 1
|
|
|
|
}
|
2016-03-12 01:54:46 +01:00
|
|
|
|
2016-03-12 03:57:43 +01:00
|
|
|
,
|
2016-03-12 01:54:46 +01:00
|
|
|
|
2016-03-13 09:33:40 +01:00
|
|
|
/* Cisco RAD Name (WTP Name) - Discovery */
|
|
|
|
{
|
2018-02-23 13:59:36 +01:00
|
|
|
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
2016-03-13 09:33:40 +01:00
|
|
|
.vendor_id = CW_VENDOR_ID_CISCO,
|
|
|
|
.elem_id = CW_CISCO_RAD_NAME,
|
|
|
|
.item_id = CW_ITEM_WTP_NAME,
|
|
|
|
.out = cw_out_generic,
|
2018-03-17 12:32:40 +01:00
|
|
|
/* .get = cw_out_get_config,*/
|
2016-03-13 09:33:40 +01:00
|
|
|
.mand = 1
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------
|
|
|
|
* Message Join Rquest
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* CAPWAP Local IP Address - Join Request */
|
|
|
|
{
|
|
|
|
/* use draft 7 elem ids */
|
2018-02-23 17:23:53 +01:00
|
|
|
.msg_id = CAPWAP_MSG_JOIN_REQUEST,
|
2016-03-13 09:33:40 +01:00
|
|
|
.item_id = CW_ITEM_CAPWAP_LOCAL_IP_ADDRESS,
|
2016-03-13 18:54:31 +01:00
|
|
|
.out = cw_out_capwap_local_ip_address_7,
|
2016-03-13 09:33:40 +01:00
|
|
|
.mand = 1
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
|
|
|
/* WTP Descriptor - Join Request */
|
|
|
|
{
|
2018-02-23 17:23:53 +01:00
|
|
|
.msg_id = CAPWAP_MSG_JOIN_REQUEST,
|
2018-02-23 20:14:10 +01:00
|
|
|
.elem_id = CAPWAP_ELEM_WTP_DESCRIPTOR,
|
2016-03-13 09:33:40 +01:00
|
|
|
.item_id = CW_ITEM_WTP_DESCRIPTOR,
|
|
|
|
.out = cisco_out_wtp_descriptor,
|
|
|
|
.mand = 1
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
|
|
|
/* WTP Group Name (WTP Name) - Join Request */
|
|
|
|
{
|
2018-02-23 17:23:53 +01:00
|
|
|
.msg_id = CAPWAP_MSG_JOIN_REQUEST,
|
2016-03-13 09:33:40 +01:00
|
|
|
.vendor_id = CW_VENDOR_ID_CISCO,
|
|
|
|
.elem_id = CW_CISCO_AP_GROUP_NAME,
|
2016-04-18 07:40:30 +02:00
|
|
|
.item_id = CIPWAP_ITEM_WTP_GROUP_NAME,
|
2016-03-13 09:33:40 +01:00
|
|
|
.out = cw_out_generic,
|
2018-03-17 12:32:40 +01:00
|
|
|
/*.get = cw_out_get_config,*/
|
2016-03-13 09:33:40 +01:00
|
|
|
.mand = 1
|
|
|
|
}
|
|
|
|
,
|
2016-03-12 01:54:46 +01:00
|
|
|
|
2016-03-20 15:55:18 +01:00
|
|
|
/* WTP Board Data Options - Join Request */
|
|
|
|
{
|
2018-02-23 17:23:53 +01:00
|
|
|
.msg_id = CAPWAP_MSG_JOIN_REQUEST,
|
2016-03-20 15:55:18 +01:00
|
|
|
.vendor_id = CW_VENDOR_ID_CISCO,
|
|
|
|
.elem_id = CW_CISCO_BOARD_DATA_OPTIONS,
|
|
|
|
.item_id = CW_ITEM_CISCO_BOARD_DATA_OPTIONS,
|
|
|
|
.out = cisco_out_board_data_options,
|
2018-03-17 12:32:40 +01:00
|
|
|
/* .get = cw_out_get_config,*/
|
2016-03-20 15:55:18 +01:00
|
|
|
.mand = 1
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-13 18:54:31 +01:00
|
|
|
/* ECN Support - Join Request */
|
|
|
|
{
|
|
|
|
/* Cisco doesn't know ECN support, so we
|
2016-03-17 20:04:07 +01:00
|
|
|
define no output method */
|
2018-02-23 17:23:53 +01:00
|
|
|
.msg_id = CAPWAP_MSG_JOIN_REQUEST,
|
2018-03-09 07:44:17 +01:00
|
|
|
.elem_id = CAPWAP_ELEM_ECN_SUPPORT,
|
2016-03-13 18:54:31 +01:00
|
|
|
.item_id = CW_ITEM_ECN_SUPPORT,
|
|
|
|
.mand = 0
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
|
|
|
|
2016-04-11 03:29:06 +02:00
|
|
|
/* AP Mode and Type - Configuration Status Request OUT */
|
|
|
|
{
|
2018-02-23 17:36:11 +01:00
|
|
|
.msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST,
|
2016-04-11 03:29:06 +02:00
|
|
|
.vendor_id = CW_VENDOR_ID_CISCO,
|
|
|
|
.elem_id = CW_CISCO_AP_MODE_AND_TYPE,
|
|
|
|
.item_id = CISCO_ITEM_AP_MODE_AND_TYPE,
|
|
|
|
.out = cw_out_generic,
|
2018-03-17 12:32:40 +01:00
|
|
|
/* .get = cw_out_get_config,*/
|
2016-04-11 03:29:06 +02:00
|
|
|
.mand = 1
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
|
|
|
|
2016-04-18 07:40:30 +02:00
|
|
|
/* Cisco WTP Admin state - OUT */
|
|
|
|
{
|
2018-02-23 17:36:11 +01:00
|
|
|
.msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST,
|
2016-04-18 07:40:30 +02:00
|
|
|
.vendor_id = CW_VENDOR_ID_CISCO,
|
|
|
|
.item_id = CISCO_ITEM_WTP_ADMIN_STATE,
|
|
|
|
.out = cisco_out_wtp_administrative_state,
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
/* Cisco Admin state - OUT */
|
|
|
|
/* {
|
|
|
|
.msg_id = CW_MSG_CONFIGURATION_STATUS_REQUEST,
|
|
|
|
.vendor_id = CW_VENDOR_ID_CISCO,
|
|
|
|
// .elem_id = CW_CISCO_AP_MODE_AND_TYPE,
|
|
|
|
.item_id = CISCO_ITEM_WTP_ADMIN_STATE,
|
|
|
|
.out = cisco_out_wtp_administrative_state,
|
|
|
|
// .get = cw_out_get_outgoming,
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Cisco WTP Operational state - OUT */
|
|
|
|
{
|
2018-03-05 10:06:18 +01:00
|
|
|
.msg_id = CAPWAP_MSG_CHANGE_STATE_EVENT_REQUEST,
|
2016-04-18 07:40:30 +02:00
|
|
|
.vendor_id = CW_VENDOR_ID_CISCO,
|
|
|
|
// .elem_id = CW_CISCO_AP_MODE_AND_TYPE,
|
|
|
|
.item_id = CISCO_ITEM_WTP_OPER_STATE,
|
2016-11-07 07:28:36 +01:00
|
|
|
// .out = cisco_out_wtp_operational_state,
|
2016-04-18 07:40:30 +02:00
|
|
|
// .get = cw_out_get_outgoming,
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Radio Operational State - OUT */
|
|
|
|
{
|
2018-03-05 10:06:18 +01:00
|
|
|
.msg_id = CAPWAP_MSG_CHANGE_STATE_EVENT_REQUEST,
|
2016-04-18 07:40:30 +02:00
|
|
|
.elem_id = CW_ELEM_RADIO_OPERATIONAL_STATE,
|
|
|
|
.item_id = CW_RADIOITEM_OPER_STATE,
|
|
|
|
.out = cisco_out_radio_operational_state,
|
|
|
|
.mand = 1
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
2016-04-11 03:29:06 +02:00
|
|
|
|
2016-04-09 14:19:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
{0,0}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
static cw_action_in_t actions80211_in[] = {
|
|
|
|
|
|
|
|
|
2016-04-18 07:40:30 +02:00
|
|
|
/* Radio Operational State - Status Resp */
|
2016-04-09 14:19:23 +02:00
|
|
|
{
|
|
|
|
.capwap_state = CW_STATE_CONFIGURE,
|
2018-03-05 07:24:48 +01:00
|
|
|
.msg_id= CAPWAP_MSG_CONFIGURATION_STATUS_RESPONSE,
|
2016-04-09 14:19:23 +02:00
|
|
|
.elem_id = CW_ELEM_RADIO_OPERATIONAL_STATE,
|
|
|
|
.item_id = CW_RADIOITEM_OPER_STATE,
|
2016-04-18 07:40:30 +02:00
|
|
|
// .start = cw_in_radio_generic, //operational_state,
|
|
|
|
.start = cisco_in_radio_operational_state, //operational_state,
|
|
|
|
.min_len=3,
|
|
|
|
.max_len=3,
|
|
|
|
.mand = 0
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
|
|
|
/* Radio Operational State - Update Req */
|
|
|
|
{
|
|
|
|
.capwap_state = CW_STATE_RUN,
|
2018-03-05 07:24:48 +01:00
|
|
|
.msg_id= CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST,
|
2016-04-18 07:40:30 +02:00
|
|
|
.elem_id = CW_ELEM_RADIO_OPERATIONAL_STATE,
|
|
|
|
.item_id = CW_RADIOITEM_OPER_STATE,
|
|
|
|
// .start = cw_in_radio_generic, //operational_state,
|
|
|
|
.start = cisco_in_radio_operational_state, //operational_state,
|
2016-04-09 14:19:23 +02:00
|
|
|
.min_len=3,
|
|
|
|
.max_len=3,
|
|
|
|
.mand = 0
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
|
|
|
|
2018-02-19 17:29:35 +01:00
|
|
|
/* Add WLAN */
|
|
|
|
{
|
|
|
|
|
|
|
|
.capwap_state = CW_STATE_RUN,
|
2018-03-05 07:24:48 +01:00
|
|
|
.msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST,
|
2018-02-19 17:29:35 +01:00
|
|
|
.vendor_id = CW_VENDOR_ID_CISCO,
|
|
|
|
.elem_id = CW_CISCO_ADD_WLAN,
|
|
|
|
// .item_id = CISCO_ITEM_ADD_WLAN,
|
|
|
|
.start = cisco_in_add_wlan
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
/* Add WLAN - LWAP Vendor Specific */
|
|
|
|
{
|
|
|
|
.proto = CW_ACTION_PROTO_LWAPP,
|
|
|
|
.capwap_state = CW_STATE_RUN,
|
2018-03-05 07:24:48 +01:00
|
|
|
.msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST,
|
2018-02-19 17:29:35 +01:00
|
|
|
.vendor_id = LW_VENDOR_ID_CISCO,
|
|
|
|
.elem_id = LW_CISCO_ADD_WLAN,
|
|
|
|
// .item_id = CIPWAP_ITEM_AC_HASH_VALUE,
|
2018-03-06 03:08:14 +01:00
|
|
|
// .start = cw_in_generic, //cisco_in_telnet_ssh
|
2018-02-19 17:29:35 +01:00
|
|
|
.start = cisco_in_add_wlan
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-18 07:40:30 +02:00
|
|
|
|
2016-04-09 14:19:23 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
static cw_action_out_t actions80211_out[]={
|
|
|
|
|
2016-03-17 20:04:07 +01:00
|
|
|
/* ----------------------------------------------------------------
|
|
|
|
* Configuration Status Request
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
.vendor_id = CW_VENDOR_ID_CISCO,
|
2018-02-23 17:36:11 +01:00
|
|
|
.msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST,
|
2016-03-18 09:05:36 +01:00
|
|
|
.elem_id = CW_ELEM80211_WTP_RADIO_INFORMATION,
|
2016-04-02 09:05:07 +02:00
|
|
|
.item_id = CW_RADIOITEM80211_WTP_RADIO_INFORMATION,
|
2016-03-17 20:04:07 +01:00
|
|
|
.out = cisco_out_80211_wtp_radio_cfg,
|
2018-03-17 12:32:40 +01:00
|
|
|
/*.get = cw_out_get_config,*/
|
2016-03-17 20:04:07 +01:00
|
|
|
.mand = 1
|
|
|
|
}
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-28 10:50:23 +02:00
|
|
|
{
|
2018-02-23 17:36:11 +01:00
|
|
|
.msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST,
|
2016-03-28 10:50:23 +02:00
|
|
|
.item_id = CW_RADIO_SUPPORTED_RATES ,
|
|
|
|
.elem_id = CW_ELEM80211_SUPPORTED_RATES,
|
|
|
|
.mand = 0,
|
|
|
|
}
|
2016-03-13 18:54:31 +01:00
|
|
|
|
2016-03-18 09:05:36 +01:00
|
|
|
|
2016-03-12 01:54:46 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-03-28 10:50:23 +02:00
|
|
|
|
|
|
|
|
2016-03-12 01:54:46 +01:00
|
|
|
#include "cw/item.h"
|
|
|
|
|
|
|
|
static struct cw_itemdef _capwap_itemdefs[] = {
|
|
|
|
|
|
|
|
{"wtp_name_cisco",CW_ITEM_NONE,MBAG_STR},
|
|
|
|
|
|
|
|
/* {"wtp_mac_type",CW_ITEM_NONE,MBAG_BYTE},
|
|
|
|
{"discovery_type",CW_ITEM_NONE,MBAG_BYTE},
|
|
|
|
{"wtp_frame_tunnel_mode",CW_ITEM_NONE,MBAG_BYTE},
|
|
|
|
*/ {CW_ITEM_NONE}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#include "../modload.h"
|
|
|
|
|
|
|
|
int cisco_register_actions_wtp(struct cw_actiondef *def)
|
|
|
|
{
|
|
|
|
|
|
|
|
int rc;
|
|
|
|
rc = cw_actionlist_in_register_actions(def->in, actions_in);
|
|
|
|
rc += cw_actionlist_out_register_actions(def->out, actions_out);
|
|
|
|
|
|
|
|
rc += cw_strheap_register_strings(def->strmsg, capwap_strings_msg);
|
|
|
|
rc += cw_strheap_register_strings(def->strelem, cipwap_strings_elem);
|
|
|
|
|
|
|
|
rc += cw_itemdefheap_register(def->items, _capwap_itemdefs);
|
|
|
|
rc += cw_itemdefheap_register(def->radioitems, capwap_radioitemdefs);
|
|
|
|
|
|
|
|
// intavltree_add(def->wbids, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int cisco_register_actions80211_wtp(struct cw_actiondef *def)
|
|
|
|
{
|
|
|
|
|
|
|
|
int rc;
|
|
|
|
rc=0;
|
2016-04-09 14:19:23 +02:00
|
|
|
rc = cw_actionlist_in_register_actions(def->in, actions80211_in);
|
2016-03-28 10:50:23 +02:00
|
|
|
rc += cw_actionlist_out_register_actions(def->out, actions80211_out);
|
2016-04-11 03:29:06 +02:00
|
|
|
rc += cw_itemdefheap_register(def->items, cisco_itemdefs);
|
|
|
|
rc += cw_itemdefheap_register(def->radioitems, cisco_radioitemdefs);
|
2016-03-12 01:54:46 +01:00
|
|
|
|
2016-03-28 10:50:23 +02:00
|
|
|
/* rc += cw_strheap_register_strings(def->strmsg, capwap_strings_msg);
|
2016-03-12 01:54:46 +01:00
|
|
|
rc += cw_strheap_register_strings(def->strelem, cipwap_strings_elem);
|
|
|
|
|
|
|
|
rc += cw_itemdefheap_register(def->items, _capwap_itemdefs);
|
|
|
|
rc += cw_itemdefheap_register(def->radioitems, capwap_radioitemdefs);
|
|
|
|
|
|
|
|
intavltree_add(def->wbids, 0);
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
|