2014-07-11 22:12:11 +02: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/>.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2015-03-23 22:26:05 +01:00
|
|
|
/**
|
|
|
|
* @file
|
2018-02-23 01:41:07 +01:00
|
|
|
* @brief CAPWAP definitions as in RFC 5415
|
2015-03-23 22:26:05 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2014-07-11 22:12:11 +02:00
|
|
|
#ifndef __CAPWAP_H
|
|
|
|
#define __CAPWAP_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2018-03-03 08:15:19 +01:00
|
|
|
|
2018-03-03 17:42:28 +01:00
|
|
|
#include "mbag.h"
|
2015-04-14 07:42:23 +02:00
|
|
|
#include <errno.h>
|
2014-07-11 22:12:11 +02:00
|
|
|
#include <arpa/inet.h>
|
|
|
|
|
|
|
|
#include "conn.h"
|
|
|
|
|
2015-04-11 19:00:51 +02:00
|
|
|
#include "strlist.h"
|
2015-03-23 07:47:27 +01:00
|
|
|
|
2018-02-23 14:30:57 +01:00
|
|
|
|
2014-07-11 22:12:11 +02:00
|
|
|
/* capwap version and iana number */
|
2015-04-14 07:42:23 +02:00
|
|
|
|
|
|
|
/**
|
2018-02-23 10:44:20 +01:00
|
|
|
*@defgroup CAPWAP CAPWAP Defintions from RFC5415
|
|
|
|
*@{
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
*@defgroup CAPWAPConstants CAPWAP General Constants
|
2018-02-23 14:18:22 +01:00
|
|
|
*@brief General constants as defined in RFC5415
|
2015-04-14 07:42:23 +02:00
|
|
|
*@{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** CAPWAP Version */
|
2018-02-23 09:12:39 +01:00
|
|
|
#define CAPWAP_VERSION (0)
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2018-02-23 09:17:26 +01:00
|
|
|
#define CAPWAP_IANA_ENTERPRISE_NUMBER 0
|
2018-02-23 14:30:57 +01:00
|
|
|
|
2018-02-23 17:36:11 +01:00
|
|
|
/** CAPWAP Control Port. This port is defined by RFC5415
|
|
|
|
* for the AC to listen on for CAPWAP control messages. */
|
2018-02-23 09:17:26 +01:00
|
|
|
#define CAPWAP_CONTROL_PORT 5246
|
2018-02-23 17:36:11 +01:00
|
|
|
|
|
|
|
/** CAPWAP Control Port as String.
|
|
|
|
* @see CAPWAP_CONTROL_PORT */
|
2018-02-23 09:17:26 +01:00
|
|
|
#define CAPWAP_CONTROL_PORT_STR "5246"
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2016-02-17 13:40:23 +01:00
|
|
|
/** CAPWAP Data Port */
|
|
|
|
#define CAPWAP_DATA_PPORT 5247
|
|
|
|
|
|
|
|
/** CAWPAP DataPort as String */
|
2018-02-23 09:18:08 +01:00
|
|
|
#define CAPWAP_DATA_PORT_STR "5247"
|
2016-02-17 13:40:23 +01:00
|
|
|
|
2015-04-14 07:42:23 +02:00
|
|
|
/**@}*/
|
2015-03-30 07:56:42 +02:00
|
|
|
|
|
|
|
|
2014-07-29 19:29:40 +02:00
|
|
|
|
2015-04-05 20:27:17 +02:00
|
|
|
/**
|
2018-02-23 10:44:20 +01:00
|
|
|
*@defgroup CAPWAPHeaderFlags CAPWAP Header Flags
|
2018-02-23 14:18:22 +01:00
|
|
|
*@brief The CAPWAP control header flags
|
|
|
|
*
|
2018-02-23 10:44:20 +01:00
|
|
|
*@{
|
2015-04-11 19:00:51 +02:00
|
|
|
*/
|
2018-02-23 09:30:10 +01:00
|
|
|
#define CAPWAP_FLAG_HDR_R1 0x01 /**< bit 0 reserved 1 */
|
|
|
|
#define CAPWAP_FLAG_HDR_R2 0x02 /**< bit 1 reserved 2 */
|
|
|
|
#define CAPWAP_FLAG_HDR_R3 0x04 /**< bit 2 reserved 3 */
|
|
|
|
#define CAPWAP_FLAG_HDR_K 0x08 /**< bit 3 Keep alive flag */
|
|
|
|
#define CAPWAP_FLAG_HDR_M 0x10 /**< bit 4 MAC Adress field present */
|
|
|
|
#define CAPWAP_FLAG_HDR_W 0x20 /**< bit 5 wireless info present */
|
|
|
|
#define CAPWAP_FLAG_HDR_L 0x40 /**< bit 6 last fragment */
|
|
|
|
#define CAPWAP_FLAG_HDR_F 0x80 /**< bit 7 fragment */
|
|
|
|
#define CAPWAP_FLAG_HDR_T 0x100 /**< bit 8 type of payload frame */
|
2018-02-23 10:44:20 +01:00
|
|
|
/**@}*/
|
2015-04-05 02:07:59 +02:00
|
|
|
|
|
|
|
|
2018-02-23 01:41:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2018-02-23 10:44:20 +01:00
|
|
|
* @defgroup CAPWAPWBIDS CAPWAP Wireless binding IDs
|
2018-02-23 01:41:07 +01:00
|
|
|
* @{
|
|
|
|
*/
|
2018-02-23 13:59:36 +01:00
|
|
|
#define CAPWAP_WBID_RESERVED1 0
|
|
|
|
#define CAPWAP_WBID_IEEE80211 1
|
|
|
|
#define CAPWAP_WBID_RESERVED2 2
|
|
|
|
#define CAPWAP_WBID_EPCGLOBAL 3
|
2018-02-23 01:41:07 +01:00
|
|
|
/**@}*/
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2018-02-23 09:12:39 +01:00
|
|
|
#define CAPWAP_PACKET_PREAMBLE (CAPWAP_VERSION<<4)
|
|
|
|
#define CAPWAP_DTLS_PACKET_PREAMBLE (CAPWAP_VERSION<<4|1)
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2014-07-27 10:30:22 +02:00
|
|
|
|
2018-02-23 10:44:20 +01:00
|
|
|
|
2015-04-14 07:42:23 +02:00
|
|
|
|
2018-02-23 13:59:36 +01:00
|
|
|
/**
|
|
|
|
* @defgroup CAPWAPMessages CAPWAP message types as defined in RFC 5416
|
|
|
|
* @{
|
|
|
|
*/
|
2018-02-23 14:18:22 +01:00
|
|
|
/**
|
|
|
|
* The Discovery Request message is sent by the WTP to
|
|
|
|
* find an AC on the network and inform the AC about some
|
|
|
|
* basic capabillities of the WTP. */
|
2018-02-23 13:59:36 +01:00
|
|
|
#define CAPWAP_MSG_DISCOVERY_REQUEST 1
|
2018-02-23 17:36:11 +01:00
|
|
|
|
2018-02-23 14:18:22 +01:00
|
|
|
/**
|
|
|
|
* A Discovery Response message is send by the AP to
|
|
|
|
* the WTP after receiving a Discovery Request message. */
|
|
|
|
#define CAPWAP_MSG_DISCOVERY_RESPONSE 2
|
2018-02-23 17:36:11 +01:00
|
|
|
|
2018-02-23 17:23:53 +01:00
|
|
|
/**
|
|
|
|
* The CAPWAP Join Request message type. A Join Request is
|
|
|
|
* snet by the WTP to join an AC */
|
|
|
|
#define CAPWAP_MSG_JOIN_REQUEST 3
|
|
|
|
|
2018-02-23 17:36:11 +01:00
|
|
|
/**
|
|
|
|
* Join Response, sent by the AC to the WTP in response to
|
|
|
|
* Join Request message */
|
|
|
|
#define CAPWAP_MSG_JOIN_RESPONSE 4
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The Config Status Request message is sent by the WTP
|
|
|
|
* to report ist status to the AC*/
|
|
|
|
#define CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST 5
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2018-03-05 07:24:48 +01:00
|
|
|
#define CAPWAP_MSG_CONFIGURATION_STATUS_RESPONSE 6
|
2014-08-14 20:51:35 +02:00
|
|
|
|
2018-03-05 07:24:48 +01:00
|
|
|
#define CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST 7
|
|
|
|
|
|
|
|
#define CAPWAP_MSG_CONFIGURATION_UPDATE_RESPONSE 8
|
2014-08-23 12:01:10 +02:00
|
|
|
|
2018-03-05 09:56:39 +01:00
|
|
|
#define CAPWAP_MSG_WTP_EVENT_REQUEST 9
|
2018-03-05 10:06:18 +01:00
|
|
|
#define CAPWAP_MSG_WTP_EVENT_RESPONSE 10
|
2014-08-18 00:24:50 +02:00
|
|
|
|
2018-03-05 10:06:18 +01:00
|
|
|
#define CAPWAP_MSG_CHANGE_STATE_EVENT_REQUEST 11
|
|
|
|
#define CAPWAP_MSG_CHANGE_STATE_EVENT_RESPONSE 12
|
2014-08-18 00:24:50 +02:00
|
|
|
|
2018-03-05 09:56:39 +01:00
|
|
|
#define CAPWAP_MSG_ECHO_REQUEST 13
|
2018-03-05 10:06:18 +01:00
|
|
|
#define CAPWAP_MSG_ECHO_RESPONSE 14
|
2014-07-24 23:54:16 +02:00
|
|
|
|
2018-03-05 10:06:18 +01:00
|
|
|
#define CAPWAP_MSG_IMAGE_DATA_REQUEST 15
|
|
|
|
#define CAPWAP_MSG_IMAGE_DATA_RESPONSE 16
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2018-03-05 10:19:54 +01:00
|
|
|
/**
|
|
|
|
* A Reset Request message ist sent by the AC to the WTP
|
|
|
|
* to initiate a WTP reset.*/
|
2018-03-05 10:06:18 +01:00
|
|
|
#define CAPWAP_MSG_RESET_REQUEST 17
|
|
|
|
#define CAPWAP_MSG_RESET_RESPONSE 18
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2015-04-05 02:07:59 +02:00
|
|
|
#define CW_MSG_PRIMARY_DISCOVERY_REQUEST 19
|
|
|
|
#define CW_MSG_PRIMARY_DISCOVERY_RESPONSE 20
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2015-04-05 02:07:59 +02:00
|
|
|
#define CW_MSG_DATA_TRANSFER_REQUEST 21
|
|
|
|
#define CW_MSG_DATA_TRANSFER_RESPONSE 22
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2015-04-05 02:07:59 +02:00
|
|
|
#define CW_MSG_CLEAR_CONFIGURATION_REQUEST 23
|
|
|
|
#define CW_MSG_CLEAR_CONFIGURATION_RESPONSE 24
|
|
|
|
|
|
|
|
#define CW_STATION_CONFIGURATION_REQUEST 25
|
|
|
|
#define CW_STATION_CONFIGURATION_RESPONSE 26
|
|
|
|
|
|
|
|
#define CW_MSG_MAXMSG 26
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2018-02-23 13:59:36 +01:00
|
|
|
/**@}*/
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2015-03-12 23:21:57 +01:00
|
|
|
|
2018-02-23 10:44:20 +01:00
|
|
|
/**
|
|
|
|
* @defgroup CAPWAPMsgElems CAPWAP Message Elements
|
|
|
|
* @brief CAPWAP message elements as defined in RFC 5415
|
|
|
|
* @{
|
2018-03-03 08:15:19 +01:00
|
|
|
*/
|
2018-02-23 10:44:20 +01:00
|
|
|
|
2018-02-23 17:57:13 +01:00
|
|
|
|
|
|
|
#define CAPWAP_ELEM_AC_DESCRIPTOR 1 /**< AC Descriptor */
|
|
|
|
|
2018-03-05 07:24:48 +01:00
|
|
|
#define CAPWAP_ELEM_AC_IPV4_LIST 2 /**< AC IP V4 List */
|
2018-02-23 17:57:13 +01:00
|
|
|
#define CW_ELEM_AC_IPV6_LIST 3 /**< AC IP V6 List */
|
|
|
|
#define CW_ELEM_AC_NAME 4 /**< AC Name */
|
|
|
|
#define CW_ELEM_AC_NAME_WITH_PRIORITY 5
|
|
|
|
|
|
|
|
/**
|
|
|
|
* In CAPWAP RFC draft 7 the message element 5 was named
|
|
|
|
* AC Name With Index. So we define it here with this name
|
|
|
|
* to be compatible.
|
|
|
|
* @see CW_ELEM_AC_NAME_WITH_PRIORITY */
|
|
|
|
#define CW_ELEM_AC_NAME_WITH_INDEX CW_ELEM_AC_NAME_WITH_PRIORITY
|
|
|
|
|
2015-03-29 15:36:23 +02:00
|
|
|
#define CW_ELEM_AC_TIMESTAMP 6
|
2018-02-23 10:44:20 +01:00
|
|
|
/**@{
|
|
|
|
* one for all
|
|
|
|
*/
|
2018-02-23 13:59:36 +01:00
|
|
|
/* yes one for alllll */
|
2015-03-29 15:36:23 +02:00
|
|
|
#define CW_ELEM_ADD_MAC_ACL_ENTRY 7
|
|
|
|
#define CW_ELEM_ADD_STATION 8
|
|
|
|
#define CW_ELEM_RESERVED_9 9
|
2015-04-05 02:07:59 +02:00
|
|
|
#define CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS 10
|
|
|
|
#define CW_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS 11
|
2018-02-23 10:44:20 +01:00
|
|
|
/**@}*/
|
2015-04-05 02:07:59 +02:00
|
|
|
#define CW_ELEM_CAPWAP_LOCAL_IPV4_ADDRESS 30
|
|
|
|
#define CW_ELEM_CAPWAP_LOCAL_IPV6_ADDRESS 50
|
2015-03-29 15:36:23 +02:00
|
|
|
#define CW_ELEM_CAPWAP_TIMERS 12
|
2015-03-31 20:39:50 +02:00
|
|
|
#define CW_ELEM_CAPWAP_TRANSPORT_PROTOCOL 51 /* not in draft 7 */
|
2015-03-29 15:36:23 +02:00
|
|
|
#define CW_ELEM_DATA_TRANSFER_DATA 13
|
|
|
|
#define CW_ELEM_DATA_TRANSFER_MODE 14
|
|
|
|
#define CW_ELEM_DECRYPTION_ERROR_REPORT 15
|
|
|
|
#define CW_ELEM_DECRYPTION_ERROR_REPORT_PERIOD 16
|
|
|
|
#define CW_ELEM_DELETE_MAC_ACL_ENTRY 17
|
|
|
|
#define CW_ELEM_DELETE_STATION 18
|
2015-04-05 02:07:59 +02:00
|
|
|
#define CW_ELEM_RESERVED_19 19
|
2018-02-23 20:14:10 +01:00
|
|
|
/**
|
|
|
|
* Indicates the AP's Discovery Type
|
2018-03-05 10:19:54 +01:00
|
|
|
* @see CAPWAPDIscoveryTypes */
|
2018-02-23 20:14:10 +01:00
|
|
|
#define CAPWAP_ELEM_DISCOVERY_TYPE 20
|
2015-03-29 15:36:23 +02:00
|
|
|
#define CW_ELEM_DUPLICATE_IPV4_ADDRESS 21
|
|
|
|
#define CW_ELEM_DUPLICATE_IPV6_ADRESS 22
|
2016-03-06 16:46:24 +01:00
|
|
|
#define CW_ELEM_ECN_SUPPORT 53
|
2015-03-29 15:36:23 +02:00
|
|
|
#define CW_ELEM_IDLE_TIMEOUT 23
|
|
|
|
#define CW_ELEM_IMAGE_DATA 24
|
|
|
|
#define CW_ELEM_IMAGE_IDENTIFIER 25
|
|
|
|
#define CW_ELEM_IMAGE_INFORMATION 26
|
|
|
|
#define CW_ELEM_INITIATE_DOWNLOAD 27
|
2015-04-05 02:07:59 +02:00
|
|
|
#define CW_ELEM_LOCATION_DATA 28
|
2015-05-02 10:45:16 +02:00
|
|
|
#define CW_ELEM_MAXIMUM_MESSAGE_LENGTH 29
|
2016-03-10 07:48:59 +01:00
|
|
|
#define CW_ELEM_MTU_DISCOVERY_PADDING 52
|
2015-04-26 08:41:12 +02:00
|
|
|
#define CW_ELEM_RADIO_ADMINISTRATIVE_STATE 31
|
2015-03-29 15:36:23 +02:00
|
|
|
#define CW_ELEM_RADIO_OPERATIONAL_STATE 32
|
|
|
|
#define CW_ELEM_RESULT_CODE 33
|
|
|
|
#define CW_ELEM_RETURNED_MESSAGE_ELEMENT 34
|
|
|
|
#define CW_ELEM_SESSION_ID 35
|
|
|
|
#define CW_ELEM_STATISTICS_TIMER 36
|
2018-02-24 23:58:31 +01:00
|
|
|
/**
|
|
|
|
* The Vendor Specific Payload allows tronasport of
|
|
|
|
* vebdor defined data.*/
|
|
|
|
#define CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD 37
|
|
|
|
|
2018-02-23 20:14:10 +01:00
|
|
|
#define CAPWAP_ELEM_WTP_BOARD_DATA 38
|
|
|
|
/**
|
|
|
|
* The WTP Descriptor message element conteins information
|
|
|
|
* about the WTP */
|
|
|
|
#define CAPWAP_ELEM_WTP_DESCRIPTOR 39
|
2018-03-05 09:56:39 +01:00
|
|
|
#define CAPWAP_ELEM_WTP_FALLBACK 40
|
2018-02-24 01:52:39 +01:00
|
|
|
#define CAPWAP_ELEM_WTP_FRAME_TUNNEL_MODE 41
|
2015-03-29 15:36:23 +02:00
|
|
|
#define CW_ELEM_RESERVED_42 42
|
|
|
|
#define CW_ELEM_RESERVED_43 43
|
2018-02-24 01:52:39 +01:00
|
|
|
#define CAPWAP_ELEM_WTP_MAC_TYPE 44
|
2015-03-29 15:36:23 +02:00
|
|
|
#define CW_ELEM_WTP_NAME 45
|
|
|
|
#define CW_ELEM_RESERVED_46 46
|
|
|
|
#define CW_ELEM_WTP_RADIO_STATISTICS 47
|
2015-04-07 07:42:36 +02:00
|
|
|
#define CW_ELEM_WTP_REBOOT_STATISTICS 48
|
2015-03-29 09:35:11 +02:00
|
|
|
#define CW_ELEM_WTP_STATIC_IP_ADDRESS_INFORMATION 49
|
2015-03-29 15:36:23 +02:00
|
|
|
#define CW_ELEM_WTP_STATIC_IP_ADDR_INFO 49
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2015-03-23 07:47:27 +01:00
|
|
|
|
2015-03-29 15:36:23 +02:00
|
|
|
/* Cisco's CAPWAP definitions (CAPWAP draft 7) */
|
|
|
|
#define CW_ELEM_WTP_IPV4_IP_ADDRESS 42
|
|
|
|
#define CW_ELEM_WTP_IPV6_IP_ADDRESS 43
|
2015-03-12 23:21:57 +01:00
|
|
|
|
2018-02-23 10:44:20 +01:00
|
|
|
/**@}*/
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2016-03-13 18:48:17 +01:00
|
|
|
/**
|
|
|
|
* @defgrpup BOARD_SUBELEMS Board Data Sub-Elements
|
|
|
|
* @{
|
|
|
|
*/
|
2015-04-07 07:42:36 +02:00
|
|
|
#define CW_BOARDDATA_MODELNO 0
|
|
|
|
#define CW_BOARDDATA_SERIALNO 1
|
|
|
|
#define CW_BOARDDATA_BOARDID 2
|
|
|
|
#define CW_BOARDDATA_REVISION 3
|
|
|
|
#define CW_BOARDDATA_MACADDRESS 4
|
2016-03-13 18:48:17 +01:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
2015-04-05 02:07:59 +02:00
|
|
|
|
|
|
|
#define CW_FLAG_RMAC_RESERVED 0
|
|
|
|
#define CW_FLAG_RMAC_SUPPORTED 1
|
|
|
|
#define CW_FLAG_RMAC_NOT_SUPPORTED 2
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
2015-04-05 02:07:59 +02:00
|
|
|
#define CW_SUBELEM_WTP_HARDWARE_VERSION 0
|
|
|
|
#define CW_SUBELEM_WTP_SOFTWARE_VERSION 1
|
|
|
|
#define CW_SUBELEM_WTP_BOOTLOADER_VERSION 2
|
|
|
|
#define CW_SUBELEM_WTP_OTHERSOFTWARE_VERSION 3
|
|
|
|
|
|
|
|
#define CW_SUBELEM_AC_HARDWARE_VERSION 4
|
|
|
|
#define CW_SUBELEM_AC_SOFTWARE_VERSION 5
|
|
|
|
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
/* Frame tunnnel mode bits */
|
2016-04-18 07:40:30 +02:00
|
|
|
#define CW_WTP_FRAME_TUNNEL_MODE_R 1 /* Reserved */
|
|
|
|
#define CW_WTP_FRAME_TUNNEL_MODE_L 2 /* Local bridging */
|
|
|
|
#define CW_WTP_FRAME_TUNNEL_MODE_E 4 /* 802.3 mode */
|
|
|
|
#define CW_WTP_FRAME_TUNNEL_MODE_N 8 /* native mode */
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
2018-02-23 10:44:20 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @defgroup CAPWAPDiscoveryTypes CAPWAP Discovery Types
|
|
|
|
* @brief CAPWAP Discovery Types defined in RFC5415
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
/** Discovery Type is unknown */
|
|
|
|
#define CAPWAP_DISCOVERY_TYPE_UNKNOWN 0
|
|
|
|
/** AC was discoverd by a static IP address stored in AP's config */
|
|
|
|
#define CAPWAP_DISCOVERY_TYPE_STATIC 1
|
|
|
|
/** AC was discovered by DHCP option 43 returned from a DHCP server */
|
|
|
|
#define CAPWAP_DISCOVERY_TYPE_DHCP 2
|
|
|
|
/** AC was discovered by DNS lookup */
|
|
|
|
#define CAPWAP_DISCOVERY_TYPE_DNS 3
|
|
|
|
/** AC was discovered by referral */
|
|
|
|
#define CAPWAP_DISCOVERY_TYPE_AC_REFERRAL 4
|
|
|
|
/**@}*/
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
2018-02-22 23:04:15 +01:00
|
|
|
/* WTP mac types */
|
2016-04-18 07:40:30 +02:00
|
|
|
#define CW_WTP_MAC_TYPE_LOCAL 0
|
|
|
|
#define CW_WTP_MAC_TYPE_SPLIT 1
|
|
|
|
#define CW_WTP_MAC_TYPE_BOTH 2
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
2018-03-03 08:15:19 +01:00
|
|
|
/*
|
2014-07-11 22:12:11 +02:00
|
|
|
//#define CWMSG_MAX_SIZE 65536
|
2018-02-22 23:04:15 +01:00
|
|
|
//#define CWMSG_MAX_SIZE 2048
|
2018-03-03 08:15:19 +01:00
|
|
|
*/
|
2016-04-10 16:00:04 +02:00
|
|
|
|
|
|
|
#define CW_SESSION_ID_LEN 16
|
|
|
|
|
|
|
|
|
2014-07-11 22:12:11 +02:00
|
|
|
/* capwap timer default values */
|
2018-02-22 23:04:15 +01:00
|
|
|
#define CW_DISCOVERY_INTERVAL 5
|
|
|
|
#define CW_MAX_DISCOVERY_INTERVAL 20
|
2014-07-11 22:12:11 +02:00
|
|
|
#define CAPWAP_RETRANSMIT_INTERVAL 3
|
|
|
|
#define CAPWAP_MAX_DISCOVERIES 10
|
|
|
|
#define CAPWAP_MAX_RETRANSMIT 5
|
|
|
|
#define CAPWAP_SILENT_INTERVAL 30
|
|
|
|
#define CAPWAP_ECHO_INTERVAL 30
|
2014-08-18 00:06:06 +02:00
|
|
|
#define CAPWAP_WAIT_DTLS 60
|
|
|
|
#define CAPWAP_WAIT_JOIN 60
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2016-03-15 19:23:41 +01:00
|
|
|
#define CAPWAP_IDLE_TIMEOUT 300
|
|
|
|
|
2016-03-12 22:27:25 +01:00
|
|
|
|
|
|
|
#define CAPWAP_STATISTICS_TIMER 120
|
|
|
|
|
|
|
|
|
2018-02-23 01:41:07 +01:00
|
|
|
#define CW_TIMERS ((CW_DISCOVERY_INTERVAL << 8) | CAPWAP_ECHO_INTERVAL)
|
2015-04-21 08:24:59 +02:00
|
|
|
|
2018-03-03 08:15:19 +01:00
|
|
|
/*
|
|
|
|
//#define CAPWAP_CIPHER "PSK-AES128-CBC-SHA:"
|
2015-03-23 07:47:27 +01:00
|
|
|
//#define CAPWAP_CIPHER "AES128-SHA"
|
2018-03-03 08:15:19 +01:00
|
|
|
*/
|
2015-02-07 02:04:09 +01:00
|
|
|
|
|
|
|
#ifdef WITH_GNUTLS
|
2015-03-23 07:47:27 +01:00
|
|
|
#define CAPWAP_CIPHER "NORMAL"
|
2015-02-07 02:04:09 +01:00
|
|
|
#else
|
2015-03-23 07:47:27 +01:00
|
|
|
#define CAPWAP_CIPHER "ALL"
|
2015-02-07 02:04:09 +01:00
|
|
|
#endif
|
2014-08-02 14:19:18 +02:00
|
|
|
|
|
|
|
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2016-03-21 19:59:50 +01:00
|
|
|
/**
|
|
|
|
* @defgroup ACSECURITY Security Flags used in AC Descriptor
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
/** X.509 Support */
|
2016-03-21 20:12:27 +01:00
|
|
|
#define CW_FLAG_AC_SECURITY_X 2
|
2016-03-21 19:59:50 +01:00
|
|
|
/* PSK Support */
|
2016-03-21 20:12:27 +01:00
|
|
|
#define CW_FLAG_AC_SECURITY_S 4
|
2016-03-21 19:59:50 +01:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2016-03-21 19:47:08 +01:00
|
|
|
/**
|
2018-03-03 08:15:19 +01:00
|
|
|
* @defgroup ACDTLSPOLICY CAPWAP DTLS Policy Flags
|
|
|
|
* The DTLS policy flags are describing the data transfer
|
|
|
|
* policy by AC.
|
2016-03-21 19:47:08 +01:00
|
|
|
* @{
|
|
|
|
*/
|
2018-03-03 08:15:19 +01:00
|
|
|
|
2016-03-21 19:47:08 +01:00
|
|
|
/** Reserved */
|
2018-03-03 08:15:19 +01:00
|
|
|
#define CAPWAP_FLAG_DTLS_POLICY_R 1
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clear Text Data Channel Support.
|
|
|
|
* Means unencrypted data is supprted.*/
|
|
|
|
#define CAPWAP_FLAG_DTLS_POLICY_C 2
|
|
|
|
|
|
|
|
/**
|
|
|
|
* DTLS Data Channel Support.
|
|
|
|
* Encrypted data is supported. */
|
|
|
|
#define CAPWAP_FLAG_DTLS_POLICY_D 4
|
2016-03-21 19:47:08 +01:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
2015-03-17 01:10:08 +01:00
|
|
|
|
2015-03-23 07:47:27 +01:00
|
|
|
struct cwimage_data {
|
|
|
|
uint8_t *data;
|
2014-08-25 07:56:14 +02:00
|
|
|
uint8_t type;
|
2014-08-17 11:38:20 +02:00
|
|
|
int len;
|
2015-03-17 01:10:08 +01:00
|
|
|
uint32_t vendor_id;
|
|
|
|
uint8_t *identifier;
|
2014-08-17 11:38:20 +02:00
|
|
|
};
|
|
|
|
|
2015-03-17 01:10:08 +01:00
|
|
|
/*
|
|
|
|
struct cwimage_identifier{
|
2014-08-17 11:38:20 +02:00
|
|
|
uint32_t vendor_id;
|
|
|
|
char *name;
|
|
|
|
};
|
2015-03-17 01:10:08 +01:00
|
|
|
*/
|
2014-08-17 11:38:20 +02:00
|
|
|
|
|
|
|
|
2018-03-03 08:15:19 +01:00
|
|
|
/*
|
2014-07-27 16:12:12 +02:00
|
|
|
//extern void cwmsg_addelem_wtp_radio_infos(struct cwmsg * cwmsg,struct wtpinfo * wtpinfo);
|
2018-03-03 08:15:19 +01:00
|
|
|
*/
|
2015-04-05 02:07:59 +02:00
|
|
|
extern void cwmsg_addelem_wtp_radio_infos(struct cwmsg *msg,
|
|
|
|
struct radioinfo *radioinfos);
|
2018-03-03 08:15:19 +01:00
|
|
|
/*
|
2015-03-29 01:55:06 +01:00
|
|
|
//extern void cwmsg_addelem_result_code(struct cwmsg *msg, int rc);
|
2018-03-03 08:15:19 +01:00
|
|
|
*/
|
|
|
|
|
2015-04-05 02:07:59 +02:00
|
|
|
extern void cwmsg_addelem_vendor_specific_payload(struct cwmsg *msg, int vendor_id,
|
|
|
|
int type, uint8_t * payload, int len);
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-23 07:47:27 +01:00
|
|
|
extern int hdr_print(char *str, uint8_t * packet, int len);
|
2014-07-27 10:30:22 +02:00
|
|
|
|
2015-04-05 02:07:59 +02:00
|
|
|
extern int cw_readelem_ecn_support(uint8_t * ecn_support, int type, uint8_t * msgelem,
|
|
|
|
int len);
|
2018-03-03 08:15:19 +01:00
|
|
|
/*
|
2016-03-07 09:46:48 +01:00
|
|
|
//extern int cw_readelem_maximum_message_length(uint16_t * dst, int type, uint8_t * msgelem,
|
|
|
|
// int len);
|
|
|
|
//extern int cw_readelem_ac_name(uint8_t ** dst, int type, uint8_t * msgelem, int len);
|
2015-05-01 20:34:50 +02:00
|
|
|
//extern int cw_readelem_wtp_reboot_statistics(struct wtp_reboot_statistics *s, int type,
|
|
|
|
// uint8_t * msgelem, int len);
|
2016-03-07 09:46:48 +01:00
|
|
|
//extern int cw_readelem_cw_local_ip_addr(struct sockaddr *local_ip, int type,
|
|
|
|
// uint8_t * msgelem, int len);
|
2015-04-28 10:22:35 +02:00
|
|
|
//extern int cw_readelem_radio_administrative_state(struct radioinfo *radioinfo, int type,
|
|
|
|
// uint8_t * msgelem, int len);
|
|
|
|
//extern int cw_readelem_radio_operational_state(struct radioinfo *radioinfo, int type,
|
|
|
|
// uint8_t * msgelem, int len);
|
2018-03-03 08:15:19 +01:00
|
|
|
*/
|
|
|
|
|
2014-08-21 21:37:02 +02:00
|
|
|
|
2015-04-05 02:07:59 +02:00
|
|
|
extern int cw_readelem_statistics_timer(uint16_t * timer, int type, uint8_t * msgelem,
|
|
|
|
int len);
|
|
|
|
extern int cw_readelem_result_code(uint32_t * result_code, int type, uint8_t * msgelem,
|
|
|
|
int len);
|
2015-03-23 07:47:27 +01:00
|
|
|
extern int cw_readelem_mtu_discovery_padding(int type, uint8_t * msgelem, int len);
|
|
|
|
extern int cw_readelem_vendor_specific_payload(void *data, int msgtype, int elemtype,
|
|
|
|
uint8_t * msgelem, int len);
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2014-08-14 11:43:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-11 13:24:31 +01:00
|
|
|
enum cw_reboot_failure_types {
|
2016-03-11 18:16:13 +01:00
|
|
|
CW_REBOOT_TYPE_NOT_SUPPORTED=0,
|
|
|
|
CW_REBOOT_TYPE_AC_INITIATED=1,
|
|
|
|
CW_REBOOT_TYPE_LINK_FAILURE=2,
|
|
|
|
CW_REBOOT_TYPE_SOFTWARE_FAILURE=3,
|
|
|
|
CW_REBOOT_TYPE_HARDWARE_FAILURE=4,
|
|
|
|
CW_REBOOT_TYPE_OTHER_FAILURE=5,
|
|
|
|
CW_REBOOT_TYPE_FAILURE_ONKNOWN
|
2016-03-11 13:24:31 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2014-08-14 11:43:09 +02:00
|
|
|
|
2018-03-03 08:15:19 +01:00
|
|
|
#define CAPWAP_RESULT_SUCCESS 0
|
2015-04-10 17:14:55 +02:00
|
|
|
#define CW_RESULT_MISSING_AC_LIST 1
|
2015-03-29 15:36:23 +02:00
|
|
|
#define CW_RESULT_SUCCESS_NAT 2
|
|
|
|
#define CW_RESULT_JOIN_FAILURE 3
|
|
|
|
#define CW_RESULT_JOIN_RESOURCE_DEPLETION 4
|
|
|
|
#define CW_RESULT_JOIN_UNKNOWN_SOURCE 5
|
2015-04-10 17:14:55 +02:00
|
|
|
#define CW_RESULT_JOIN_INCORRECT_DATA 6
|
2015-04-05 02:07:59 +02:00
|
|
|
#define CW_RESULT_JOIN_FAILURE_SESSION_ALREADY_IN_USE 7
|
|
|
|
#define CW_RESULT_JOIN_FAILURE_WTP_HARDWARE_NOT_SUPPORTED 8
|
|
|
|
#define CW_RESULT_JOIN_FAILURE_BINDING_NOT_SUPPORTED 9
|
2015-04-28 22:50:29 +02:00
|
|
|
#define CW_RESULT_RESET_UNABLE_TO_RESET 10
|
2014-08-16 19:30:21 +02:00
|
|
|
|
2015-04-05 02:07:59 +02:00
|
|
|
#define CW_RESULT_RESET_FAILURE_FIRMWARE_WRITE_ERROR 11
|
2014-08-16 19:30:21 +02:00
|
|
|
|
2018-03-03 08:15:19 +01:00
|
|
|
/**
|
|
|
|
* Configuration Failure (Unable to Apply Requested Configuration
|
|
|
|
* - Service Provided Anyhow)
|
|
|
|
*/
|
|
|
|
#define CW_RESULT_CONFIGURATION_FAILURE 12
|
2014-08-16 19:30:21 +02:00
|
|
|
|
2018-03-03 08:15:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2014-08-16 19:30:21 +02:00
|
|
|
|
|
|
|
13 Configuration Failure (Unable to Apply Requested Configuration
|
|
|
|
- Service Not Provided)
|
2015-04-20 21:28:22 +02:00
|
|
|
*/
|
2014-08-14 11:43:09 +02:00
|
|
|
|
2018-03-03 08:15:19 +01:00
|
|
|
/**
|
|
|
|
* Image Data Error (Invalid Checksum)
|
|
|
|
*/
|
|
|
|
#define CW_RESULT_IMAGE_DATA_INVALID_CHECKSUM 14
|
2014-08-14 11:43:09 +02:00
|
|
|
|
2018-03-03 08:15:19 +01:00
|
|
|
/**
|
|
|
|
* Image Data Error (Invalid Data Length)
|
|
|
|
*/
|
|
|
|
#define CW_RESULT_IMAGE_DATA_IVALID_LENGTH 15
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Image Data Error (Other Error)
|
|
|
|
*/
|
|
|
|
#define CAPWAP_RESULT_IMAGE_DATA_ERROR 16
|
2014-08-14 11:43:09 +02:00
|
|
|
|
2015-04-07 07:42:36 +02:00
|
|
|
/*
|
2014-08-16 19:30:21 +02:00
|
|
|
17 Image Data Error (Image Already Present)
|
2015-03-17 01:10:08 +01:00
|
|
|
*/
|
2015-04-11 19:00:51 +02:00
|
|
|
|
2018-02-26 22:37:39 +01:00
|
|
|
#define CAPWAP_RESULT_MSG_INVALID_IN_CURRENT_STATE 18
|
2015-04-11 19:00:51 +02:00
|
|
|
#define CW_RESULT_MSG_UNRECOGNIZED 19
|
2015-03-23 07:47:27 +01:00
|
|
|
#define CW_RESULT_MISSING_MAND_ELEM 20
|
2015-04-07 07:42:36 +02:00
|
|
|
|
2014-08-16 19:30:21 +02:00
|
|
|
|
2016-03-06 21:50:01 +01:00
|
|
|
#define CW_RESULT_UNRECOGNIZED_MESSAGE_ELEMENT 21
|
|
|
|
|
|
|
|
/* 22 Data Transfer Error (No Information to Transfer)
|
2014-08-16 19:30:21 +02:00
|
|
|
|
|
|
|
*/
|
2014-08-14 11:43:09 +02:00
|
|
|
|
2015-03-17 01:10:08 +01:00
|
|
|
|
|
|
|
|
2016-04-09 13:36:32 +02:00
|
|
|
#define CW_RADIO_ADMIN_STATE_ENABLED 1
|
|
|
|
#define CW_RADIO_ADMIN_STATE_DISABLED 2
|
|
|
|
|
|
|
|
#define CW_RADIO_OPER_STATE_ENABLED 1
|
|
|
|
#define CW_RADIO_OPER_STATE_DISABLED 2
|
|
|
|
|
|
|
|
#define CW_RADIO_OPER_STATE_ENABLED_7 2
|
|
|
|
#define CW_RADIO_OPER_STATE_DISABLED_7 1
|
2016-04-02 09:05:07 +02:00
|
|
|
|
|
|
|
|
2016-04-09 13:51:03 +02:00
|
|
|
#define CW_RADIO_OPER_CAUSE_NORMAL 0
|
|
|
|
#define CW_RADIO_OPER_CAUSE_RADIO_FAILURE 1
|
|
|
|
#define CW_RADIO_OPER_CAUSE_SW_FAILURE 2
|
|
|
|
#define CW_RADIO_OPER_CAUSE_ADMIN_SET 3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-17 01:10:08 +01:00
|
|
|
extern void cw_read_image_data_request(struct cwimage_data *, uint8_t * msg, int len);
|
|
|
|
|
2018-03-03 08:15:19 +01:00
|
|
|
/*
|
2015-04-12 10:19:02 +02:00
|
|
|
//extern int cw_readelem_ac_descriptor(struct ac_info *acinfo, int type, uint8_t * msgelem,
|
|
|
|
// int len);
|
2016-03-06 19:14:02 +01:00
|
|
|
//extern int cw_readelem_capwap_local_ip_addr(struct sockaddr *local_ip, int type,
|
|
|
|
// uint8_t * msgelem, int len);
|
2018-03-03 08:15:19 +01:00
|
|
|
*/
|
2015-03-23 07:47:27 +01:00
|
|
|
|
|
|
|
|
2015-04-05 02:07:59 +02:00
|
|
|
extern int cw_send_echo_response(struct conn *conn, int seqnum,
|
|
|
|
struct radioinfo *radioinfo);
|
2015-03-23 07:47:27 +01:00
|
|
|
extern int cw_handle_echo_request(void *d);
|
|
|
|
extern void cw_send_image_file(struct conn *conn, FILE * infile);
|
|
|
|
|
2015-03-29 01:55:06 +01:00
|
|
|
extern int cw_readmsg_configuration_status_response(uint8_t * elems, int elems_len);
|
2015-04-05 02:07:59 +02:00
|
|
|
extern int cw_readmsg_configuration_update_request(uint8_t * elems, int elems_len);
|
2015-03-28 10:13:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-31 08:04:03 +02:00
|
|
|
/* Message to text stuff */
|
|
|
|
|
2015-03-31 18:37:07 +02:00
|
|
|
/* Constants to string conversion lists */
|
2015-10-18 09:49:14 +02:00
|
|
|
extern struct cw_strlist_elem capwap_strings_msg[];
|
|
|
|
extern struct cw_strlist_elem capwap_strings_state[];
|
|
|
|
extern struct cw_strlist_elem capwap_strings_vendor[];
|
|
|
|
extern struct cw_strlist_elem capwap_strings_elem[];
|
|
|
|
extern struct cw_strlist_elem capwap_strings_result[];
|
2016-03-13 18:48:17 +01:00
|
|
|
extern struct cw_strlist_elem capwap_strings_board[];
|
2015-10-18 09:49:14 +02:00
|
|
|
extern struct cw_strlist_elem mbag_item_strings[];
|
2015-04-19 16:44:20 +02:00
|
|
|
|
|
|
|
|
2015-03-31 18:37:07 +02:00
|
|
|
|
2015-03-31 08:04:03 +02:00
|
|
|
|
2016-03-13 18:48:17 +01:00
|
|
|
|
|
|
|
|
2015-03-31 14:10:55 +02:00
|
|
|
#define cw_strmsg(id) cw_strlist_get_str(capwap_strings_msg,id)
|
2015-04-05 02:07:59 +02:00
|
|
|
#define cw_strelem(id) cw_strlist_get_str(capwap_strings_elem,id)
|
2015-03-31 14:10:55 +02:00
|
|
|
#define cw_strstate(id) cw_strlist_get_str(capwap_strings_state,id)
|
2015-03-31 20:39:50 +02:00
|
|
|
#define cw_strvendor(id) cw_strlist_get_str(capwap_strings_vendor,id)
|
2018-03-03 08:15:19 +01:00
|
|
|
|
2016-03-13 18:48:17 +01:00
|
|
|
#define cw_strresult(id) cw_strlist_get_str(capwap_strings_result,id)
|
2018-03-03 08:15:19 +01:00
|
|
|
|
2016-03-13 18:48:17 +01:00
|
|
|
#define cw_strboardelem(id) cw_strlist_get_str(capwap_strings_board,id)
|
2015-03-31 08:04:03 +02:00
|
|
|
|
2015-04-19 23:27:44 +02:00
|
|
|
#define cw_stritem(id) cw_strlist_get_str(mbag_item_strings,(id))
|
2015-04-19 16:44:20 +02:00
|
|
|
|
2015-04-14 07:42:23 +02:00
|
|
|
/*
|
2015-04-11 19:00:51 +02:00
|
|
|
#define cw_strrc(rc) \
|
|
|
|
((rc)<0 ? ((rc)!=EAGAIN ? strerror(errno):"Timed out"): cw_strresult(rc))
|
2015-04-13 11:00:46 +02:00
|
|
|
#define cw_strerror(rc) cw_strrc(rc)
|
2015-04-14 07:42:23 +02:00
|
|
|
*/
|
|
|
|
|
2015-04-11 19:00:51 +02:00
|
|
|
|
2018-03-02 13:36:03 +01:00
|
|
|
const char * cw_strerror(int rc);
|
|
|
|
int cw_rcok(int rc);
|
|
|
|
const char *cw_strelemp_(cw_strheap_t h, int msg_id);
|
2015-04-11 19:00:51 +02:00
|
|
|
|
|
|
|
|
2015-04-07 07:42:36 +02:00
|
|
|
|
2018-03-02 13:36:03 +01:00
|
|
|
#define cw_strrc cw_strerror
|
2016-02-23 19:38:10 +01:00
|
|
|
|
2015-04-07 07:42:36 +02:00
|
|
|
#define cw_strelemp(p,id) cw_strelemp_((p)->strelem,id)
|
2015-04-05 20:27:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-03 08:15:19 +01:00
|
|
|
/*
|
2015-04-10 17:14:55 +02:00
|
|
|
//int cw_process_msg(struct conn *conn, uint8_t * rawmsg, int len);
|
2018-03-03 08:15:19 +01:00
|
|
|
*/
|
2015-04-05 02:07:59 +02:00
|
|
|
|
|
|
|
extern int cw_in_vendor_specific_payload(struct conn *conn, struct cw_action_in *a,
|
2015-04-12 23:28:55 +02:00
|
|
|
uint8_t * data, int len,struct sockaddr *from);
|
2015-04-05 02:07:59 +02:00
|
|
|
extern int cw_in_wtp_name(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
2015-04-12 23:28:55 +02:00
|
|
|
int len,struct sockaddr *from);
|
2015-04-05 02:07:59 +02:00
|
|
|
extern int cw_in_wtp_board_data(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
2015-04-12 23:28:55 +02:00
|
|
|
int len,struct sockaddr *from);
|
2015-04-05 02:07:59 +02:00
|
|
|
extern int cw_in_wtp_descriptor(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
2015-04-12 23:28:55 +02:00
|
|
|
int len,struct sockaddr *from);
|
2018-03-03 08:15:19 +01:00
|
|
|
|
|
|
|
/*
|
2015-04-05 02:07:59 +02:00
|
|
|
//extern int cw_out_generic(struct conn *conn,struct cw_action_in * a,uint8_t *data,int len);
|
2018-03-03 08:15:19 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
extern int cw_out_generic(struct conn *conn, struct cw_action_out *a, uint8_t * dst);
|
2015-04-05 20:27:17 +02:00
|
|
|
|
2018-03-03 08:15:19 +01:00
|
|
|
/*
|
2015-04-05 20:27:17 +02:00
|
|
|
//extern int cw_out_ac_descriptor(struct conn *conn, uint32_t elem_id, uint8_t * dst,
|
2015-04-19 23:27:44 +02:00
|
|
|
//struct mbag_item *item);
|
2018-03-03 08:15:19 +01:00
|
|
|
*/
|
|
|
|
extern int cw_out_ac_descriptor(struct conn *conn, struct cw_action_out *a, uint8_t * dst);
|
2015-04-11 19:00:51 +02:00
|
|
|
extern int cw_out_wtp_descriptor(struct conn *conn, struct cw_action_out *a,
|
|
|
|
uint8_t * dst);
|
|
|
|
|
2018-03-03 08:15:19 +01:00
|
|
|
/*
|
2015-04-05 20:27:17 +02:00
|
|
|
//extern int cw_out_capwap_control_ip_addrs(struct conn *conn, uint32_t elem_id,
|
2015-04-19 23:27:44 +02:00
|
|
|
// uint8_t * dst, struct mbag_item *item);
|
2018-03-03 08:15:19 +01:00
|
|
|
*/
|
2015-04-05 20:27:17 +02:00
|
|
|
|
2015-04-11 19:00:51 +02:00
|
|
|
extern int cw_out_capwap_control_ip_addr_list(struct conn *conn, struct cw_action_out *a,
|
|
|
|
uint8_t * dst);
|
2015-04-05 20:27:17 +02:00
|
|
|
|
|
|
|
extern int cw_put_msg(struct conn *conn, uint8_t * rawout);
|
2018-03-03 08:15:19 +01:00
|
|
|
int cw_out_image_data(struct conn *conn, struct cw_action_out *a, uint8_t * dst);
|
2015-04-05 02:07:59 +02:00
|
|
|
|
|
|
|
|
|
|
|
struct cw_ac_status {
|
|
|
|
int stations;
|
|
|
|
int limit;
|
|
|
|
int active_wtps;
|
|
|
|
int max_wtps;
|
|
|
|
int security;
|
|
|
|
int rmac_field;
|
|
|
|
int dtls_policy;
|
|
|
|
};
|
2015-03-31 14:03:21 +02:00
|
|
|
|
2015-04-05 20:27:17 +02:00
|
|
|
/**
|
2016-03-11 22:23:00 +01:00
|
|
|
*@defgroup CAPWAP CAPWAP
|
|
|
|
*@{
|
2015-04-05 20:27:17 +02:00
|
|
|
*/
|
|
|
|
|
2016-03-11 22:23:00 +01:00
|
|
|
/**
|
|
|
|
* CAWAP States
|
|
|
|
*/
|
|
|
|
enum capwap_states {
|
|
|
|
CW_STATE_NONE = 0,
|
|
|
|
/** Discovery State */
|
2018-02-23 20:14:10 +01:00
|
|
|
CAPWAP_STATE_DISCOVERY,
|
2016-03-11 22:23:00 +01:00
|
|
|
/** Join State */
|
2018-02-28 07:38:02 +01:00
|
|
|
CAPWAP_STATE_JOIN,
|
2016-03-11 22:23:00 +01:00
|
|
|
/** Config State */
|
|
|
|
CW_STATE_CONFIGURE,
|
|
|
|
/** Image Data Upload */
|
|
|
|
CW_STATE_IMAGE_DATA,
|
|
|
|
CW_STATE_UPDATE,
|
|
|
|
/** Run State */
|
|
|
|
CW_STATE_RUN
|
|
|
|
};
|
2015-04-05 20:27:17 +02:00
|
|
|
|
2016-03-11 22:23:00 +01:00
|
|
|
/**
|
|
|
|
*@}
|
|
|
|
*/
|
2015-04-05 20:27:17 +02:00
|
|
|
|
|
|
|
|
2015-04-05 03:33:54 +02:00
|
|
|
|
2015-04-05 02:07:59 +02:00
|
|
|
int cw_register_actions_capwap_ac(struct cw_actiondef *def);
|
2015-04-05 03:33:54 +02:00
|
|
|
int cw_register_actions_cipwap_ac(struct cw_actiondef *def);
|
2015-04-07 07:42:36 +02:00
|
|
|
int cw_register_actions_capwap_wtp(struct cw_actiondef *def);
|
|
|
|
|
2015-03-31 14:03:21 +02:00
|
|
|
|
2015-04-11 19:00:51 +02:00
|
|
|
int cw_in_set_state_none(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
|
|
|
int len);
|
2015-04-19 23:27:44 +02:00
|
|
|
struct mbag_item *cw_out_get_outgoing(struct conn *conn, struct cw_action_out *a);
|
|
|
|
struct mbag_item *cw_out_get_local(struct conn *conn, struct cw_action_out *a);
|
2015-04-11 19:00:51 +02:00
|
|
|
extern int cw_in_check_join_resp(struct conn *conn, struct cw_action_in *a,
|
2015-04-12 23:28:55 +02:00
|
|
|
uint8_t * data, int len,struct sockaddr *from);
|
2015-04-10 17:14:55 +02:00
|
|
|
|
2015-04-11 19:00:51 +02:00
|
|
|
extern int cw_in_check_disc_req(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
2015-04-12 23:28:55 +02:00
|
|
|
int len,struct sockaddr *from);
|
2015-04-10 17:14:55 +02:00
|
|
|
int cw_in_check_disc_resp(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
2015-04-12 23:28:55 +02:00
|
|
|
int len,struct sockaddr *from);
|
2015-04-10 17:14:55 +02:00
|
|
|
|
2015-04-11 19:00:51 +02:00
|
|
|
int cw_check_missing_mand(cw_action_in_t ** out, struct conn *conn, cw_action_in_t * a);
|
|
|
|
int cw_in_check_join_req(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
2015-04-12 23:28:55 +02:00
|
|
|
int len,struct sockaddr *from);
|
2015-04-11 19:00:51 +02:00
|
|
|
extern int cw_in_check_img_data_req_wtp(struct conn *conn, struct cw_action_in *a,
|
2015-04-12 23:28:55 +02:00
|
|
|
uint8_t * data, int len,struct sockaddr *from);
|
2015-04-11 19:00:51 +02:00
|
|
|
extern int cw_in_check_img_data_req_ac(struct conn *conn, struct cw_action_in *a,
|
2015-04-12 23:28:55 +02:00
|
|
|
uint8_t * data, int len,struct sockaddr *from);
|
2015-04-11 19:00:51 +02:00
|
|
|
int cw_in_check_img_data_resp(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
2015-04-12 23:28:55 +02:00
|
|
|
int len,struct sockaddr *from);
|
2015-04-07 07:42:36 +02:00
|
|
|
|
2015-04-11 19:00:51 +02:00
|
|
|
int cw_out_wtp_board_data(struct conn *conn, struct cw_action_out *a, uint8_t * dst);
|
2015-04-05 20:27:17 +02:00
|
|
|
|
2015-04-11 19:00:51 +02:00
|
|
|
void cw_init_request(struct conn *conn, int msg_id);
|
2015-04-19 23:27:44 +02:00
|
|
|
struct mbag_item *cw_out_get_session_id(struct conn *conn, struct cw_action_out *a);
|
2015-04-20 02:26:24 +02:00
|
|
|
struct mbag_item *cw_out_get_config(struct conn *conn, struct cw_action_out *a);
|
2015-04-05 20:27:17 +02:00
|
|
|
|
2015-03-31 14:03:21 +02:00
|
|
|
|
2015-04-24 07:13:54 +02:00
|
|
|
extern int cw_in_radio_administrative_state(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
|
|
|
|
struct sockaddr *from);
|
2015-04-10 17:14:55 +02:00
|
|
|
|
2015-04-26 08:41:12 +02:00
|
|
|
int cw_out_ac_name_with_priority(struct conn *conn, struct cw_action_out *a, uint8_t * dst);
|
2015-04-10 17:14:55 +02:00
|
|
|
|
2015-04-11 19:00:51 +02:00
|
|
|
int cw_send_request(struct conn *conn, int msg_id);
|
2018-03-03 08:15:19 +01:00
|
|
|
/*
|
2016-03-12 09:35:54 +01:00
|
|
|
//int cw_is_utf8(unsigned char *str, size_t len);
|
2018-03-03 08:15:19 +01:00
|
|
|
*/
|
2015-04-17 07:38:44 +02:00
|
|
|
|
2015-04-26 08:41:12 +02:00
|
|
|
int cw_in_ac_name_with_priority(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
|
|
|
|
struct sockaddr *from);
|
|
|
|
|
|
|
|
int cw_out_radio_administrative_states(struct conn *conn, struct cw_action_out *a, uint8_t * dst);
|
|
|
|
|
|
|
|
int cw_in_radio_administrative_state(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
|
|
|
|
struct sockaddr *from);
|
2015-04-26 23:52:11 +02:00
|
|
|
int cw_in_ac_descriptor(struct conn *conn,struct cw_action_in * a,uint8_t *data,int len,struct sockaddr *from);
|
2015-04-26 08:41:12 +02:00
|
|
|
|
2015-04-26 12:36:53 +02:00
|
|
|
int cw_in_radio_generic(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
|
|
|
|
struct sockaddr *from);
|
2015-04-10 17:14:55 +02:00
|
|
|
|
2018-03-03 08:15:19 +01:00
|
|
|
/*
|
2016-03-06 16:46:24 +01:00
|
|
|
//int cw_out_capwap_local_ip_address(struct conn *conn, struct cw_action_out *action, uint8_t * dst);
|
2018-03-03 08:15:19 +01:00
|
|
|
*/
|
2015-04-26 16:50:53 +02:00
|
|
|
|
2015-04-26 23:52:11 +02:00
|
|
|
int cw_in_check_chng_state_evnt_req(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
|
|
|
int len,struct sockaddr *from);
|
|
|
|
|
2018-03-03 08:15:19 +01:00
|
|
|
/*
|
2016-04-18 07:40:30 +02:00
|
|
|
//int cw_out_radio_operational_states(struct conn *conn, struct cw_action_out *a, uint8_t * dst);
|
2018-03-03 08:15:19 +01:00
|
|
|
*/
|
2015-04-28 10:22:35 +02:00
|
|
|
|
|
|
|
int cw_in_check_cfg_update_req(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
|
|
|
int len,struct sockaddr *from);
|
|
|
|
|
|
|
|
int cw_radio_set_admin_state(mbag_t radios,int rid, int state,int cause);
|
|
|
|
|
|
|
|
int cw_in_radio_administrative_state_wtp(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
|
|
|
|
struct sockaddr *from);
|
|
|
|
|
|
|
|
|
2016-02-22 09:18:35 +01:00
|
|
|
|
|
|
|
|
2016-03-11 13:24:31 +01:00
|
|
|
|
2014-07-11 22:12:11 +02:00
|
|
|
#endif
|
2018-02-23 10:44:20 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
*@}
|
|
|
|
*/
|