2015-04-19 16:46:32 +02:00
|
|
|
/*
|
|
|
|
This file is part of libcipwap.
|
|
|
|
|
|
|
|
libcipwap 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.
|
|
|
|
|
|
|
|
libcipwap 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/>.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include "cipwap.h"
|
|
|
|
#include "action.h"
|
|
|
|
#include "capwap_items.h"
|
|
|
|
#include "capwap_actions.h"
|
|
|
|
#include "capwap_cisco.h"
|
|
|
|
#include "strheap.h"
|
|
|
|
|
2015-04-26 08:41:12 +02:00
|
|
|
#include "cipwap_actions.h"
|
2015-04-19 16:46:32 +02:00
|
|
|
|
|
|
|
cw_action_in_t cipwap_actions_wtp_in[] = {
|
2015-04-26 08:41:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------------
|
|
|
|
* Configuration Update Request IN
|
|
|
|
*/
|
|
|
|
|
2015-04-20 21:28:22 +02:00
|
|
|
{CW_VENDOR_ID_CISCO, 0, CW_STATE_RUN, CW_MSG_CONFIGURATION_UPDATE_REQUEST, CW_CISCO_RAD_NAME,
|
|
|
|
cw_in_generic, 0, MBAG_BSTR16,CW_ITEM_WTP_NAME,0,512}
|
|
|
|
,
|
2015-04-21 08:24:59 +02:00
|
|
|
{CW_VENDOR_ID_CISCO, 0, CW_STATE_RUN, CW_MSG_CONFIGURATION_UPDATE_REQUEST, CW_CISCO_LOCATION_DATA,
|
|
|
|
cw_in_generic, 0, MBAG_BSTR16,CW_ITEM_LOCATION_DATA,0,512}
|
|
|
|
,
|
|
|
|
|
2015-04-26 08:41:12 +02:00
|
|
|
{CW_VENDOR_ID_CISCO, 0, CW_STATE_RUN, CW_MSG_CONFIGURATION_UPDATE_REQUEST, CW_CISCO_AC_NAME_WITH_INDEX,
|
|
|
|
cw_in_ac_name_with_priority, 0, MBAG_BSTR16,CW_ITEM_AC_NAME_WITH_PRIORITY,0,512}
|
|
|
|
,
|
2015-04-21 08:24:59 +02:00
|
|
|
|
2015-05-11 21:58:17 +02:00
|
|
|
/* AP Mode an Type IN */
|
|
|
|
/* {CW_VENDOR_ID_CISCO, 0, CW_STATE_RUN, CW_MSG_CONFIGURATION_UPDATE_REQUEST,
|
2015-04-26 08:41:12 +02:00
|
|
|
CW_ACTION_IN_CISCO_AP_MODE_AND_TYPE,
|
|
|
|
1}
|
|
|
|
,
|
2015-05-11 21:58:17 +02:00
|
|
|
*/
|
2015-04-28 10:23:03 +02:00
|
|
|
/* Radio Administrative State */
|
2015-05-11 21:58:17 +02:00
|
|
|
/* Overload CAPWAP action to handle a radio ID of 255 */
|
2015-04-26 08:41:12 +02:00
|
|
|
{0, 0, CW_STATE_RUN, CW_MSG_CONFIGURATION_UPDATE_REQUEST,
|
2015-04-28 10:23:03 +02:00
|
|
|
CW_ACTION_IN_CISCO_RADIO_ADMINISTRATIVE_STATE_WTP, 0}
|
2015-04-26 08:41:12 +02:00
|
|
|
,
|
|
|
|
|
|
|
|
|
2015-05-11 21:58:17 +02:00
|
|
|
/* Add WLAN */
|
|
|
|
{CW_VENDOR_ID_CISCO, 0, CW_STATE_RUN, CW_MSG_CONFIGURATION_UPDATE_REQUEST,
|
|
|
|
CW_ACTION_IN_CISCO_ADD_WLAN, 0}
|
|
|
|
,
|
|
|
|
|
|
|
|
|
2015-04-26 08:41:12 +02:00
|
|
|
|
|
|
|
{CW_VENDOR_ID_CISCO, 0, CW_STATE_JOIN, CW_MSG_JOIN_REQUEST, CW_CISCO_AP_GROUP_NAME,
|
|
|
|
cw_in_generic, 0, MBAG_BSTR16,CW_ITEM_WTP_GROUP_NAME,1,512}
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------------
|
|
|
|
* Configuration Status Response IN
|
|
|
|
*/
|
|
|
|
{0, 0, CW_STATE_CONFIGURE, CW_MSG_CONFIGURATION_STATUS_RESPONSE,
|
2015-04-28 10:23:03 +02:00
|
|
|
CW_ACTION_IN_RADIO_ADMINISTRATIVE_STATE_WTP, 0}
|
|
|
|
,
|
|
|
|
|
|
|
|
{CW_VENDOR_ID_CISCO, 0, CW_STATE_CONFIGURE, CW_MSG_CONFIGURATION_STATUS_RESPONSE,
|
|
|
|
CW_ACTION_IN_CISCO_RADIO_CFG, 0}
|
2015-04-26 08:41:12 +02:00
|
|
|
,
|
|
|
|
|
2015-04-19 16:46:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
{0, 0, 0}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cw_action_out_t cipwap_actions_wtp_out[] = {
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------------
|
|
|
|
* Discovery Request OUT
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Cisco AP Groupname - Important to get the WTP a DTLS
|
|
|
|
connection established*/
|
|
|
|
{CW_MSG_DISCOVERY_REQUEST, CW_ITEM_WTP_GROUP_NAME, CW_VENDOR_ID_CISCO,
|
2015-04-26 08:41:12 +02:00
|
|
|
CW_CISCO_AP_GROUP_NAME, NULL,cw_out_generic, cw_out_get_config, 0}
|
2015-04-19 16:46:32 +02:00
|
|
|
,
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------------
|
|
|
|
* Join Request OUT
|
|
|
|
*/
|
|
|
|
|
2015-04-26 08:41:12 +02:00
|
|
|
{CW_MSG_JOIN_REQUEST, CW_ITEM_CISCO_BOARD_DATA_OPTIONS, CW_VENDOR_ID_CISCO,
|
|
|
|
CW_CISCO_BOARD_DATA_OPTIONS, NULL,cw_out_generic, cw_out_get_config, 1}
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------------
|
|
|
|
* Configuration Status Request OUT
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2015-04-19 16:46:32 +02:00
|
|
|
/* Cisco AP Groupname - Important to get the WTP a DTLS
|
|
|
|
connection established*/
|
|
|
|
{CW_MSG_CONFIGURATION_STATUS_REQUEST, CW_ITEM_RADIO_CFG, CW_VENDOR_ID_CISCO,
|
2015-04-26 08:41:12 +02:00
|
|
|
CW_CISCO_AP_GROUP_NAME, NULL,cw_out_cisco_wtp_radio_cfg, cw_out_get_config, 1}
|
2015-04-19 16:46:32 +02:00
|
|
|
,
|
|
|
|
|
2015-04-26 08:41:12 +02:00
|
|
|
{CW_MSG_CONFIGURATION_STATUS_REQUEST, CW_ITEM_AP_MODE_AND_TYPE, CW_VENDOR_ID_CISCO,
|
|
|
|
CW_CISCO_AP_MODE_AND_TYPE, NULL,cw_out_generic, cw_out_get_config, 1}
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-19 16:46:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
// {CW_MSG_DISCOVERY_REQUEST, CW_ITEM_NONE}
|
|
|
|
// ,
|
|
|
|
|
|
|
|
/* AC Name */
|
|
|
|
// {CW_MSG_DISCOVERY_REQUEST, CW_ITEM_DISCOVERY_TYPE, 0,
|
|
|
|
// CW_ELEM_DISCOVERY_TYPE, NULL,cw_out_generic, cw_out_get_outgoing}
|
|
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------------
|
|
|
|
* Configuration Status Request OUT
|
|
|
|
*/
|
|
|
|
// {CW_MSG_CONFIGURATION_STATUS_REQUEST, CW_ITEM_NONE}
|
|
|
|
// ,
|
|
|
|
|
|
|
|
|
|
|
|
{0, 0}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int cw_register_actions_cipwap_wtp(struct cw_actiondef *def)
|
|
|
|
{
|
2015-04-29 12:11:37 +02:00
|
|
|
int rc;
|
|
|
|
rc=cw_register_actions_capwap_wtp(def);
|
2015-04-19 16:46:32 +02:00
|
|
|
|
|
|
|
|
2015-04-29 12:11:37 +02:00
|
|
|
rc+=cw_actionlist_in_register_actions(def->in, cipwap_actions_wtp_in);
|
|
|
|
rc+=cw_actionlist_out_register_actions(def->out, cipwap_actions_wtp_out);
|
2015-04-19 16:46:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
rc += cw_strheap_register_strings(def->strelem, cipwap_strings_elem);
|
|
|
|
|
2015-04-29 12:11:37 +02:00
|
|
|
return rc;
|
2015-04-19 16:46:32 +02:00
|
|
|
}
|