Initial commit
FossilOrigin-Name: 4daaf3b7829f4336c9515b9d55e1fd1c8f11f1416c7c69f2c4f55fb528d00ba0
This commit is contained in:
parent
a7dbeb049a
commit
8f325f2f6f
31
src/mod/Mod.mak
Normal file
31
src/mod/Mod.mak
Normal file
@ -0,0 +1,31 @@
|
||||
include ../../Macros.mak
|
||||
include ../../Config.mak
|
||||
|
||||
|
||||
OBJS:=$(patsubst %.o,$(ARCH)/%.o,$(OBJS))
|
||||
|
||||
|
||||
CFLAGS = -Wall -g -O0 -D_REENTRANT -DWITH_IPV6 -DWITH_RMAC_SUPPORT -I ../../ -I../
|
||||
|
||||
LIBDIR=../../lib/$(ARCH)
|
||||
|
||||
SRCS = $(OBJS:.o=.c)
|
||||
|
||||
$(ARCH)/%.o:%.c
|
||||
@mkdir -p $(ARCH)
|
||||
@echo " CC "$<
|
||||
@$(CC) -c $(CFLAGS) $< -o $@
|
||||
|
||||
|
||||
$(LIBDIR)/$(NAME) : $(OBJS) $(MODOBJS)
|
||||
@mkdir -p $(LIBDIR)
|
||||
@echo " AR $(LIBDIR)/$(NAME)"
|
||||
@$(AR) rcs $(LIBDIR)/$(NAME) $(OBJS) $(MODOBJS)
|
||||
|
||||
|
||||
all: $(LIBDIR)/$(NAME)
|
||||
|
||||
clean:
|
||||
rm -rf $(ARCH)
|
||||
rm -f $(LIBDIR)/$(NAME)
|
||||
|
10
src/mod/cisco/Makefile
Normal file
10
src/mod/cisco/Makefile
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
OBJS=\
|
||||
mod_cisco_ac.o \
|
||||
cisco_actions_ac.o \
|
||||
|
||||
NAME=libcisco.a
|
||||
|
||||
include ../Mod.mak
|
||||
|
||||
|
155
src/mod/cisco/capwap.h
Normal file
155
src/mod/cisco/capwap.h
Normal file
@ -0,0 +1,155 @@
|
||||
/*
|
||||
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/>.
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief Definitions for CAPWAP
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef __CAPWAPMSG_H
|
||||
#define __CAPWAPMSG_H
|
||||
|
||||
/**
|
||||
*@addtogroup CAPWAPConstants
|
||||
*@{
|
||||
*/
|
||||
|
||||
/**
|
||||
* CAPWAP message types as defined in RFC 5416
|
||||
*/
|
||||
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,
|
||||
|
||||
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
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* CAPWAP message elements as defined in RFC 5415
|
||||
*/
|
||||
|
||||
|
||||
#define CW_ELEM_AC_DESCRIPTOR 1
|
||||
#define CW_ELEM_AC_IPV4_LIST 2
|
||||
#define CW_ELEM_AC_IPV6_LIST 3
|
||||
#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_TIMESTAMP 6
|
||||
#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
|
||||
#define CW_ELEM_CAPWAP_TRANSPORT_PROTOCOL 51 /* not in draft 7 */
|
||||
#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
|
||||
#define CW_ELEM_RESERVED_19 19
|
||||
#define CW_ELEM_DISCOVERY_TYPE 20
|
||||
#define CW_ELEM_DUPLICATE_IPV4_ADDRESS 21
|
||||
#define CW_ELEM_DUPLICATE_IPV6_ADRESS 22
|
||||
#define CWMSGELEM_ECN_SUPPORT 53
|
||||
#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
|
||||
#define CW_ELEM_LOCATION_DATA 28
|
||||
#define CW_ELEM_MAXIMUM_MESSAGE_LENGTH 29
|
||||
#define CWMSGELEM_MTU_DISCOVERY_PADDING 52
|
||||
#define CW_ELEM_RADIO_ADMINISTRATIVE_STATE 31
|
||||
#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
|
||||
#define CW_ELEM_VENDOR_SPECIFIC_PAYLOAD 37
|
||||
#define CW_ELEM_WTP_BOARD_DATA 38
|
||||
#define CW_ELEM_WTP_DESCRIPTOR 39
|
||||
#define CW_ELEM_WTP_FALLBACK 40
|
||||
#define CW_ELEM_WTP_FRAME_TUNNEL_MODE 41
|
||||
#define CW_ELEM_RESERVED_42 42
|
||||
#define CW_ELEM_RESERVED_43 43
|
||||
#define CW_ELEM_WTP_MAC_TYPE 44
|
||||
#define CW_ELEM_WTP_NAME 45
|
||||
#define CW_ELEM_RESERVED_46 46
|
||||
#define CW_ELEM_WTP_RADIO_STATISTICS 47
|
||||
#define CW_ELEM_WTP_REBOOT_STATISTICS 48
|
||||
#define CW_ELEM_WTP_STATIC_IP_ADDRESS_INFORMATION 49
|
||||
#define CW_ELEM_WTP_STATIC_IP_ADDR_INFO 49
|
||||
|
||||
|
||||
/* Cisco's CAPWAP definitions (CAPWAP draft 7) */
|
||||
#define CW_ELEM_WTP_IPV4_IP_ADDRESS 42
|
||||
#define CW_ELEM_WTP_IPV6_IP_ADDRESS 43
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
159
src/mod/cisco/capwap.h.x
Normal file
159
src/mod/cisco/capwap.h.x
Normal file
@ -0,0 +1,159 @@
|
||||
/*
|
||||
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/>.
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief CAPWAP desfinitions
|
||||
*/
|
||||
|
||||
#ifndef __CAPWAPMSG_H
|
||||
#define __CAPWAPMSG_H
|
||||
|
||||
|
||||
/**
|
||||
*@addtogroup CAPWAPConstants
|
||||
*@{
|
||||
*/
|
||||
|
||||
/**
|
||||
* CAPWAP message types as defined in RFC 5416
|
||||
*/
|
||||
enum capwap_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,
|
||||
|
||||
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;
|
||||
|
||||
/**@}*/
|
||||
|
||||
|
||||
/**
|
||||
* CAPWAP message elements as defined in RFC 5415
|
||||
*/
|
||||
|
||||
|
||||
#define CW_ELEM_AC_DESCRIPTOR 1
|
||||
#define CW_ELEM_AC_IPV4_LIST 2
|
||||
#define CW_ELEM_AC_IPV6_LIST 3
|
||||
#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_TIMESTAMP 6
|
||||
#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
|
||||
#define CW_ELEM_CAPWAP_TRANSPORT_PROTOCOL 51 /* not in draft 7 */
|
||||
#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
|
||||
#define CW_ELEM_RESERVED_19 19
|
||||
#define CW_ELEM_DISCOVERY_TYPE 20
|
||||
#define CW_ELEM_DUPLICATE_IPV4_ADDRESS 21
|
||||
#define CW_ELEM_DUPLICATE_IPV6_ADRESS 22
|
||||
#define CWMSGELEM_ECN_SUPPORT 53
|
||||
#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
|
||||
#define CW_ELEM_LOCATION_DATA 28
|
||||
#define CW_ELEM_MAXIMUM_MESSAGE_LENGTH 29
|
||||
#define CWMSGELEM_MTU_DISCOVERY_PADDING 52
|
||||
#define CW_ELEM_RADIO_ADMINISTRATIVE_STATE 31
|
||||
#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
|
||||
#define CW_ELEM_VENDOR_SPECIFIC_PAYLOAD 37
|
||||
#define CW_ELEM_WTP_BOARD_DATA 38
|
||||
#define CW_ELEM_WTP_DESCRIPTOR 39
|
||||
#define CW_ELEM_WTP_FALLBACK 40
|
||||
#define CW_ELEM_WTP_FRAME_TUNNEL_MODE 41
|
||||
#define CW_ELEM_RESERVED_42 42
|
||||
#define CW_ELEM_RESERVED_43 43
|
||||
#define CW_ELEM_WTP_MAC_TYPE 44
|
||||
#define CW_ELEM_WTP_NAME 45
|
||||
#define CW_ELEM_RESERVED_46 46
|
||||
#define CW_ELEM_WTP_RADIO_STATISTICS 47
|
||||
#define CW_ELEM_WTP_REBOOT_STATISTICS 48
|
||||
#define CW_ELEM_WTP_STATIC_IP_ADDRESS_INFORMATION 49
|
||||
#define CW_ELEM_WTP_STATIC_IP_ADDR_INFO 49
|
||||
|
||||
|
||||
/* Cisco's CAPWAP definitions (CAPWAP draft 7) */
|
||||
#define CW_ELEM_WTP_IPV4_IP_ADDRESS 42
|
||||
#define CW_ELEM_WTP_IPV6_IP_ADDRESS 43
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
196
src/mod/cisco/capwap_actions.h
Normal file
196
src/mod/cisco/capwap_actions.h
Normal file
@ -0,0 +1,196 @@
|
||||
/*
|
||||
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/>.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __CAPWAP_ACTIONS_H
|
||||
#define __CAPWAP_ACTIONS_H
|
||||
|
||||
|
||||
#include "capwap/capwap.h"
|
||||
#include "capwap/capwap_items.h"
|
||||
|
||||
|
||||
#define CW_ACTION_IN_LOCATION_DATA \
|
||||
CW_ELEM_LOCATION_DATA, /* Element ID*/ \
|
||||
cw_in_generic, 0, /* start/end callback */ \
|
||||
MBAG_STR, /* Type of element */ \
|
||||
CW_ITEM_LOCATION_DATA, /* ID to use store */ \
|
||||
1, 1024 /* min/max length */
|
||||
|
||||
|
||||
#define CW_ACTION_IN_WTP_NAME \
|
||||
CW_ELEM_WTP_NAME, /* Element ID*/ \
|
||||
cw_in_generic, 0, /* start/end callback */ \
|
||||
MBAG_STR, /* Type of element */ \
|
||||
CW_ITEM_WTP_NAME, /* ID to use store */ \
|
||||
1, 1024 /* min/max length */
|
||||
|
||||
#define CW_ACTION_IN_SESSION_ID \
|
||||
CW_ELEM_SESSION_ID, /* Element ID*/ \
|
||||
cw_in_generic, 0, /* start/end callback */ \
|
||||
MBAG_BSTR, /* Type of element */ \
|
||||
CW_ITEM_SESSION_ID, /* ID to use store */ \
|
||||
16, 16 /* min/max length */
|
||||
|
||||
#define CW_ACTION_IN_IMAGE_IDENTIFIER \
|
||||
CW_ELEM_IMAGE_IDENTIFIER, /* Element ID*/ \
|
||||
cw_in_generic, 0, /* start/end callback */ \
|
||||
MBAG_VENDORSTR, /* Type of element */ \
|
||||
CW_ITEM_IMAGE_IDENTIFIER, /* ID to use store */ \
|
||||
5, 4096 /* min/max length */
|
||||
|
||||
#define CW_ACTION_IN_AC_NAME \
|
||||
CW_ELEM_AC_NAME, /* Element ID*/ \
|
||||
cw_in_generic, 0, /* start/end callback */ \
|
||||
MBAG_STR, /* Type of element */ \
|
||||
CW_ITEM_AC_NAME, /* ID to use store */ \
|
||||
1, 512 /* min/max length */
|
||||
|
||||
#define CW_ACTION_IN_STATISTICS_TIMER \
|
||||
CW_ELEM_STATISTICS_TIMER, /* Element ID*/ \
|
||||
cw_in_generic, 0, /* start/end callback */ \
|
||||
MBAG_WORD, /* Type of element */ \
|
||||
CW_ITEM_STATISTICS_TIMER, /* ID to use store */ \
|
||||
2, 2 /* min/max length */
|
||||
|
||||
#define CW_ACTION_IN_WTP_REBOOT_STATISTICS \
|
||||
CW_ELEM_WTP_REBOOT_STATISTICS, /* Element ID*/ \
|
||||
cw_in_generic, 0, /* start/end callback */ \
|
||||
MBAG_DATA, /* Type of element */ \
|
||||
CW_ITEM_WTP_REBOOT_STATISTICS, /* ID to use store */ \
|
||||
15, 15 /* min/max length */
|
||||
|
||||
|
||||
#define CW_ACTION_IN_WTP_FRAME_TUNNEL_MODE \
|
||||
CW_ELEM_WTP_FRAME_TUNNEL_MODE, /* Element ID*/ \
|
||||
cw_in_generic, 0, /* start/end callback */ \
|
||||
MBAG_BYTE, /* Type of element */ \
|
||||
CW_ITEM_WTP_FRAME_TUNNEL_MODE, /* ID to use store */ \
|
||||
1, 1 /* min/max length */
|
||||
|
||||
|
||||
#define CW_ACTION_IN_WTP_MAC_TYPE \
|
||||
CW_ELEM_WTP_MAC_TYPE, /* Element ID*/ \
|
||||
cw_in_generic, 0, /* start/end callback */ \
|
||||
MBAG_BYTE, /* Type of element */ \
|
||||
CW_ITEM_WTP_MAC_TYPE, /* ID to use store */ \
|
||||
1, 1 /* min/max length */
|
||||
|
||||
#define CW_ACTION_IN_VENDOR_SPECIFIC_PAYLOAD \
|
||||
CW_ELEM_VENDOR_SPECIFIC_PAYLOAD, /* Element ID */ \
|
||||
cw_in_vendor_specific_payload,0, /* start/end callback*/ \
|
||||
0, \
|
||||
0, \
|
||||
0,0
|
||||
|
||||
#define CW_ACTION_IN_WTP_BOARD_DATA \
|
||||
CW_ELEM_WTP_BOARD_DATA, /* Element ID */ \
|
||||
cw_in_wtp_board_data, 0, /* start/end callback */ \
|
||||
0, \
|
||||
CW_ITEM_WTP_BOARD_DATA, \
|
||||
0,0
|
||||
|
||||
#define CW_ACTION_IN_WTP_DESCRIPTOR \
|
||||
CW_ELEM_WTP_DESCRIPTOR, /* Element ID */ \
|
||||
cw_in_wtp_descriptor, 0, /* start/end callback */ \
|
||||
0, \
|
||||
CW_ITEM_WTP_DESCRIPTOR, \
|
||||
0,0
|
||||
|
||||
|
||||
#define CW_ACTION_IN_CAPWAP_CONTROL_IPV4_ADDRESS \
|
||||
CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS, /* Element ID*/ \
|
||||
cw_in_capwap_control_ipv4_address, 0, /* start/end callback */ \
|
||||
MBAG_AVLTREE, /* Type of element */ \
|
||||
CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST, /* ID to use store */ \
|
||||
6, 6 /* min/max length */
|
||||
|
||||
#define CW_ACTION_IN_CAPWAP_CONTROL_IPV6_ADDRESS \
|
||||
CW_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS, /* Element ID*/ \
|
||||
cw_in_capwap_control_ipv4_address, 0, /* start/end callback */ \
|
||||
MBAG_AVLTREE, /* Type of element */ \
|
||||
CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST, /* ID to use store */ \
|
||||
18,18 /* min/max length */
|
||||
|
||||
|
||||
|
||||
#define CW_ACTION_IN_AC_DESCRIPTOR \
|
||||
CW_ELEM_AC_DESCRIPTOR, /* Element ID*/ \
|
||||
cw_in_ac_descriptor, 0, /* start/end callback */ \
|
||||
MBAG_DATA, /* Type of element */ \
|
||||
CW_ITEM_AC_DESCRIPTOR, /* ID to use store */ \
|
||||
12, 8192 /* min/max length */
|
||||
|
||||
|
||||
#define CW_ACTION_IN_RESULT_CODE \
|
||||
CW_ELEM_RESULT_CODE, /* Element ID*/ \
|
||||
cw_in_generic, 0, /* start/end callback */ \
|
||||
MBAG_DWORD, /* Type of element */ \
|
||||
CW_ITEM_RESULT_CODE, /* ID to use store */ \
|
||||
4, 4 /* min/max length */
|
||||
|
||||
#define CW_ACTION_IN_CAPWAP_TIMERS \
|
||||
CW_ELEM_CAPWAP_TIMERS, /* Element ID*/ \
|
||||
cw_in_generic, 0, /* start/end callback */ \
|
||||
MBAG_WORD, /* Type of element */ \
|
||||
CW_ITEM_CAPWAP_TIMERS, /* ID to use store */ \
|
||||
2, 2 /* min/max length */
|
||||
|
||||
#define CW_ACTION_IN_IDLE_TIMEOUT \
|
||||
CW_ELEM_IDLE_TIMEOUT, /* Element ID*/ \
|
||||
cw_in_generic, 0, /* start/end callback */ \
|
||||
MBAG_DWORD, /* Type of element */ \
|
||||
CW_ITEM_IDLE_TIMEOUT, /* ID to use store */ \
|
||||
4, 4 /* min/max length */
|
||||
|
||||
|
||||
#define CW_ACTION_IN_AC_NAME_WITH_PRIORITY \
|
||||
CW_ELEM_IDLE_TIMEOUT, /* Element ID*/ \
|
||||
cw_in_generic, 0, /* start/end callback */ \
|
||||
MBAG_DWORD, /* Type of element */ \
|
||||
CW_ITEM_IDLE_TIMEOUT, /* ID to use store */ \
|
||||
4, 4 /* min/max length */
|
||||
|
||||
|
||||
|
||||
#define CW_ACTION_IN_RADIO_ADMINISTRATIVE_STATE \
|
||||
CW_ELEM_RADIO_ADMINISTRATIVE_STATE, /* Element ID*/ \
|
||||
cw_in_radio_administrative_state, 0, /* start/end callback */ \
|
||||
MBAG_DWORD, /* Type of element */ \
|
||||
0, /* ID to use store */ \
|
||||
4, 4 /* min/max length */
|
||||
|
||||
#define CW_ACTION_IN_RADIO_ADMINISTRATIVE_STATE_WTP \
|
||||
CW_ELEM_RADIO_ADMINISTRATIVE_STATE, /* Element ID*/ \
|
||||
cw_in_radio_administrative_state_wtp, 0, /* start/end callback */ \
|
||||
MBAG_DWORD, /* Type of element */ \
|
||||
0, /* ID to use store */ \
|
||||
4, 4 /* min/max length */
|
||||
|
||||
|
||||
|
||||
|
||||
#define CW_ACTION_IN_MAXIMUM_MESSAGE_LENGTH \
|
||||
CW_ELEM_MAXIMUM_MESSAGE_LENGTH, /* Element ID*/ \
|
||||
cw_in_generic, 0, /* start/end callback */ \
|
||||
MBAG_WORD, /* Type of element */ \
|
||||
CW_ITEM_MAXIMUM_MESSAGE_LENGTH, /* ID to use store */ \
|
||||
2, 2 /* min/max length */
|
||||
|
||||
|
||||
|
||||
#endif
|
114
src/mod/cisco/capwap_in_wtp_board_data.c
Normal file
114
src/mod/cisco/capwap_in_wtp_board_data.c
Normal file
@ -0,0 +1,114 @@
|
||||
/*
|
||||
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/>.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
|
||||
#include "capwap/capwap.h"
|
||||
#include "capwap/capwap_items.h"
|
||||
|
||||
#include "capwap/mbag.h"
|
||||
|
||||
#include "capwap/cw_util.h"
|
||||
#include "capwap/dbg.h"
|
||||
|
||||
|
||||
|
||||
static void readsubelems_wtp_board_data(mbag_t itemstore, uint8_t * msgelem,
|
||||
int len)
|
||||
{
|
||||
if (len<4)
|
||||
return;
|
||||
|
||||
int i = 0;
|
||||
uint32_t val;
|
||||
do {
|
||||
val = ntohl(*((uint32_t *) (msgelem + i)));
|
||||
int subtype = (val >> 16) & 0xffff;
|
||||
int sublen = val & 0xffff;
|
||||
i += 4;
|
||||
if (sublen + i > len) {
|
||||
cw_dbg(DBG_ELEM_ERR,
|
||||
"WTP Board data sub-element too long, type=%d,len=%d",
|
||||
subtype, sublen);
|
||||
return;
|
||||
}
|
||||
|
||||
cw_dbg(DBG_SUBELEM, "Reading WTP board data sub-element, type=%d, len=%d",
|
||||
subtype, sublen);
|
||||
|
||||
switch (subtype) {
|
||||
case CW_BOARDDATA_MODELNO:
|
||||
mbag_set_bstrn(itemstore,
|
||||
CW_ITEM_WTP_BOARD_MODELNO,
|
||||
msgelem + i, sublen);
|
||||
break;
|
||||
case CW_BOARDDATA_SERIALNO:
|
||||
mbag_set_bstrn(itemstore,
|
||||
CW_ITEM_WTP_BOARD_SERIALNO,
|
||||
msgelem + i, sublen);
|
||||
|
||||
break;
|
||||
case CW_BOARDDATA_MACADDRESS:
|
||||
mbag_set_bstrn(itemstore,
|
||||
CW_ITEM_WTP_BOARD_MACADDRESS,
|
||||
msgelem + i, sublen);
|
||||
|
||||
break;
|
||||
case CW_BOARDDATA_BOARDID:
|
||||
mbag_set_bstrn(itemstore, CW_ITEM_WTP_BOARD_ID,
|
||||
msgelem + i, sublen);
|
||||
break;
|
||||
case CW_BOARDDATA_REVISION:
|
||||
mbag_set_bstrn(itemstore,
|
||||
CW_ITEM_WTP_BOARD_REVISION,
|
||||
msgelem + i, sublen);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
i += sublen;
|
||||
|
||||
} while (i < len);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parse a WTP Board Data messag element and put results to itemstore.
|
||||
*/
|
||||
int capwap_in_wtp_board_data(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
||||
int len, struct sockaddr *from)
|
||||
{
|
||||
|
||||
if (len < 4) {
|
||||
cw_dbg(DBG_ELEM_ERR,
|
||||
"Discarding WTP_BOARD_DATA msgelem, wrong size, type=%d, len=%d",
|
||||
a->elem_id, len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
mbag_t itemstore = conn->incomming;
|
||||
mbag_set_dword(itemstore, CW_ITEM_WTP_BOARD_VENDOR, cw_get_dword(data));
|
||||
|
||||
readsubelems_wtp_board_data(itemstore, data + 4, len - 4);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
167
src/mod/cisco/capwap_in_wtp_descriptor.c
Normal file
167
src/mod/cisco/capwap_in_wtp_descriptor.c
Normal file
@ -0,0 +1,167 @@
|
||||
/*
|
||||
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/>.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#include "capwap/capwap.h"
|
||||
#include "capwap/capwap_items.h"
|
||||
|
||||
|
||||
#include "capwap/cw_util.h"
|
||||
#include "capwap/dbg.h"
|
||||
|
||||
#include "capwap/sock.h"
|
||||
|
||||
|
||||
static int cw_read_wtp_descriptor_versions(mbag_t mbag, uint8_t * data,
|
||||
int len, int silent)
|
||||
{
|
||||
int i = 0;
|
||||
while (i<len) {
|
||||
|
||||
if (i + 8 > len) {
|
||||
if (!silent)
|
||||
cw_dbg(DBG_ELEM_ERR,
|
||||
"WTP descriptor sub-element too long, length=%d>%d",
|
||||
i + 8, len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t vendor_id = cw_get_dword(data + i);
|
||||
uint32_t val = cw_get_dword(data + i + 4);
|
||||
|
||||
int subtype = (val >> 16) & 0xffff;
|
||||
int sublen = val & 0xffff;
|
||||
i += 8;
|
||||
|
||||
if (sublen + i > len) {
|
||||
if (!silent)
|
||||
cw_dbg(DBG_ELEM_ERR,
|
||||
"WTP Descriptor sub-element too long, length = %d",
|
||||
sublen);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!silent) {
|
||||
char *dmp;
|
||||
char *dmpmem = NULL;
|
||||
if (cw_dbg_is_level(DBG_SUBELEM_DMP)) {
|
||||
dmpmem = cw_dbg_mkdmp(data + i, sublen);
|
||||
dmp = dmpmem;
|
||||
} else
|
||||
dmp = "";
|
||||
cw_dbg(DBG_SUBELEM, "WTP Descriptor subtype=%d,len=%d%s", subtype,
|
||||
sublen, dmp);
|
||||
|
||||
if (dmpmem)
|
||||
free(dmpmem);
|
||||
}
|
||||
|
||||
switch (subtype) {
|
||||
case CW_SUBELEM_WTP_HARDWARE_VERSION:
|
||||
|
||||
mbag_set_vendorstr(mbag,
|
||||
CW_ITEM_WTP_HARDWARE_VERSION,
|
||||
vendor_id, data + i, sublen);
|
||||
|
||||
break;
|
||||
case CW_SUBELEM_WTP_SOFTWARE_VERSION:
|
||||
|
||||
mbag_set_vendorstr(mbag,
|
||||
CW_ITEM_WTP_SOFTWARE_VERSION,
|
||||
vendor_id, data + i, sublen);
|
||||
break;
|
||||
case CW_SUBELEM_WTP_BOOTLOADER_VERSION:
|
||||
|
||||
mbag_set_vendorstr(mbag,
|
||||
CW_ITEM_WTP_BOOTLOADER_VERSION,
|
||||
vendor_id, data + i, sublen);
|
||||
|
||||
/*
|
||||
mbag_set_dword(mbag,
|
||||
CW_ITEM_WTP_BOOTLOADER_VENDOR,
|
||||
vendor_id);
|
||||
mbag_set_bstrn(mbag,
|
||||
CW_ITEM_WTP_BOOTLOADER_VERSION,
|
||||
data + i, sublen);
|
||||
*/
|
||||
break;
|
||||
default:
|
||||
if (!silent)
|
||||
cw_dbg(DBG_ELEM_ERR,
|
||||
"Unknown WTP descriptor subelement, type = %d",
|
||||
subtype);
|
||||
break;
|
||||
}
|
||||
i += sublen;
|
||||
|
||||
} //while (i < len);
|
||||
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
static int cw_read_wtp_descriptor(mbag_t mbag, struct conn *conn,
|
||||
struct cw_action_in *a, uint8_t * data, int len,
|
||||
int silent)
|
||||
{
|
||||
|
||||
|
||||
mbag_set_byte(mbag, CW_ITEM_WTP_MAX_RADIOS, cw_get_byte(data));
|
||||
mbag_set_byte(mbag, CW_ITEM_WTP_RADIOS_IN_USE,
|
||||
cw_get_byte(data + 1));
|
||||
|
||||
|
||||
/* Get number of encryption elements */
|
||||
int ncrypt = cw_get_byte(data + 2);
|
||||
if (ncrypt == 0) {
|
||||
if (conn->strict_capwap) {
|
||||
if (!silent)
|
||||
cw_dbg(DBG_ELEM_ERR,
|
||||
"Bad WTP Descriptor, number of encryption elements is 0.");
|
||||
return 0;
|
||||
}
|
||||
if (!silent)
|
||||
cw_dbg(DBG_RFC,
|
||||
"Non standard conform WTP Descriptor, number of encryptoin elements is 0.");
|
||||
}
|
||||
|
||||
int pos = 3;
|
||||
int i;
|
||||
for (i = 0; i < ncrypt; i++) {
|
||||
// It's a dummy for now
|
||||
pos += 3;
|
||||
}
|
||||
|
||||
return cw_read_wtp_descriptor_versions(mbag, data + pos, len - pos, silent);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int capwap_in_wtp_descriptor(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
||||
int len, struct sockaddr *from)
|
||||
{
|
||||
|
||||
mbag_t mbag = conn->incomming;
|
||||
|
||||
int rc =cw_read_wtp_descriptor(mbag, conn, a, data, len, 0);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
|
148
src/mod/cisco/capwap_items.c
Normal file
148
src/mod/cisco/capwap_items.c
Normal file
@ -0,0 +1,148 @@
|
||||
#include "item.h"
|
||||
|
||||
#include "capwap_items.h"
|
||||
|
||||
|
||||
const char CW_ITEM_IDLE_TIMEOUT[]="idle_timeout";
|
||||
const char CW_ITEM_DISCOVERY_TYPE[]="discovery_type";
|
||||
const char CW_ITEM_WTP_NAME[]="wtp_name";
|
||||
|
||||
|
||||
|
||||
const char CW_ITEM_WTP_MAC_TYPE[]="wtp_mac_type";
|
||||
const char CW_ITEM_WTP_FRAME_TUNNEL_MODE[]="wtp_frame_tunnel_mode";
|
||||
const char CW_ITEM_WTP_RADIOS_IN_USE[]="max_radios";
|
||||
const char CW_ITEM_WTP_MAX_RADIOS[]="radios_in_use";
|
||||
|
||||
/*
|
||||
const char CW_ITEM_WTP_HARDWARE_VENDOR=
|
||||
*/
|
||||
|
||||
const char CW_ITEM_WTP_HARDWARE_VERSION[]="wtp_hardware_version";
|
||||
const char CW_ITEM_WTP_SOFTWARE_VERSION[]="wtp_software_version";
|
||||
|
||||
/*
|
||||
const char CW_ITEM_WTP_SOFTWARE_VENDOR,
|
||||
*/
|
||||
|
||||
/*
|
||||
const char CW_ITEM_WTP_BOOTLOADER_VENDOR,
|
||||
*/
|
||||
const char CW_ITEM_WTP_BOOTLOADER_VERSION[]="wtp_bootloader_version";
|
||||
/*
|
||||
const char CW_ITEM_WTP_OTHERSOFTWARE_VENDOR,
|
||||
const char CW_ITEM_WTP_OTHERSOFTWARE_VERSION,
|
||||
*/
|
||||
const char CW_ITEM_WTP_BOARD_DATA[]="wtp_board_data";
|
||||
const char CW_ITEM_WTP_DESCRIPTOR[]="0wtp_descriptor";
|
||||
const char CW_ITEM_CAPWAP_TIMERS[]="capwap_timers";
|
||||
const char CW_ITEM_RADIO_ADMINISTRATIVE_STATE[]="radio_admin_state";
|
||||
|
||||
const char CW_ITEM_AC_NAME[]="ac_name";
|
||||
const char CW_ITEM_AC_DESCRIPTOR[]="ac_descriptor";
|
||||
const char CW_ITEM_RESULT_CODE[]="result_code";
|
||||
const char CW_ITEM_AC_STATUS[]="ac_status";
|
||||
|
||||
const char CW_ITEM_AC_HARDWARE_VERSION[]="ac_hardware_version";
|
||||
const char CW_ITEM_AC_SOFTWARE_VERSION[]="ac_software_version";
|
||||
|
||||
const char CW_ITEM_AC_IP_LIST[]="ac_ip_list";
|
||||
const char CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST[]="capwap_ctrl_ip_addr";
|
||||
const char CW_ITEM_CAPWAP_LOCAL_IP_ADDRESS[]="capwap_local_ip_addr";
|
||||
|
||||
const char CW_ITEM_LOCATION_DATA[]="location_data";
|
||||
const char CW_ITEM_SESSION_ID[]="session_id";
|
||||
|
||||
const char CW_ITEM_AC_TIMESTAMP[]="ac_timestamp";
|
||||
const char CW_ITEM_STATISTICS_TIMER[]="statistics_timer";
|
||||
const char CW_ITEM_WTP_REBOOT_STATISTICS[]="wtp_reboot_statistics";
|
||||
const char CW_ITEM_IMAGE_IDENTIFIER[]="image_identifier";
|
||||
const char CW_ITEM_AC_HASH_VALUE[]="ac_hash_value";
|
||||
|
||||
const char CW_ITEM_AC_NAME_WITH_PRIORITY[]="ac_name_with_priority";
|
||||
const char CW_ITEM_MAXIMUM_MESSAGE_LENGTH[]="maximum_message_length";
|
||||
|
||||
|
||||
/* CIPWAP and Cisco */
|
||||
const char CW_ITEM_WTP_GROUP_NAME[]="wtp_group_name";
|
||||
|
||||
|
||||
/* Other Items */
|
||||
const char CW_ITEM_AC_IMAGE_DIR[]="ac_img_dir"; /* Path where WTP images are stored */
|
||||
const char CW_ITEM_IMAGE_FILENAME[]="img_filename"; /* Full path of image filename */
|
||||
const char CW_ITEM_DISCOVERIES[]="discoveries";
|
||||
|
||||
/** FILE handle for uploading and downloading images */
|
||||
const char CW_ITEM_IMAGE_FILEHANDLE[]="image_file_handle";
|
||||
|
||||
const char CW_ITEM_RADIO_CFG[]="radio_cfg";
|
||||
const char CW_ITEM_AP_MODE_AND_TYPE[]="cisco_ap_mode_and_type";
|
||||
|
||||
const char CW_ITEM_CISCO_BOARD_DATA_OPTIONS[]="cisco_board_data_options";
|
||||
const char CW_ITEM_RADIOS[]="radios";
|
||||
const char CW_ITEM_RADIO_OPER_STATE[]="radio_oper_state";
|
||||
|
||||
|
||||
const char CW_ITEM_WTP_BOARD_VENDOR[]="vendor_id";
|
||||
const char CW_ITEM_WTP_BOARD_MODELNO[]="model_no";
|
||||
const char CW_ITEM_WTP_BOARD_MACADDRESS[]="wtp_board_macadddress";
|
||||
const char CW_ITEM_WTP_BOARD_ID[]="wtp_board_id";
|
||||
const char CW_ITEM_WTP_BOARD_REVISION[]="wtp_board_revision";
|
||||
const char CW_ITEM_WTP_BOARD_SERIALNO[]="serial_no";
|
||||
const char CW_ITEM_RADIO_INFOS[]="radio_infos";
|
||||
|
||||
//const char CW_ITEM_XY[]="wtp_name";
|
||||
|
||||
|
||||
struct cw_itemdef capwap_itemdefs[] = {
|
||||
|
||||
{"wtp_name",CW_ITEM_NONE,MBAG_STR},
|
||||
{"wtp_mac_type",CW_ITEM_NONE,MBAG_BYTE},
|
||||
{CW_ITEM_WTP_FRAME_TUNNEL_MODE,CW_ITEM_NONE,MBAG_BYTE},
|
||||
{CW_ITEM_LOCATION_DATA,CW_ITEM_NONE,MBAG_STR},
|
||||
{CW_ITEM_WTP_HARDWARE_VERSION,CW_ITEM_NONE,MBAG_VENDORSTR},
|
||||
{CW_ITEM_WTP_SOFTWARE_VERSION,CW_ITEM_NONE,MBAG_VENDORSTR},
|
||||
{CW_ITEM_WTP_GROUP_NAME,CW_ITEM_NONE,MBAG_STR},
|
||||
{CW_ITEM_MAXIMUM_MESSAGE_LENGTH,CW_ITEM_NONE,MBAG_WORD},
|
||||
{CW_ITEM_STATISTICS_TIMER,CW_ITEM_NONE,MBAG_WORD},
|
||||
{CW_ITEM_IDLE_TIMEOUT,CW_ITEM_NONE,MBAG_DWORD},
|
||||
{CW_ITEM_CAPWAP_TIMERS,CW_ITEM_NONE,MBAG_WORD},
|
||||
|
||||
{CW_ITEM_AC_NAME_WITH_PRIORITY,CW_ITEM_ANY,MBAG_STR},
|
||||
|
||||
|
||||
{CW_ITEM_AP_MODE_AND_TYPE,CW_ITEM_NONE,MBAG_WORD},
|
||||
|
||||
/* Board Data */
|
||||
{CW_ITEM_WTP_BOARD_DATA,CW_ITEM_NONE,MBAG_MBAG},
|
||||
{CW_ITEM_WTP_BOARD_DATA,CW_ITEM_WTP_BOARD_VENDOR,MBAG_DWORD},
|
||||
{CW_ITEM_WTP_BOARD_DATA,CW_ITEM_WTP_BOARD_MODELNO,MBAG_BSTR16},
|
||||
{CW_ITEM_WTP_BOARD_DATA,CW_ITEM_WTP_BOARD_SERIALNO,MBAG_BSTR16},
|
||||
|
||||
|
||||
/* Cisco Specific items, should be moved to a file like
|
||||
cisco_items or so */
|
||||
|
||||
{CW_ITEM_AP_MODE_AND_TYPE,CW_ITEM_NONE,MBAG_WORD},
|
||||
{CW_ITEM_CISCO_BOARD_DATA_OPTIONS,CW_ITEM_NONE,MBAG_BSTR16},
|
||||
|
||||
|
||||
|
||||
{CW_ITEM_NONE}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
struct cw_itemdef capwap_radiodefs[] = {
|
||||
|
||||
|
||||
{CW_ITEM_NONE}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
180
src/mod/cisco/capwap_items.h
Normal file
180
src/mod/cisco/capwap_items.h
Normal file
@ -0,0 +1,180 @@
|
||||
#ifndef __CAPWAP_ITEMS_H
|
||||
#define __CAPWAP_ITEMS_H
|
||||
|
||||
#include "capwap/item.h"
|
||||
|
||||
/*
|
||||
CW_ITEM_NONE=0,
|
||||
CW_ITEM_IDLE_TIMEOUT,
|
||||
CW_ITEM_DISCOVERY_TYPE,
|
||||
CW_ITEM_WTP_NAME,
|
||||
CW_ITEM_WTP_BOARD_VENDOR,
|
||||
CW_ITEM_WTP_BOARD_MODELNO,
|
||||
CW_ITEM_WTP_BOARD_MACADDRESS,
|
||||
CW_ITEM_WTP_BOARD_ID,
|
||||
CW_ITEM_WTP_BOARD_REVISION,
|
||||
CW_ITEM_WTP_BOARD_SERIALNO,
|
||||
CW_ITEM_WTP_MAC_TYPE,
|
||||
CW_ITEM_WTP_FRAME_TUNNEL_MODE,
|
||||
CW_ITEM_WTP_RADIOS_IN_USE,
|
||||
CW_ITEM_WTP_MAX_RADIOS,
|
||||
CW_ITEM_WTP_HARDWARE_VENDOR,
|
||||
CW_ITEM_WTP_HARDWARE_VERSION,
|
||||
CW_ITEM_WTP_SOFTWARE_VENDOR,
|
||||
CW_ITEM_WTP_SOFTWARE_VERSION,
|
||||
CW_ITEM_WTP_BOOTLOADER_VENDOR,
|
||||
CW_ITEM_WTP_BOOTLOADER_VERSION,
|
||||
CW_ITEM_WTP_OTHERSOFTWARE_VENDOR,
|
||||
CW_ITEM_WTP_OTHERSOFTWARE_VERSION,
|
||||
CW_ITEM_WTP_BOARD_DATA,
|
||||
CW_ITEM_WTP_DESCRIPTOR,
|
||||
CW_ITEM_CAPWAP_TIMERS,
|
||||
CW_ITEM_RADIO_ADMINISTRATIVE_STATE,
|
||||
|
||||
CW_ITEM_AC_NAME,
|
||||
CW_ITEM_AC_DESCRIPTOR,
|
||||
CW_ITEM_RESULT_CODE,
|
||||
CW_ITEM_AC_STATUS,
|
||||
|
||||
CW_ITEM_AC_HARDWARE_VERSION,
|
||||
CW_ITEM_AC_SOFTWARE_VERSION,
|
||||
|
||||
CW_ITEM_AC_IP_LIST,
|
||||
CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST,
|
||||
CW_ITEM_CAPWAP_LOCAL_IP_ADDRESS,
|
||||
|
||||
CW_ITEM_LOCATION_DATA,
|
||||
CW_ITEM_SESSION_ID,
|
||||
|
||||
CW_ITEM_AC_TIMESTAMP,
|
||||
CW_ITEM_STATISTICS_TIMER,
|
||||
CW_ITEM_WTP_REBOOT_STATISTICS,
|
||||
CW_ITEM_IMAGE_IDENTIFIER,
|
||||
CW_ITEM_AC_HASH_VALUE,
|
||||
|
||||
CW_ITEM_AC_NAME_WITH_PRIORITY,
|
||||
CW_ITEM_MAXIMUM_MESSAGE_LENGTH,
|
||||
|
||||
|
||||
CW_ITEM_WTP_GROUP_NAME,
|
||||
|
||||
|
||||
CW_ITEM_AC_IMAGE_DIR,
|
||||
CW_ITEM_IMAGE_FILENAME,
|
||||
CW_ITEM_DISCOVERIES,
|
||||
|
||||
CW_ITEM_IMAGE_FILEHANDLE,
|
||||
|
||||
CW_ITEM_RADIO_CFG,
|
||||
CW_ITEM_AP_MODE_AND_TYPE,
|
||||
|
||||
CW_ITEM_CISCO_BOARD_DATA_OPTIONS,
|
||||
CW_ITEM_RADIOS,
|
||||
CW_ITEM_RADIO_OPER_STATE,
|
||||
|
||||
|
||||
*/
|
||||
|
||||
extern const char CW_ITEM_IDLE_TIMEOUT[];
|
||||
extern const char CW_ITEM_DISCOVERY_TYPE[];
|
||||
extern const char CW_ITEM_WTP_NAME[];
|
||||
|
||||
/*
|
||||
extern const char CW_ITEM_WTP_BOARD_VENDOR,
|
||||
extern const char CW_ITEM_WTP_BOARD_MODELNO,
|
||||
extern const char CW_ITEM_WTP_BOARD_MACADDRESS,
|
||||
extern const char CW_ITEM_WTP_BOARD_ID,
|
||||
extern const char CW_ITEM_WTP_BOARD_REVISION,
|
||||
extern const char CW_ITEM_WTP_BOARD_SERIALNO,
|
||||
*/
|
||||
extern const char CW_ITEM_WTP_MAC_TYPE[];
|
||||
extern const char CW_ITEM_WTP_FRAME_TUNNEL_MODE[];
|
||||
/*
|
||||
extern const char CW_ITEM_WTP_RADIOS_IN_USE=
|
||||
extern const char CW_ITEM_WTP_MAX_RADIOS,
|
||||
*/
|
||||
/*
|
||||
extern const char CW_ITEM_WTP_HARDWARE_VENDOR=
|
||||
extern const char CW_ITEM_WTP_HARDWARE_VERSION="
|
||||
*/
|
||||
/*
|
||||
extern const char CW_ITEM_WTP_SOFTWARE_VENDOR,
|
||||
extern const char CW_ITEM_WTP_SOFTWARE_VERSION,
|
||||
extern const char CW_ITEM_WTP_BOOTLOADER_VENDOR,
|
||||
extern const char CW_ITEM_WTP_BOOTLOADER_VERSION,
|
||||
extern const char CW_ITEM_WTP_OTHERSOFTWARE_VENDOR,
|
||||
extern const char CW_ITEM_WTP_OTHERSOFTWARE_VERSION,
|
||||
*/
|
||||
extern const char CW_ITEM_WTP_BOARD_DATA[];
|
||||
extern const char CW_ITEM_WTP_DESCRIPTOR[];
|
||||
extern const char CW_ITEM_CAPWAP_TIMERS[];
|
||||
extern const char CW_ITEM_RADIO_ADMINISTRATIVE_STATE[];
|
||||
|
||||
extern const char CW_ITEM_AC_NAME[];
|
||||
extern const char CW_ITEM_AC_DESCRIPTOR[];
|
||||
extern const char CW_ITEM_RESULT_CODE[];
|
||||
extern const char CW_ITEM_AC_STATUS[];
|
||||
|
||||
extern const char CW_ITEM_AC_HARDWARE_VERSION[];
|
||||
extern const char CW_ITEM_AC_SOFTWARE_VERSION[];
|
||||
|
||||
extern const char CW_ITEM_AC_IP_LIST[];
|
||||
extern const char CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST[];
|
||||
extern const char CW_ITEM_CAPWAP_LOCAL_IP_ADDRESS[];
|
||||
|
||||
extern const char CW_ITEM_LOCATION_DATA[];
|
||||
extern const char CW_ITEM_SESSION_ID[];
|
||||
|
||||
extern const char CW_ITEM_AC_TIMESTAMP[];
|
||||
extern const char CW_ITEM_STATISTICS_TIMER[];
|
||||
extern const char CW_ITEM_WTP_REBOOT_STATISTICS[];
|
||||
extern const char CW_ITEM_IMAGE_IDENTIFIER[];
|
||||
extern const char CW_ITEM_AC_HASH_VALUE[];
|
||||
|
||||
extern const char CW_ITEM_AC_NAME_WITH_PRIORITY[];
|
||||
extern const char CW_ITEM_MAXIMUM_MESSAGE_LENGTH[];
|
||||
|
||||
|
||||
/* CIPWAP and Cisco */
|
||||
extern const char CW_ITEM_WTP_GROUP_NAME[];
|
||||
|
||||
|
||||
/* Other Items */
|
||||
extern const char CW_ITEM_AC_IMAGE_DIR[]; /* Path where WTP images are stored */
|
||||
extern const char CW_ITEM_IMAGE_FILENAME[]; /* Full path of image filename */
|
||||
extern const char CW_ITEM_DISCOVERIES[];
|
||||
|
||||
/** FILE handle for uploading and downloading images */
|
||||
extern const char CW_ITEM_IMAGE_FILEHANDLE[];
|
||||
|
||||
extern const char CW_ITEM_RADIO_CFG[];
|
||||
extern const char CW_ITEM_AP_MODE_AND_TYPE[];
|
||||
|
||||
extern const char CW_ITEM_CISCO_BOARD_DATA_OPTIONS[];
|
||||
extern const char CW_ITEM_RADIOS[];
|
||||
extern const char CW_ITEM_RADIO_OPER_STATE[];
|
||||
|
||||
|
||||
extern const char CW_ITEM_WTP_BOARD_VENDOR[];
|
||||
extern const char CW_ITEM_WTP_BOARD_MODELNO[];
|
||||
extern const char CW_ITEM_WTP_BOARD_MACADDRESS[];
|
||||
extern const char CW_ITEM_WTP_BOARD_ID[];
|
||||
extern const char CW_ITEM_WTP_BOARD_REVISION[];
|
||||
extern const char CW_ITEM_WTP_BOARD_SERIALNO[];
|
||||
|
||||
extern const char CW_ITEM_WTP_SOFTWARE_VERSION[];
|
||||
extern const char CW_ITEM_WTP_HARDWARE_VERSION[];
|
||||
|
||||
extern const char CW_ITEM_WTP_BOOTLOADER_VERSION[];
|
||||
|
||||
extern const char CW_ITEM_WTP_RADIOS_IN_USE[];
|
||||
extern const char CW_ITEM_WTP_MAX_RADIOS[];
|
||||
extern const char CW_ITEM_RADIO_INFOS[];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
extern struct cw_itemdef capwap_itemdefs[];
|
||||
|
||||
#endif
|
174
src/mod/cisco/cisco_actions_ac
Normal file
174
src/mod/cisco/cisco_actions_ac
Normal file
@ -0,0 +1,174 @@
|
||||
/*
|
||||
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/>.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#include "capwap/capwap.h"
|
||||
#include "capwap/action.h"
|
||||
#include "capwap/capwap_items.h"
|
||||
#include "capwap_actions.h"
|
||||
#include "capwap/strheap.h"
|
||||
#include "capwap/radio.h"
|
||||
|
||||
#include "mod_capwap.h"
|
||||
|
||||
cw_action_in_t _capwap_actions_ac_in[] = {
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------- */
|
||||
/* Message Discovery Request */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.end = cw_in_check_disc_req
|
||||
}
|
||||
,
|
||||
|
||||
/* Element Discovery Type */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_DISCOVERY_TYPE,
|
||||
.start = cw_in_generic2,
|
||||
.item_id = "discovery_type",
|
||||
.mand = 1,
|
||||
.min_len = 1,
|
||||
.max_len = 1
|
||||
}
|
||||
,
|
||||
|
||||
/* Element WTP Frame Tunnel Mode */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_WTP_FRAME_TUNNEL_MODE,
|
||||
.start = cw_in_generic2,
|
||||
.item_id = "wtp_frame_tunnel_mode",
|
||||
.mand = 1,
|
||||
.min_len = 1,
|
||||
.max_len = 1
|
||||
}
|
||||
,
|
||||
|
||||
/* Element WTP Mac Type */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_WTP_MAC_TYPE,
|
||||
.start = cw_in_generic2,
|
||||
.item_id = "wtp_mac_type",
|
||||
.mand = 1,
|
||||
.min_len = 1,
|
||||
.max_len = 1
|
||||
}
|
||||
,
|
||||
|
||||
|
||||
/* Element WTP Descriptor */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_WTP_DESCRIPTOR,
|
||||
.start = capwap_in_wtp_descriptor,
|
||||
.item_id = "wtp_descriptor",
|
||||
.mand = 1,
|
||||
}
|
||||
|
||||
,
|
||||
|
||||
/* Element WTP Board Data */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_WTP_BOARD_DATA,
|
||||
.start = capwap_in_wtp_board_data,
|
||||
.item_id = "wtp_board_data",
|
||||
.mand = 1,
|
||||
}
|
||||
// ,
|
||||
|
||||
/* Element WTP Board Data */
|
||||
// {0, 0, CW_STATE_CONFIGURE, CW_MSG_DISCOVERY_REQUEST, CW_ACTION_IN_WTP_BOARD_DATA,
|
||||
// 1}
|
||||
,
|
||||
|
||||
|
||||
/* Vendor Specific Payload */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_VENDOR_SPECIFIC_PAYLOAD,
|
||||
},
|
||||
|
||||
|
||||
/* Element WTP Name */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_WTP_NAME,
|
||||
.start = cw_in_generic2,
|
||||
.item_id = "wtp_name",
|
||||
.mand = 0,
|
||||
.min_len = 1,
|
||||
.max_len = 1024
|
||||
}
|
||||
,
|
||||
|
||||
/* End of list */
|
||||
{0, 0}
|
||||
};
|
||||
|
||||
|
||||
#include "capwap/item.h"
|
||||
|
||||
static struct cw_itemdef _capwap_itemdefs[] = {
|
||||
|
||||
{"wtp_name",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}
|
||||
|
||||
};
|
||||
|
||||
|
||||
int capwap_register_actions_ac(struct cw_actiondef *def)
|
||||
{
|
||||
def->in = cw_actionlist_in_create();
|
||||
def->out = cw_actionlist_out_create();
|
||||
def->strmsg = cw_strheap_create();
|
||||
def->strelem = cw_strheap_create();
|
||||
def->wbids = intavltree_create();
|
||||
def->items = cw_itemdefheap_create();
|
||||
def->radioitems = cw_itemdefheap_create();
|
||||
|
||||
int rc;
|
||||
rc = cw_actionlist_in_register_actions(def->in, _capwap_actions_ac_in);
|
||||
// rc += cw_actionlist_out_register_actions(def->out, capwap_actions_ac_out);
|
||||
|
||||
rc += cw_strheap_register_strings(def->strmsg, capwap_strings_msg);
|
||||
rc += cw_strheap_register_strings(def->strelem, capwap_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;
|
||||
}
|
158
src/mod/cisco/cisco_actions_ac.c
Normal file
158
src/mod/cisco/cisco_actions_ac.c
Normal file
@ -0,0 +1,158 @@
|
||||
/*
|
||||
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/>.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#include "capwap/capwap.h"
|
||||
#include "capwap/action.h"
|
||||
#include "capwap/capwap_items.h"
|
||||
#include "capwap_actions.h"
|
||||
#include "capwap/strheap.h"
|
||||
#include "capwap/radio.h"
|
||||
|
||||
#include "mod_cisco.h"
|
||||
|
||||
static cw_action_in_t actions_in[] = {
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------- */
|
||||
/* Message Discovery Request */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.end = cw_in_check_disc_req
|
||||
}
|
||||
,
|
||||
|
||||
/* Element Discovery Type */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_DISCOVERY_TYPE,
|
||||
.start = cw_in_generic2,
|
||||
.item_id = "discovery_type",
|
||||
.mand = 1,
|
||||
.min_len = 1,
|
||||
.max_len = 1
|
||||
}
|
||||
,
|
||||
|
||||
/* Element WTP Frame Tunnel Mode */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_WTP_FRAME_TUNNEL_MODE,
|
||||
.start = cw_in_generic2,
|
||||
.item_id = "wtp_frame_tunnel_mode",
|
||||
.mand = 1,
|
||||
.min_len = 1,
|
||||
.max_len = 1
|
||||
}
|
||||
,
|
||||
|
||||
/* Element WTP Mac Type */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_WTP_MAC_TYPE,
|
||||
.start = cw_in_generic2,
|
||||
.item_id = "wtp_mac_type",
|
||||
.mand = 1,
|
||||
.min_len = 1,
|
||||
.max_len = 1
|
||||
}
|
||||
,
|
||||
|
||||
|
||||
|
||||
// ,
|
||||
|
||||
/* Element WTP Board Data */
|
||||
// {0, 0, CW_STATE_CONFIGURE, CW_MSG_DISCOVERY_REQUEST, CW_ACTION_IN_WTP_BOARD_DATA,
|
||||
// 1}
|
||||
|
||||
|
||||
/* Vendor Specific Payload */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_VENDOR_SPECIFIC_PAYLOAD,
|
||||
},
|
||||
|
||||
|
||||
/* Element WTP Name */
|
||||
{
|
||||
.capwap_state = CW_STATE_DISCOVERY,
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_WTP_NAME,
|
||||
.start = cw_in_generic2,
|
||||
.item_id = "wtp_name",
|
||||
.mand = 0,
|
||||
.min_len = 1,
|
||||
.max_len = 1024
|
||||
}
|
||||
,
|
||||
|
||||
/* End of list */
|
||||
{0, 0}
|
||||
};
|
||||
|
||||
|
||||
#include "capwap/item.h"
|
||||
|
||||
static struct cw_itemdef _capwap_itemdefs[] = {
|
||||
|
||||
{"wtp_name",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_ac(struct cw_actiondef *def)
|
||||
{
|
||||
/*
|
||||
def->in = cw_actionlist_in_create();
|
||||
def->out = cw_actionlist_out_create();
|
||||
def->strmsg = cw_strheap_create();
|
||||
def->strelem = cw_strheap_create();
|
||||
def->wbids = intavltree_create();
|
||||
def->items = cw_itemdefheap_create();
|
||||
def->radioitems = cw_itemdefheap_create();
|
||||
*/
|
||||
|
||||
|
||||
int rc;
|
||||
rc = cw_actionlist_in_register_actions(def->in, actions_in);
|
||||
// rc += cw_actionlist_out_register_actions(def->out, capwap_actions_ac_out);
|
||||
|
||||
rc += cw_strheap_register_strings(def->strmsg, capwap_strings_msg);
|
||||
rc += cw_strheap_register_strings(def->strelem, capwap_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;
|
||||
}
|
40
src/mod/cisco/cw_in_check_disc_req.c
Normal file
40
src/mod/cisco/cw_in_check_disc_req.c
Normal file
@ -0,0 +1,40 @@
|
||||
|
||||
#include "capwap.h"
|
||||
#include "capwap_items.h"
|
||||
|
||||
#include "intavltree.h"
|
||||
#include "log.h"
|
||||
#include "dbg.h"
|
||||
#include "sock.h"
|
||||
|
||||
int capwap_in_check_disc_req(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
||||
int len,struct sockaddr *from)
|
||||
{
|
||||
|
||||
cw_action_in_t *mlist[120];
|
||||
int n = cw_check_missing_mand(mlist, conn, a);
|
||||
|
||||
|
||||
conn->capwap_state = CW_STATE_NONE;
|
||||
|
||||
if (n && conn->strict_capwap) {
|
||||
cw_dbg_missing_mand(DBG_MSG_ERR, conn, mlist, n, a);
|
||||
/* if mandatory elements are missing, in strict
|
||||
mode send no discovery response */
|
||||
cw_dbg(DBG_MSG_ERR,
|
||||
"Ignoring Discovery Request from %s - missing mandatory elements.",
|
||||
sock_addr2str(from));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ( n ) {
|
||||
/* put a warning here */
|
||||
cw_dbg_missing_mand(DBG_RFC, conn, mlist, n, a);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ok, send response */
|
||||
|
||||
return 0;
|
||||
}
|
45
src/mod/cisco/mod_capwap_ac.c
Normal file
45
src/mod/cisco/mod_capwap_ac.c
Normal file
@ -0,0 +1,45 @@
|
||||
|
||||
#include "capwap/mod.h"
|
||||
#include "capwap/log.h"
|
||||
#include "capwap/dbg.h"
|
||||
|
||||
#include "capwap/action.h"
|
||||
|
||||
#include "mod_capwap.h"
|
||||
|
||||
|
||||
static struct cw_actiondef actions;
|
||||
|
||||
|
||||
|
||||
extern int capwap_register_actions_ac(struct cw_actiondef *def);
|
||||
|
||||
|
||||
static int init()
|
||||
{
|
||||
cw_dbg(DBG_INFO,"Initialiazing mod_capwap ...");
|
||||
int rc = capwap_register_actions_ac(&actions);
|
||||
cw_dbg(DBG_INFO,"Initialized mod capwap with %d actions",rc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int detect(struct conn *conn,const uint8_t *rawmsg, int rawlen,struct sockaddr *from)
|
||||
{
|
||||
cw_log(LOG_INFO,"Detecting ...");
|
||||
conn->detected=1;
|
||||
conn->actions=&actions;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static struct mod_ac capwap_ac = {
|
||||
.name ="capwap",
|
||||
.init = init,
|
||||
.detect = detect
|
||||
|
||||
};
|
||||
|
||||
struct mod_ac * mod_capwap_ac(){
|
||||
return &capwap_ac;
|
||||
};
|
||||
|
6
src/mod/cisco/mod_cisco.h
Normal file
6
src/mod/cisco/mod_cisco.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef __MOD_CISCO_H
|
||||
#define __MOD_CISCO_H
|
||||
|
||||
struct mod_ac * mod_cisco_ac();
|
||||
|
||||
#endif
|
52
src/mod/cisco/mod_cisco_ac.c
Normal file
52
src/mod/cisco/mod_cisco_ac.c
Normal file
@ -0,0 +1,52 @@
|
||||
|
||||
#include "capwap/mod.h"
|
||||
#include "capwap/log.h"
|
||||
#include "capwap/dbg.h"
|
||||
|
||||
#include "capwap/action.h"
|
||||
|
||||
#include "mod_cisco.h"
|
||||
|
||||
|
||||
static struct cw_actiondef actions;
|
||||
|
||||
|
||||
#include "../modload.h"
|
||||
|
||||
extern int cisco_register_actions_ac(struct cw_actiondef *def);
|
||||
|
||||
|
||||
static int init()
|
||||
{
|
||||
struct mod_ac * cmod = modload_ac("capwap");
|
||||
|
||||
cmod->register_actions(&actions);
|
||||
|
||||
|
||||
|
||||
cw_dbg(DBG_INFO,"Initialiazing mod_cisco ...");
|
||||
int rc = cisco_register_actions_ac(&actions);
|
||||
cw_dbg(DBG_INFO,"Initialized mod cisco with %d actions",rc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int detect(struct conn *conn,const uint8_t *rawmsg, int rawlen,struct sockaddr *from)
|
||||
{
|
||||
cw_log(LOG_INFO,"Detecting ...");
|
||||
conn->detected=1;
|
||||
conn->actions=&actions;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static struct mod_ac capwap_ac = {
|
||||
.name ="cisco",
|
||||
.init = init,
|
||||
.detect = detect
|
||||
|
||||
};
|
||||
|
||||
struct mod_ac * mod_cisco_ac(){
|
||||
return &capwap_ac;
|
||||
};
|
||||
|
@ -3,8 +3,9 @@
|
||||
|
||||
#include "cipwap/mod_cipwap.h"
|
||||
#include "capwap/mod_capwap.h"
|
||||
#include "cisco/mod_cisco.h"
|
||||
|
||||
#define MODS_AC { mod_capwap_ac,mod_cipwap_ac,NULL }
|
||||
#define MODS_AC { mod_capwap_ac,mod_cipwap_ac, mod_cisco_ac, NULL }
|
||||
|
||||
|
||||
struct mod_ac *(*mods_ac[])() = MODS_AC;
|
||||
|
Loading…
Reference in New Issue
Block a user