Merge branch 'refactor'
FossilOrigin-Name: 1505b13bc7be477b27f827ac6e06229fc28080dc87e3aa3c3e94d36f56bd9498
This commit is contained in:
commit
6e2c5b510e
@ -25,8 +25,6 @@
|
||||
</VirtualDirectory>
|
||||
<Description/>
|
||||
<Dependencies/>
|
||||
<Dependencies Name="Debug"/>
|
||||
<Dependencies Name="Release"/>
|
||||
<Settings Type="Executable">
|
||||
<GlobalSettings>
|
||||
<Compiler Options="" C_Options="" Assembler="">
|
||||
@ -114,4 +112,6 @@
|
||||
</Completion>
|
||||
</Configuration>
|
||||
</Settings>
|
||||
<Dependencies Name="Debug"/>
|
||||
<Dependencies Name="Release"/>
|
||||
</CodeLite_Project>
|
||||
|
@ -6,6 +6,7 @@
|
||||
<Project Name="mod_capwap" Path="mod_capwap.project" Active="No"/>
|
||||
<Project Name="mod_cisco" Path="mod_cisco.project" Active="Yes"/>
|
||||
<Project Name="libcw" Path="libcw.project" Active="No"/>
|
||||
<Project Name="mod_capwap80211" Path="mod_capwap80211.project" Active="No"/>
|
||||
<BuildMatrix>
|
||||
<WorkspaceConfiguration Name="Debug" Selected="yes">
|
||||
<Environment/>
|
||||
@ -15,6 +16,7 @@
|
||||
<Project Name="mod_capwap" ConfigName="Debug"/>
|
||||
<Project Name="mod_cisco" ConfigName="Debug"/>
|
||||
<Project Name="libcw" ConfigName="Debug"/>
|
||||
<Project Name="mod_capwap80211" ConfigName="Debug"/>
|
||||
</WorkspaceConfiguration>
|
||||
<WorkspaceConfiguration Name="Release" Selected="yes">
|
||||
<Environment/>
|
||||
@ -24,6 +26,7 @@
|
||||
<Project Name="mod_capwap" ConfigName="Release"/>
|
||||
<Project Name="mod_cisco" ConfigName="Release"/>
|
||||
<Project Name="libcw" ConfigName="Release"/>
|
||||
<Project Name="mod_capwap80211" ConfigName="Release"/>
|
||||
</WorkspaceConfiguration>
|
||||
</BuildMatrix>
|
||||
</CodeLite_Workspace>
|
||||
|
@ -620,7 +620,7 @@ int conf_parse_listen_addr(const char *addrstr, char *saddr, char *port, int *pr
|
||||
char *ctrlport;
|
||||
switch (*proto) {
|
||||
case AC_PROTO_CAPWAP:
|
||||
ctrlport = CW_CONTROL_PORT_STR;
|
||||
ctrlport = CAPWAP_CONTROL_PORT_STR;
|
||||
break;
|
||||
case AC_PROTO_LWAPP:
|
||||
ctrlport = LWAPP_CONTROL_PORT_STR;
|
||||
|
@ -69,7 +69,7 @@ extern struct mod_ac ** conf_mods;
|
||||
|
||||
|
||||
#ifndef CONF_DEFAULT_CONTROL_PORT
|
||||
#define CONF_DEFAULT_CONTROL_PORT CW_CONTROL_PORT
|
||||
#define CONF_DEFAULT_CONTROL_PORT CAPWAP_CONTROL_PORT
|
||||
#endif
|
||||
|
||||
#ifndef CONF_DEFAULT_LW_CONTROL_PORT
|
||||
|
@ -119,7 +119,7 @@ int xprocess_message(struct conn *conn, uint8_t * rawmsg, int rawlen,
|
||||
uint8_t *msgptr = rawmsg + cw_get_hdr_msg_offset(rawmsg);
|
||||
uint32_t type = cw_get_msg_type(msgptr);
|
||||
cw_log(LOG_ERR, "Hey: %d", type);
|
||||
if (type == CW_MSG_DISCOVERY_REQUEST)
|
||||
if (type == CAPWAP_MSG_DISCOVERY_REQUEST)
|
||||
conn->capwap_state = CW_STATE_DISCOVERY;
|
||||
|
||||
|
||||
|
@ -330,7 +330,7 @@ IDL_PROPERTY_SUPPORT = YES
|
||||
# all members of a group must be documented explicitly.
|
||||
# The default value is: NO.
|
||||
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
DISTRIBUTE_GROUP_DOC = YES
|
||||
|
||||
# Set the SUBGROUPING tag to YES to allow class member groups of the same type
|
||||
# (for instance a group of public functions) to be put as a subgroup of that
|
||||
|
208
src/cw/capwap.h
208
src/cw/capwap.h
@ -25,8 +25,6 @@
|
||||
#ifndef __CAPWAP_H
|
||||
#define __CAPWAP_H
|
||||
|
||||
|
||||
//#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
@ -41,132 +39,87 @@
|
||||
/* capwap version and iana number */
|
||||
|
||||
/**
|
||||
*@defgroup CAPWAPConstants CAPWAP Constants
|
||||
*@defgroup CAPWAP CAPWAP Defintions from RFC5415
|
||||
*@{
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*@defgroup CAPWAPConstants CAPWAP General Constants
|
||||
*@brief General constants as defined in RFC5415
|
||||
*@{
|
||||
*/
|
||||
|
||||
/** CAPWAP Version */
|
||||
#define CW_VERSION (0)
|
||||
|
||||
#define CW_IANA_ENTERPRISE_NUMBER 0
|
||||
#define CAPWAP_VERSION (0)
|
||||
|
||||
#define CAPWAP_IANA_ENTERPRISE_NUMBER 0
|
||||
*
|
||||
/** CAPWAP Control Port*/
|
||||
#define CW_CONTROL_PORT 5246
|
||||
#define CAPWAP_CONTROL_PORT 5246
|
||||
/** CAPWAP Control Port as String */
|
||||
#define CW_CONTROL_PORT_STR "5246"
|
||||
#define CAPWAP_CONTROL_PORT_STR "5246"
|
||||
|
||||
/** CAPWAP Data Port */
|
||||
#define CAPWAP_DATA_PPORT 5247
|
||||
|
||||
/** CAWPAP DataPort as String */
|
||||
#define CAPWAP_DATA_PPORT_STR "5247"
|
||||
|
||||
|
||||
#define CAPWAP_DATA_PORT_STR "5247"
|
||||
|
||||
/**@}*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* CAPWAP header flags.
|
||||
*/
|
||||
#define CW_FLAG_HDR_R1 0x01 /* bit 0 reserved 1 */
|
||||
#define CW_FLAG_HDR_R2 0x02 /* bit 1 reserved 2 */
|
||||
#define CW_FLAG_HDR_R3 0x04 /* bit 2 reserved 3 */
|
||||
#define CW_FLAG_HDR_K 0x08 /* bit 3 Keep alive flag */
|
||||
#define CW_FLAG_HDR_M 0x10 /* bit 4 MAC Adress field present */
|
||||
#define CW_FLAG_HDR_W 0x20 /* bit 5 wireless info present */
|
||||
#define CW_FLAG_HDR_L 0x40 /* bit 6 last fragment */
|
||||
#define CW_FLAG_HDR_F 0x80 /* bit 7 fragment */
|
||||
#define CW_FLAG_HDR_T 0x100 /* bit 8 type of payload frame */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @addtogroup CAPWAPWBIDS Wireless binding IDs
|
||||
* @{
|
||||
*/
|
||||
#define CW_WBID_RESERVED1 0
|
||||
#define CW_WBID_IEEE80211 1
|
||||
#define CW_WBID_RESERVED2 2
|
||||
#define CW_WBID_EPCGLOBAL 3
|
||||
/**@}*/
|
||||
|
||||
#define CAPWAP_PACKET_PREAMBLE (CW_VERSION<<4)
|
||||
#define CAPWAP_DTLS_PACKET_PREAMBLE (CW_VERSION<<4|1)
|
||||
|
||||
/*
|
||||
* control header stuff
|
||||
*/
|
||||
|
||||
/**
|
||||
*@addtogroup CAPWAPConstants
|
||||
*@defgroup CAPWAPHeaderFlags CAPWAP Header Flags
|
||||
*@brief The CAPWAP control header flags
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
#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 */
|
||||
/**@}*/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* CAPWAP message types as defined in RFC 5416
|
||||
* @defgroup CAPWAPWBIDS CAPWAP Wireless binding IDs
|
||||
* @{
|
||||
*/
|
||||
enum cw_message_types{
|
||||
|
||||
/**Discovery Request = 1*/
|
||||
CW_MSG_DISCOVERY_REQUEST = 1,
|
||||
/** Discovery Response = 2 */
|
||||
CW_MSG_DISCOVERY_RESPONSE = 2,
|
||||
/** Join Request = 3 */
|
||||
CW_MSG_JOIN_REQUEST = 3,
|
||||
/** Join Response = 4 */
|
||||
CW_MSG_JOIN_RESPONSE = 4,
|
||||
/** Config. Status Request = 5*/
|
||||
CW_MSG_CONFIGURATION_STATUS_REQUEST = 5,
|
||||
/** Config. Status Response = 6 */
|
||||
CW_MSG_CONFIGURATION_STATUS_RESPONSE = 6,
|
||||
/** Config. Update Request = 7 */
|
||||
CW_MSG_CONFIGURATION_UPDATE_REQUEST = 7,
|
||||
CW_MSG_CONFIGURATION_UPDATE_RESPONSE = 8,
|
||||
|
||||
CW_MSG_WTP_EVENT_REQUEST = 9,
|
||||
CW_MSG_WTP_EVENT_RESPONSE = 10,
|
||||
|
||||
CW_MSG_CHANGE_STATE_EVENT_REQUEST = 11,
|
||||
CW_MSG_CHANGE_STATE_EVENT_RESPONSE = 12,
|
||||
|
||||
CW_MSG_ECHO_REQUEST = 13,
|
||||
CW_MSG_ECHO_RESPONSE = 14,
|
||||
|
||||
CW_MSG_IMAGE_DATA_REQUEST = 15,
|
||||
CW_MSG_IMAGE_DATA_RESPONSE = 16,
|
||||
|
||||
CW_MSG_RESET_REQUEST = 17,
|
||||
CW_MSG_RESET_RESPONSE = 18,
|
||||
|
||||
CW_MSG_PRIMARY_DISCOVERY_REQUEST = 19,
|
||||
CW_MSG_PRIMARY_DISCOVERY_RESPONSE = 20,
|
||||
|
||||
CW_MSG_DATA_TRANSFER_REQUEST = 21,
|
||||
CW_MSG_DATA_TRANSFER_RESPONSE = 22,
|
||||
|
||||
CW_MSG_CLEAR_CONFIGURATION_REQUEST = 23,
|
||||
CW_MSG_CLEAR_CONFIGURATION_RESPONSE = 24,
|
||||
|
||||
CW_STATION_CONFIGURATION_REQUEST = 25,
|
||||
CW_STATION_CONFIGURATION_RESPONSE = 26,
|
||||
|
||||
CW_MSG_MAXMSG = 26
|
||||
|
||||
};
|
||||
|
||||
//cw_msg_t;
|
||||
|
||||
#define CAPWAP_WBID_RESERVED1 0
|
||||
#define CAPWAP_WBID_IEEE80211 1
|
||||
#define CAPWAP_WBID_RESERVED2 2
|
||||
#define CAPWAP_WBID_EPCGLOBAL 3
|
||||
/**@}*/
|
||||
|
||||
#define CAPWAP_PACKET_PREAMBLE (CAPWAP_VERSION<<4)
|
||||
#define CAPWAP_DTLS_PACKET_PREAMBLE (CAPWAP_VERSION<<4|1)
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
#define CW_MSG_DISCOVERY_REQUEST 1
|
||||
#define CW_MSG_DISCOVERY_RESPONSE 2
|
||||
/**
|
||||
* @defgroup CAPWAPMessages CAPWAP message types as defined in RFC 5416
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* 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. */
|
||||
#define CAPWAP_MSG_DISCOVERY_REQUEST 1
|
||||
/**
|
||||
* A Discovery Response message is send by the AP to
|
||||
* the WTP after receiving a Discovery Request message. */
|
||||
#define CAPWAP_MSG_DISCOVERY_RESPONSE 2
|
||||
#define CW_MSG_JOIN_REQUEST 3
|
||||
#define CW_MSG_JOIN_RESPONSE 4
|
||||
|
||||
@ -204,25 +157,33 @@ CW_MSG_MAXMSG = 26
|
||||
#define CW_STATION_CONFIGURATION_RESPONSE 26
|
||||
|
||||
#define CW_MSG_MAXMSG 26
|
||||
*/
|
||||
|
||||
/**@}*/
|
||||
|
||||
|
||||
/**
|
||||
* CAPWAP message elements as defined in RFC 5415
|
||||
*/
|
||||
* @defgroup CAPWAPMsgElems CAPWAP Message Elements
|
||||
* @brief CAPWAP message elements as defined in RFC 5415
|
||||
* @{
|
||||
*/namin
|
||||
|
||||
|
||||
#define CW_ELEM_AC_DESCRIPTOR 1
|
||||
#define CW_ELEM_AC_IPV4_LIST 2
|
||||
#define CW_ELEM_AC_IPV6_LIST 3
|
||||
#define CW_ELEM_AC_DESCRIPTOR 1 /**< AC Descriptor */
|
||||
#define CW_ELEM_AC_IPV4_LIST 2 /**< AC IP V4 List */
|
||||
#define CW_ELEM_AC_IPV6_LIST 3 /**< AC IP V6 List */
|
||||
#define CW_ELEM_AC_NAME 4
|
||||
#define CW_ELEM_AC_NAME_WITH_PRIORITY 5
|
||||
#define CW_ELEM_AC_NAME_WITH_INDEX CW_ELEM_AC_NAME_WITH_PRIORITY /* Draft 7 naming */
|
||||
#define CW_ELEM_AC_NAME_WITH_INDEX CW_ELEM_AC_NAME_WITH_PRIORITY /**< Draft 7 naming */
|
||||
#define CW_ELEM_AC_TIMESTAMP 6
|
||||
/**@{
|
||||
* one for all
|
||||
*/
|
||||
/* yes one for alllll */
|
||||
#define CW_ELEM_ADD_MAC_ACL_ENTRY 7
|
||||
#define CW_ELEM_ADD_STATION 8
|
||||
#define CW_ELEM_RESERVED_9 9
|
||||
#define CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS 10
|
||||
#define CW_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS 11
|
||||
/**@}*/
|
||||
#define CW_ELEM_CAPWAP_LOCAL_IPV4_ADDRESS 30
|
||||
#define CW_ELEM_CAPWAP_LOCAL_IPV6_ADDRESS 50
|
||||
#define CW_ELEM_CAPWAP_TIMERS 12
|
||||
@ -272,7 +233,7 @@ CW_MSG_MAXMSG = 26
|
||||
#define CW_ELEM_WTP_IPV4_IP_ADDRESS 42
|
||||
#define CW_ELEM_WTP_IPV6_IP_ADDRESS 43
|
||||
|
||||
|
||||
/**@}*/
|
||||
|
||||
/**
|
||||
* @defgrpup BOARD_SUBELEMS Board Data Sub-Elements
|
||||
@ -310,12 +271,23 @@ CW_MSG_MAXMSG = 26
|
||||
#define CW_WTP_FRAME_TUNNEL_MODE_N 8 /* native mode */
|
||||
|
||||
|
||||
/* Discovery Types */
|
||||
#define CW_DISCOVERY_TYPE_UNKNOWN 0
|
||||
#define CW_DISCOVERY_TYPE_STATIC 1
|
||||
#define CW_DISCOVERY_TYPE_DHCP 2
|
||||
#define CW_DISCOVERY_TYPE_DNS 3
|
||||
#define CW_DISCOVERY_TYPE_AC_REFERRAL 4
|
||||
|
||||
/**
|
||||
* @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
|
||||
/**@}*/
|
||||
|
||||
|
||||
/* WTP mac types */
|
||||
@ -759,3 +731,7 @@ int cw_in_radio_administrative_state_wtp(struct conn *conn, struct cw_action_in
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
*@}
|
||||
*/
|
||||
|
@ -16,7 +16,7 @@ cw_action_in_t capwap_80211_actions_ac_in[] = {
|
||||
* Discovery Resquest
|
||||
*/
|
||||
|
||||
{0, 0, CW_STATE_DISCOVERY, CW_MSG_DISCOVERY_REQUEST,
|
||||
{0, 0, CW_STATE_DISCOVERY, CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
CW_ACTION_IN_80211_WTP_RADIO_INFORMATION, 1}
|
||||
,
|
||||
/* --------------------------------------------------------
|
||||
@ -35,7 +35,7 @@ cw_action_in_t capwap_80211_actions_ac_in[] = {
|
||||
|
||||
cw_action_out_t capwap_80211_actions_ac_out[]={
|
||||
/* Radio Infos */
|
||||
{CW_MSG_DISCOVERY_RESPONSE, NULL /*CW_ELEM80211_WTP_RADIO_INFORMATION*/, 0,
|
||||
{CAPWAP_MSG_DISCOVERY_RESPONSE, NULL /*CW_ELEM80211_WTP_RADIO_INFORMATION*/, 0,
|
||||
CW_ELEM80211_WTP_RADIO_INFORMATION, NULL,cw_out_radio_infos, NULL,1}
|
||||
,
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
cw_action_in_t capwap_80211_actions_wtp_in[] = {
|
||||
|
||||
/* Discovery Response */
|
||||
{0, 0, CW_STATE_DISCOVERY, CW_MSG_DISCOVERY_RESPONSE,
|
||||
{0, 0, CW_STATE_DISCOVERY, CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||
CW_ACTION_IN_80211_WTP_RADIO_INFORMATION, 1}
|
||||
,
|
||||
|
||||
@ -34,7 +34,7 @@ cw_action_out_t capwap_80211_actions_wtp_out[]={
|
||||
*/
|
||||
|
||||
/* 802.11 Radio Information */
|
||||
{CW_MSG_DISCOVERY_REQUEST, CW_ITEM_RADIO_INFOS /*CW_ELEM80211_WTP_RADIO_INFORMATION*/, 0,
|
||||
{CAPWAP_MSG_DISCOVERY_REQUEST, CW_ITEM_RADIO_INFOS /*CW_ELEM80211_WTP_RADIO_INFORMATION*/, 0,
|
||||
CW_ELEM80211_WTP_RADIO_INFORMATION, NULL,cw_out_radio_infos, NULL,1}
|
||||
,
|
||||
|
||||
|
@ -26,8 +26,8 @@
|
||||
* CAPWAP Message Strings
|
||||
*/
|
||||
struct cw_strlist_elem capwap_strings_msg[] = {
|
||||
{ CW_MSG_DISCOVERY_REQUEST, "Discovery Request" },
|
||||
{ CW_MSG_DISCOVERY_RESPONSE,"Discovery Response" },
|
||||
{ CAPWAP_MSG_DISCOVERY_REQUEST, "Discovery Request" },
|
||||
{ CAPWAP_MSG_DISCOVERY_RESPONSE,"Discovery Response" },
|
||||
{ CW_MSG_JOIN_REQUEST, "Join Request"},
|
||||
{ CW_MSG_JOIN_RESPONSE,"Join Response"},
|
||||
{ CW_MSG_CONFIGURATION_STATUS_REQUEST,"Configuration Status Request"},
|
||||
|
@ -75,7 +75,7 @@ void cw_init_request(struct conn *conn, int msg_id)
|
||||
cw_put_dword(buffer + 4, 0);
|
||||
|
||||
/* unencrypted */
|
||||
cw_set_hdr_preamble(buffer, CW_VERSION << 4 | 0);
|
||||
cw_set_hdr_preamble(buffer, CAPWAP_VERSION << 4 | 0);
|
||||
|
||||
cw_set_hdr_rmac(buffer, conn->base_rmac);
|
||||
//cw_set_hdr_hlen(buffer, 2);
|
||||
@ -99,7 +99,7 @@ void cw_init_data_msg(struct conn *conn)
|
||||
cw_put_dword(buffer + 4, 0);
|
||||
|
||||
/* unencrypted */
|
||||
cw_set_hdr_preamble(buffer, CW_VERSION << 4 | 0);
|
||||
cw_set_hdr_preamble(buffer, CAPWAP_VERSION << 4 | 0);
|
||||
|
||||
|
||||
|
||||
@ -579,12 +579,12 @@ int conn_process_packet2(struct conn *conn, uint8_t * packet, int len,
|
||||
|
||||
int preamble = cw_get_hdr_preamble(packet);
|
||||
|
||||
if ((preamble & 0xf0) != (CW_VERSION << 4)) {
|
||||
if ((preamble & 0xf0) != (CAPWAP_VERSION << 4)) {
|
||||
/* wrong version */
|
||||
cw_dbg(DBG_PKT_ERR,
|
||||
"Discarding packet from %s, wrong version, version=%d, version %d expected.",
|
||||
sock_addr2str(&conn->addr), (preamble & 0xf0) >> 4,
|
||||
CW_VERSION);
|
||||
CAPWAP_VERSION);
|
||||
errno = EAGAIN;
|
||||
return -1;
|
||||
}
|
||||
|
24
src/cw/cw.h
24
src/cw/cw.h
@ -89,16 +89,16 @@
|
||||
#define cw_get_hdr_rmac_size(th) cw_get_hdr_rmac_len(th)
|
||||
#define cw_get_hdr_rmac_data(th) (th+9)
|
||||
|
||||
#define cw_get_hdr_flag_r1(th) ((ntohl( *((uint32_t*)th)) & CW_FLAG_HDR_R1 ) ? 1:0)
|
||||
#define cw_get_hdr_flag_r2(th) ((ntohl( *((uint32_t*)th)) & CW_FLAG_HDR_R2 ) ? 1:0)
|
||||
#define cw_get_hdr_flag_r3(th) ((ntohl( *((uint32_t*)th)) & CW_FLAG_HDR_R3 ) ? 1:0)
|
||||
#define cw_get_hdr_flag_r1(th) ((ntohl( *((uint32_t*)th)) & CAPWAP_FLAG_HDR_R1 ) ? 1:0)
|
||||
#define cw_get_hdr_flag_r2(th) ((ntohl( *((uint32_t*)th)) & CAPWAP_FLAG_HDR_R2 ) ? 1:0)
|
||||
#define cw_get_hdr_flag_r3(th) ((ntohl( *((uint32_t*)th)) & CAPWAP_FLAG_HDR_R3 ) ? 1:0)
|
||||
|
||||
#define cw_get_hdr_flag_k(th) ((ntohl( *((uint32_t*)th)) & CW_FLAG_HDR_K ) ? 1:0)
|
||||
#define cw_get_hdr_flag_m(th) ((ntohl( *((uint32_t*)th)) & CW_FLAG_HDR_M ) ? 1:0)
|
||||
#define cw_get_hdr_flag_w(th) ((ntohl( *((uint32_t*)th)) & CW_FLAG_HDR_W ) ? 1:0)
|
||||
#define cw_get_hdr_flag_l(th) ((ntohl( *((uint32_t*)th)) & CW_FLAG_HDR_L ) ? 1:0)
|
||||
#define cw_get_hdr_flag_f(th) ((ntohl( *((uint32_t*)th)) & CW_FLAG_HDR_F ) ? 1:0)
|
||||
#define cw_get_hdr_flag_t(th) ((ntohl( *((uint32_t*)th)) & CW_FLAG_HDR_T ) ? 1:0)
|
||||
#define cw_get_hdr_flag_k(th) ((ntohl( *((uint32_t*)th)) & CAPWAP_FLAG_HDR_K ) ? 1:0)
|
||||
#define cw_get_hdr_flag_m(th) ((ntohl( *((uint32_t*)th)) & CAPWAP_FLAG_HDR_M ) ? 1:0)
|
||||
#define cw_get_hdr_flag_w(th) ((ntohl( *((uint32_t*)th)) & CAPWAP_FLAG_HDR_W ) ? 1:0)
|
||||
#define cw_get_hdr_flag_l(th) ((ntohl( *((uint32_t*)th)) & CAPWAP_FLAG_HDR_L ) ? 1:0)
|
||||
#define cw_get_hdr_flag_f(th) ((ntohl( *((uint32_t*)th)) & CAPWAP_FLAG_HDR_F ) ? 1:0)
|
||||
#define cw_get_hdr_flag_t(th) ((ntohl( *((uint32_t*)th)) & CAPWAP_FLAG_HDR_T ) ? 1:0)
|
||||
|
||||
/**
|
||||
* Get length wireless specific data
|
||||
@ -196,7 +196,7 @@ static inline void cw_set_hdr_rid(uint8_t * th, int rid)
|
||||
#define cw_set_hdr_flags(th,flags,set) \
|
||||
( set ? ((*((uint32_t*)th)) |= htonl(flags)) : ((*((uint32_t*)th)) &= (0xffffffff^htonl(flags))) )
|
||||
|
||||
#define cw_set_hdr_flag_f(th,set) cw_set_hdr_flag(th, CW_FLAG_HDR_F)
|
||||
#define cw_set_hdr_flag_f(th,set) cw_set_hdr_flag(th, CAPWAP_FLAG_HDR_F)
|
||||
|
||||
|
||||
|
||||
@ -267,13 +267,13 @@ static inline int cw_get_hdr_msg_total_len(uint8_t * rawmsg)
|
||||
static inline int cw_set_hdr_rmac(uint8_t * th, bstr_t rmac)
|
||||
{
|
||||
if (!rmac) {
|
||||
cw_set_hdr_flags(th, CW_FLAG_HDR_M, 0);
|
||||
cw_set_hdr_flags(th, CAPWAP_FLAG_HDR_M, 0);
|
||||
cw_set_hdr_hlen(th, 2);
|
||||
return 0;
|
||||
}
|
||||
int rmac_len = bstr_len(rmac);
|
||||
memcpy(cw_get_hdr_rmac(th), rmac, rmac_len + 1);
|
||||
cw_set_hdr_flags(th, CW_FLAG_HDR_M, 1);
|
||||
cw_set_hdr_flags(th, CAPWAP_FLAG_HDR_M, 1);
|
||||
|
||||
int hlen = 4 + rmac_len / 4;
|
||||
|
||||
|
@ -62,7 +62,7 @@ int cw_in_capwap_control_ip_address(struct conn *conn, struct cw_action_in *a,
|
||||
struct sockaddr_in addr;
|
||||
memcpy(&addr.sin_addr,data,4);
|
||||
addr.sin_family=AF_INET;
|
||||
sock_setport((struct sockaddr*)&addr,CW_CONTROL_PORT);
|
||||
sock_setport((struct sockaddr*)&addr,CAPWAP_CONTROL_PORT);
|
||||
memcpy(&acip->ip,&addr,sizeof(addr));
|
||||
acip->index = cw_get_word(data+4);
|
||||
}
|
||||
@ -72,7 +72,7 @@ int cw_in_capwap_control_ip_address(struct conn *conn, struct cw_action_in *a,
|
||||
memset (&addr,0,sizeof(addr));
|
||||
memcpy(&addr.sin6_addr,data,16);
|
||||
addr.sin6_family=AF_INET6;
|
||||
sock_setport((struct sockaddr*)&addr,CW_CONTROL_PORT);
|
||||
sock_setport((struct sockaddr*)&addr,CAPWAP_CONTROL_PORT);
|
||||
memcpy(&acip->ip,&addr,sizeof(addr));
|
||||
acip->index = cw_get_word(data+16);
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ int cw_in_radio_generic(struct conn *conn, struct cw_action_in *a, uint8_t * dat
|
||||
mbag_t radio = mbag_i_get_mbag(conn->radios, rid, NULL);
|
||||
if (!radio) {
|
||||
if (a->vendor_id != 0
|
||||
|| ( (a->vendor_id == 0) && (a->msg_id != CW_MSG_DISCOVERY_REQUEST
|
||||
|| ( (a->vendor_id == 0) && (a->msg_id != CAPWAP_MSG_DISCOVERY_REQUEST
|
||||
&& a->msg_id != CW_MSG_JOIN_REQUEST) )) {
|
||||
cw_dbg(DBG_ELEM_ERR, "Radio not found %d", rid);
|
||||
return 0;
|
||||
|
@ -16,7 +16,7 @@ uint8_t *cw_init_data_keep_alive_msg(uint8_t * buffer,uint8_t *rmac)
|
||||
|
||||
cw_set_hdr_rmac(buffer, rmac);
|
||||
|
||||
cw_set_hdr_flags(buffer, CW_FLAG_HDR_K,1);
|
||||
cw_set_hdr_flags(buffer, CAPWAP_FLAG_HDR_K,1);
|
||||
|
||||
return cw_get_hdr_payload_ptr(buffer);
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ void cw_init_response(struct conn * conn, uint8_t *req)
|
||||
int dhbytes;
|
||||
memcpy(buffer,req,shbytes);
|
||||
cw_set_hdr_hlen(buffer,2);
|
||||
cw_set_hdr_flags(buffer,CW_FLAG_HDR_M,1);
|
||||
cw_set_hdr_flags(buffer,CAPWAP_FLAG_HDR_M,1);
|
||||
dhbytes = cw_get_hdr_msg_offset(buffer);
|
||||
|
||||
uint8_t * msgptr = req+shbytes;
|
||||
|
@ -168,7 +168,7 @@ uint8_t * fragman_add(frag_t * frags, uint8_t *packet, int hlen, int payloadlen)
|
||||
f->bytesreceived+=payloadlen;
|
||||
}
|
||||
|
||||
if (val0 & CW_FLAG_HDR_L){
|
||||
if (val0 & CAPWAP_FLAG_HDR_L){
|
||||
f->bytesneeded=dst+payloadlen;
|
||||
}
|
||||
|
||||
|
@ -202,7 +202,7 @@ int netconn_send_capwap_msg(struct netconn * nc, uint8_t *rawmsg, int msglen)
|
||||
int mtu = 1400;
|
||||
|
||||
while (msglen>mtu){
|
||||
cw_set_hdr_flags(rawmsg,CW_FLAG_HDR_F,1);
|
||||
cw_set_hdr_flags(rawmsg,CAPWAP_FLAG_HDR_F,1);
|
||||
cw_put_dword(ptr+4, nc->fragid<<16 | fragoffset<<3 );
|
||||
|
||||
cw_dbg_pkt_nc(DBG_PKT_OUT,nc,ptr,mtu,(struct sockaddr*)&nc->addr);
|
||||
@ -219,9 +219,9 @@ int netconn_send_capwap_msg(struct netconn * nc, uint8_t *rawmsg, int msglen)
|
||||
|
||||
|
||||
if (fragoffset)
|
||||
cw_set_hdr_flags(rawmsg,CW_FLAG_HDR_F | CW_FLAG_HDR_L,1);
|
||||
cw_set_hdr_flags(rawmsg,CAPWAP_FLAG_HDR_F | CAPWAP_FLAG_HDR_L,1);
|
||||
else
|
||||
cw_set_hdr_flags(rawmsg,CW_FLAG_HDR_F,0);
|
||||
cw_set_hdr_flags(rawmsg,CAPWAP_FLAG_HDR_F,0);
|
||||
|
||||
cw_put_dword(ptr+4, nc->fragid<<16 | fragoffset<<3 );
|
||||
|
||||
@ -248,12 +248,12 @@ int netconn_process_packet(struct netconn *nc, uint8_t * packet, int len,
|
||||
|
||||
int preamble = cw_get_hdr_preamble(packet);
|
||||
|
||||
if ((preamble & 0xf0) != (CW_VERSION << 4)) {
|
||||
if ((preamble & 0xf0) != (CAPWAP_VERSION << 4)) {
|
||||
/* wrong version */
|
||||
cw_dbg(DBG_PKT_ERR,
|
||||
"Discarding packet from %s, wrong version, version=%d, version %d expected.",
|
||||
sock_addr2str(&nc->addr), (preamble & 0xf0) >> 4,
|
||||
CW_VERSION);
|
||||
CAPWAP_VERSION);
|
||||
errno = EAGAIN;
|
||||
return -1;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ cw_dbg(DBG_X,"Here is a conn_send_msg for anything");
|
||||
int mtu = conn->mtu;
|
||||
|
||||
while (packetlen>mtu){
|
||||
cw_set_hdr_flags(rawmsg,CW_FLAG_HDR_F,1);
|
||||
cw_set_hdr_flags(rawmsg,CAPWAP_FLAG_HDR_F,1);
|
||||
cw_put_dword(ptr+4, conn->fragid<<16 | fragoffset<<3 );
|
||||
|
||||
cw_dbg_pkt(DBG_PKT_OUT,conn,ptr,mtu,(struct sockaddr*)&conn->addr);
|
||||
@ -54,9 +54,9 @@ cw_dbg(DBG_X,"Here is a conn_send_msg for anything");
|
||||
|
||||
|
||||
if (fragoffset)
|
||||
cw_set_hdr_flags(rawmsg,CW_FLAG_HDR_F | CW_FLAG_HDR_L,1);
|
||||
cw_set_hdr_flags(rawmsg,CAPWAP_FLAG_HDR_F | CAPWAP_FLAG_HDR_L,1);
|
||||
else
|
||||
cw_set_hdr_flags(rawmsg,CW_FLAG_HDR_F,0);
|
||||
cw_set_hdr_flags(rawmsg,CAPWAP_FLAG_HDR_F,0);
|
||||
|
||||
cw_put_dword(ptr+4, conn->fragid<<16 | fragoffset<<3 );
|
||||
|
||||
@ -83,7 +83,7 @@ int conn_send_data_msg(struct conn * conn, uint8_t *rawmsg,int len)
|
||||
int mtu = conn->mtu;
|
||||
|
||||
while (packetlen>mtu){
|
||||
cw_set_hdr_flags(rawmsg,CW_FLAG_HDR_F,1);
|
||||
cw_set_hdr_flags(rawmsg,CAPWAP_FLAG_HDR_F,1);
|
||||
cw_put_dword(ptr+4, conn->fragid<<16 | fragoffset<<3 );
|
||||
|
||||
cw_dbg_pkt(DBG_PKT_OUT,conn,ptr,mtu,(struct sockaddr*)&conn->addr);
|
||||
@ -101,9 +101,9 @@ int conn_send_data_msg(struct conn * conn, uint8_t *rawmsg,int len)
|
||||
|
||||
|
||||
if (fragoffset)
|
||||
cw_set_hdr_flags(rawmsg,CW_FLAG_HDR_F | CW_FLAG_HDR_L,1);
|
||||
cw_set_hdr_flags(rawmsg,CAPWAP_FLAG_HDR_F | CAPWAP_FLAG_HDR_L,1);
|
||||
else
|
||||
cw_set_hdr_flags(rawmsg,CW_FLAG_HDR_F,0);
|
||||
cw_set_hdr_flags(rawmsg,CAPWAP_FLAG_HDR_F,0);
|
||||
|
||||
cw_put_dword(ptr+4, conn->fragid<<16 | fragoffset<<3 );
|
||||
|
||||
|
@ -34,7 +34,7 @@ static cw_action_in_t actions_in[] = {
|
||||
*/
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.end = cw_in_check_disc_req
|
||||
}
|
||||
,
|
||||
@ -42,7 +42,7 @@ static cw_action_in_t actions_in[] = {
|
||||
/* Element Discovery Type */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_DISCOVERY_TYPE,
|
||||
.start = cw_in_generic2,
|
||||
.item_id = "discovery_type",
|
||||
@ -55,7 +55,7 @@ static cw_action_in_t actions_in[] = {
|
||||
/* Element WTP Board Data - Discovery Request */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_WTP_BOARD_DATA,
|
||||
.start = cw_in_wtp_board_data,
|
||||
.item_id = CW_ITEM_WTP_BOARD_DATA,
|
||||
@ -66,7 +66,7 @@ static cw_action_in_t actions_in[] = {
|
||||
/* Element WTP Descriptor - Discovery */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_WTP_DESCRIPTOR,
|
||||
.start = capwap_in_wtp_descriptor,
|
||||
.item_id = "wtp_descriptor",
|
||||
@ -78,7 +78,7 @@ static cw_action_in_t actions_in[] = {
|
||||
/* Element WTP Frame Tunnel Mode */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_WTP_FRAME_TUNNEL_MODE,
|
||||
.start = cw_in_generic2,
|
||||
.item_id = CW_ITEM_WTP_FRAME_TUNNEL_MODE,
|
||||
@ -91,7 +91,7 @@ static cw_action_in_t actions_in[] = {
|
||||
/* Element WTP Mac Type */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_WTP_MAC_TYPE,
|
||||
.start = cw_in_generic2,
|
||||
.item_id = CW_ITEM_WTP_MAC_TYPE,
|
||||
@ -104,7 +104,7 @@ static cw_action_in_t actions_in[] = {
|
||||
/* MTU Discovery Padding */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_MTU_DISCOVERY_PADDING,
|
||||
.start = cw_in_mtu_discovery_padding,
|
||||
}
|
||||
@ -113,7 +113,7 @@ static cw_action_in_t actions_in[] = {
|
||||
/* Vendor Specific Payload */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_VENDOR_SPECIFIC_PAYLOAD,
|
||||
.start = cw_in_vendor_specific_payload,
|
||||
.min_len=7
|
||||
@ -550,7 +550,7 @@ static cw_action_out_t actions_out[]={
|
||||
|
||||
/* AC Descriptor - Discovery Response */
|
||||
{
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||
.item_id = CW_ITEM_AC_DESCRIPTOR,
|
||||
.elem_id = CW_ELEM_AC_DESCRIPTOR,
|
||||
.out = capwap_out_ac_descriptor,
|
||||
@ -560,7 +560,7 @@ static cw_action_out_t actions_out[]={
|
||||
|
||||
/* AC Name - Discovery Response */
|
||||
{
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||
.elem_id = CW_ELEM_AC_NAME,
|
||||
.item_id = CW_ITEM_AC_NAME,
|
||||
.out = cw_out_generic,
|
||||
@ -575,7 +575,7 @@ static cw_action_out_t actions_out[]={
|
||||
* of .elem_id isn't needed.
|
||||
*/
|
||||
{
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||
.item_id = CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST,
|
||||
.out = cw_out_capwap_control_ip_addr_list,
|
||||
.get = cw_out_get_outgoing,
|
||||
|
@ -11,7 +11,7 @@ static cw_action_in_t actions_in[] = {
|
||||
/* Message Discovery Response */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||
.end = cw_in_check_disc_resp
|
||||
}
|
||||
,
|
||||
@ -19,7 +19,7 @@ static cw_action_in_t actions_in[] = {
|
||||
/* AC Descriptor - Discovery Response */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||
.elem_id = CW_ELEM_AC_DESCRIPTOR,
|
||||
.item_id = CW_ITEM_AC_DESCRIPTOR,
|
||||
.start = cw_in_ac_descriptor,
|
||||
@ -32,7 +32,7 @@ static cw_action_in_t actions_in[] = {
|
||||
/* AC Name - Discovery Response */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||
.elem_id = CW_ELEM_AC_NAME,
|
||||
.item_id = CW_ITEM_AC_NAME,
|
||||
.start = cw_in_generic2,
|
||||
@ -45,7 +45,7 @@ static cw_action_in_t actions_in[] = {
|
||||
/* CAPWAP Control IPv4 Address - Discovery Response*/
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||
.elem_id = CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS,
|
||||
.item_id = CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST,
|
||||
.start = cw_in_capwap_control_ip_address,
|
||||
@ -59,7 +59,7 @@ static cw_action_in_t actions_in[] = {
|
||||
/* CAPWAP Control IPv6 Address - Discovery Response*/
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||
.elem_id = CW_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS,
|
||||
.item_id = CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST,
|
||||
.start = cw_in_capwap_control_ip_address, // Change to v6 handler
|
||||
@ -72,7 +72,7 @@ static cw_action_in_t actions_in[] = {
|
||||
/* Vendor Specific Payload - Discovery Response*/
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||
.elem_id = CW_ELEM_VENDOR_SPECIFIC_PAYLOAD,
|
||||
.start = cw_in_vendor_specific_payload
|
||||
}
|
||||
@ -86,7 +86,7 @@ static cw_action_in_t actions_in[] = {
|
||||
* of Discovery Response
|
||||
*/
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||
.elem_id = CW_ELEM_RESULT_CODE,
|
||||
.item_id = CW_ITEM_RESULT_CODE,
|
||||
.start = cw_in_generic2,
|
||||
@ -450,7 +450,7 @@ static cw_action_out_t actions_out[] = {
|
||||
|
||||
/* Discovery Type - Discovery Request */
|
||||
{
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_DISCOVERY_TYPE,
|
||||
.item_id = CW_ITEM_DISCOVERY_TYPE,
|
||||
.out = cw_out_generic,
|
||||
@ -461,7 +461,7 @@ static cw_action_out_t actions_out[] = {
|
||||
|
||||
/* WTP Board Data - Discovery Request */
|
||||
{
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_WTP_BOARD_DATA,
|
||||
.item_id = CW_ITEM_WTP_BOARD_DATA,
|
||||
.out = cw_out_wtp_board_data,
|
||||
@ -472,7 +472,7 @@ static cw_action_out_t actions_out[] = {
|
||||
|
||||
/* WTP Descriptor - Discover Request */
|
||||
{
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_WTP_DESCRIPTOR,
|
||||
.item_id = CW_ITEM_WTP_DESCRIPTOR,
|
||||
.out = capwap_out_wtp_descriptor,
|
||||
@ -484,7 +484,7 @@ static cw_action_out_t actions_out[] = {
|
||||
|
||||
/* WTP Frame TunnelMode - Discovery Request */
|
||||
{
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_WTP_FRAME_TUNNEL_MODE,
|
||||
.item_id = CW_ITEM_WTP_FRAME_TUNNEL_MODE,
|
||||
.out = cw_out_generic,
|
||||
@ -495,7 +495,7 @@ static cw_action_out_t actions_out[] = {
|
||||
|
||||
/* WTP Mac Type - Discovery Request */
|
||||
{
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_WTP_MAC_TYPE,
|
||||
.item_id = CW_ITEM_WTP_MAC_TYPE,
|
||||
.out = cw_out_generic,
|
||||
|
@ -28,7 +28,7 @@ static cw_action_in_t actions_ac_in[] = {
|
||||
/* 802.11 Radio Information - Discovery Request */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM80211_WTP_RADIO_INFORMATION,
|
||||
.item_id = CW_RADIOITEM80211_WTP_RADIO_INFORMATION,
|
||||
.start = cw_in_radio_generic,
|
||||
@ -103,7 +103,7 @@ cw_action_out_t actions_ac_out[]={
|
||||
|
||||
/* 802.11 Radio Information - Discovery Response */
|
||||
{
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||
.elem_id = CW_ELEM80211_WTP_RADIO_INFORMATION,
|
||||
.item_id = CW_RADIOITEM80211_WTP_RADIO_INFORMATION ,
|
||||
.out = cw_out_radio_infos,
|
||||
|
@ -20,7 +20,7 @@ static cw_action_in_t actions_wtp_in[] = {
|
||||
/* 802.11 Radio Inmformation - Discovery Response */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||
.elem_id = CW_ELEM80211_WTP_RADIO_INFORMATION,
|
||||
.item_id = CW_RADIOITEM80211_WTP_RADIO_INFORMATION,
|
||||
// .start = cw_in_radio_generic,
|
||||
@ -72,7 +72,7 @@ cw_action_out_t actions_out[]={
|
||||
|
||||
/* 802.11 Radio Information - Discovery Request */
|
||||
{
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.item_id = CW_ITEM_RADIO_INFOS ,
|
||||
.elem_id = CW_ELEM80211_WTP_RADIO_INFORMATION,
|
||||
.out = cw_out_radio_infos,
|
||||
|
@ -31,8 +31,8 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
|
||||
return 0;
|
||||
|
||||
int wbid = cw_get_hdr_wbid(rawmsg);
|
||||
if (wbid != CW_WBID_IEEE80211 ) {
|
||||
cw_dbg(DBG_MOD,"CAPWAP80211 detected: no, my wbid=%d, remote wbid=%d",CW_WBID_IEEE80211,wbid);
|
||||
if (wbid != CAPWAP_WBID_IEEE80211 ) {
|
||||
cw_dbg(DBG_MOD,"CAPWAP80211 detected: no, my wbid=%d, remote wbid=%d",CAPWAP_WBID_IEEE80211,wbid);
|
||||
return 0;
|
||||
}
|
||||
cw_dbg(DBG_MOD,"CAPWAP80211 detected: yes");
|
||||
|
@ -51,7 +51,7 @@ static cw_action_in_t actions_in[] = {
|
||||
/* Message Discovery Request */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.end = cw_in_check_disc_req
|
||||
}
|
||||
,
|
||||
@ -59,7 +59,7 @@ static cw_action_in_t actions_in[] = {
|
||||
/* Element WTP Descriptor */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_WTP_DESCRIPTOR,
|
||||
.start = cisco_in_wtp_descriptor,
|
||||
.item_id = "wtp_descriptor",
|
||||
@ -70,7 +70,7 @@ static cw_action_in_t actions_in[] = {
|
||||
/* Element Cisco RAD Name */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.vendor_id = CW_VENDOR_ID_CISCO,
|
||||
.elem_id = CW_CISCO_RAD_NAME,
|
||||
.start=cw_in_generic2,
|
||||
@ -87,7 +87,7 @@ static cw_action_in_t actions_in[] = {
|
||||
*/
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_WTP_BOARD_DATA,
|
||||
.start = cw_in_wtp_board_data,
|
||||
.item_id = CW_ITEM_WTP_BOARD_DATA,
|
||||
@ -326,7 +326,7 @@ static cw_action_out_t actions_out[]={
|
||||
|
||||
/* AC Descriptor - Discovery Response */
|
||||
{
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||
.item_id = CW_ITEM_AC_DESCRIPTOR,
|
||||
.elem_id = CW_ELEM_AC_DESCRIPTOR,
|
||||
.out = cisco_out_ac_descriptor,
|
||||
@ -339,7 +339,7 @@ static cw_action_out_t actions_out[]={
|
||||
* Important to get the WTP a DTLS connection established
|
||||
*/
|
||||
{
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||
.item_id = CW_ITEM_AC_TIMESTAMP,
|
||||
.vendor_id = CW_VENDOR_ID_CISCO,
|
||||
.elem_id = CW_CISCO_AP_TIMESYNC,
|
||||
@ -504,7 +504,7 @@ static cw_action_in_t actions80211_in[] = {
|
||||
so make it non-mandatory */
|
||||
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM80211_WTP_RADIO_INFORMATION,
|
||||
.item_id = CW_RADIOITEM80211_WTP_RADIO_INFORMATION,
|
||||
.start = cw_in_radio_generic,
|
||||
|
@ -47,7 +47,7 @@ static cw_action_in_t actions_in[] = {
|
||||
/* AC Descriptor - Discovery Response */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||
.elem_id = CW_ELEM_AC_DESCRIPTOR,
|
||||
.item_id = CW_ITEM_AC_DESCRIPTOR,
|
||||
.start = cisco_in_ac_descriptor,
|
||||
@ -268,7 +268,7 @@ static cw_action_out_t actions_out[]={
|
||||
|
||||
/* WTP Descriptor - Discovery */
|
||||
{
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_WTP_DESCRIPTOR,
|
||||
.item_id = CW_ITEM_WTP_DESCRIPTOR,
|
||||
.out = cisco_out_wtp_descriptor,
|
||||
@ -279,7 +279,7 @@ static cw_action_out_t actions_out[]={
|
||||
|
||||
/* Cisco RAD Name (WTP Name) - Discovery */
|
||||
{
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.vendor_id = CW_VENDOR_ID_CISCO,
|
||||
.elem_id = CW_CISCO_RAD_NAME,
|
||||
.item_id = CW_ITEM_WTP_NAME,
|
||||
|
@ -40,7 +40,7 @@ static cw_action_in_t actions_in[] = {
|
||||
/* Message Discovery Request */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.end = cw_in_check_disc_req
|
||||
}
|
||||
,
|
||||
@ -48,7 +48,7 @@ static cw_action_in_t actions_in[] = {
|
||||
/* Element WTP Descriptor */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_WTP_DESCRIPTOR,
|
||||
.start = cisco_in_wtp_descriptor,
|
||||
.item_id = "wtp_descriptor",
|
||||
@ -59,7 +59,7 @@ static cw_action_in_t actions_in[] = {
|
||||
/* Element Cisco RAD Name */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.vendor_id = CW_VENDOR_ID_CISCO,
|
||||
.elem_id = CW_CISCO_RAD_NAME,
|
||||
.start=cw_in_generic2,
|
||||
@ -182,7 +182,7 @@ static cw_action_out_t actions_out[]={
|
||||
* Important to get the WTP a DTLS connection established
|
||||
*/
|
||||
{
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||
.item_id = CW_ITEM_AC_TIMESTAMP,
|
||||
.vendor_id = CW_VENDOR_ID_CISCO,
|
||||
.elem_id = CW_CISCO_AP_TIMESYNC,
|
||||
@ -192,7 +192,7 @@ static cw_action_out_t actions_out[]={
|
||||
,
|
||||
/* AC Descriptor - Discovery Response */
|
||||
{
|
||||
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||
.item_id = CW_ITEM_AC_DESCRIPTOR,
|
||||
.elem_id = CW_ELEM_AC_DESCRIPTOR,
|
||||
.out = cisco_out_ac_descriptor,
|
||||
@ -250,7 +250,7 @@ static cw_action_in_t actions80211_in[] = {
|
||||
so make it non-mandatory */
|
||||
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.msg_id = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM80211_WTP_RADIO_INFORMATION,
|
||||
.item_id = "radio_information",
|
||||
.start = cw_in_radio_generic,
|
||||
|
@ -124,10 +124,10 @@ static int run_discovery(struct conn *conn)
|
||||
|
||||
conn->capwap_state = CW_STATE_DISCOVERY;
|
||||
mbag_set_byte(conn->outgoing, CW_ITEM_DISCOVERY_TYPE,
|
||||
CW_DISCOVERY_TYPE_UNKNOWN);
|
||||
CAPWAP_DISCOVERY_TYPE_UNKNOWN);
|
||||
|
||||
|
||||
cw_init_request(conn, CW_MSG_DISCOVERY_REQUEST);
|
||||
cw_init_request(conn, CAPWAP_MSG_DISCOVERY_REQUEST);
|
||||
cw_put_msg(conn, conn->req_buffer);
|
||||
conn_send_msg(conn, conn->req_buffer);
|
||||
|
||||
|
@ -209,7 +209,7 @@ int wtpconf_ac_list()
|
||||
|
||||
int wtpconf_preinit()
|
||||
{
|
||||
conf_control_port=strdup(CW_CONTROL_PORT_STR);
|
||||
conf_control_port=strdup(CAPWAP_CONTROL_PORT_STR);
|
||||
conf_dtls_cipher=strdup(CONF_DEFAULT_DTLS_CIPHER);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user