2014-11-02 07:34:17 +01:00
|
|
|
include ../Config.mak
|
|
|
|
|
2014-07-20 07:54:39 +02:00
|
|
|
ifndef CC
|
|
|
|
CC=gcc
|
|
|
|
endif
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2014-07-20 07:54:39 +02:00
|
|
|
ifndef AR
|
|
|
|
AR = ar
|
2014-07-11 22:12:11 +02:00
|
|
|
endif
|
|
|
|
|
2014-07-20 07:54:39 +02:00
|
|
|
ifndef ARCH
|
|
|
|
ARCH = $(shell $(CC) -dumpmachine)
|
|
|
|
endif
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2014-07-20 07:54:39 +02:00
|
|
|
ifdef INCLUDE_DIR
|
|
|
|
XINCLUDE = -I $(INCLUDE_DIR)
|
|
|
|
endif
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2014-08-12 15:45:05 +02:00
|
|
|
OPENSSLINC=../contrib/openssl-1.0.1i/include
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
NAME=libcapwap.a
|
|
|
|
|
|
|
|
SOCKOBJS=sock_create.o sock_copyaddr.o sock_strtoaddr.o sock_cmpaddr.o sock_addrlen.o \
|
2014-07-21 22:28:31 +02:00
|
|
|
sock_receive.o sock_mwait.o sock_addrtostr.o \
|
2014-07-11 22:12:11 +02:00
|
|
|
sock_setport.o \
|
|
|
|
sock_getport.o \
|
|
|
|
sock_getifaddr.o \
|
|
|
|
sock_getifhwaddr.o \
|
|
|
|
sock_hwaddrtostr.o \
|
|
|
|
sock_set_recvtimeout.o \
|
|
|
|
sock_getbroadcastaddr.o \
|
|
|
|
sock_addrinit.o \
|
2014-07-14 22:45:22 +02:00
|
|
|
sock_set_dontfrag.o \
|
|
|
|
sock_get_primary_if.o
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
LOGOBJS=cw_log.o \
|
|
|
|
cw_log_debug.o \
|
|
|
|
cw_log_tofile.o \
|
|
|
|
cw_log_tosyslog.o
|
|
|
|
|
|
|
|
|
|
|
|
WTPINFOOBJS = wtpinfo_set_location.o \
|
2014-07-20 07:54:39 +02:00
|
|
|
wtpinfo_print.o
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2014-08-18 01:40:35 +02:00
|
|
|
UTILOBJS= \
|
|
|
|
cw_setstr.o \
|
|
|
|
cw_is_printable.o \
|
|
|
|
cw_rand.o \
|
|
|
|
cw_pseudo_rand.o \
|
|
|
|
cw_foreach_msgelem.o \
|
|
|
|
avltree.o \
|
|
|
|
avltree_get.o \
|
|
|
|
avltree_del_all.o \
|
|
|
|
avltree_foreach.o \
|
|
|
|
stravltree.o \
|
|
|
|
cw_util.o
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2014-08-16 15:12:35 +02:00
|
|
|
# cw_tohex.o\
|
2014-07-11 22:12:11 +02:00
|
|
|
#capwap_parse_ctrlhdr.o \
|
|
|
|
|
|
|
|
CAPWAPOBJS= \
|
|
|
|
cwmsg_init.o \
|
|
|
|
cwmsg_init_echo_request.o \
|
|
|
|
cwmsg_addelem.o \
|
2014-08-17 18:29:30 +02:00
|
|
|
cwmsg_vaddelem.o \
|
2014-07-11 22:12:11 +02:00
|
|
|
cwmsg_addelem_ac_descriptor.o \
|
|
|
|
cwmsg_addelem_wtp_descriptor.o \
|
|
|
|
cwmsg_addelem_ctrl_ip_addrs.o \
|
|
|
|
cwmsg_addelem_wtp_radio_infos.o \
|
|
|
|
cwmsg_addelem_wtp_board_data.o \
|
|
|
|
cwmsg_addelem_cw_local_ip_addr.o \
|
|
|
|
cwmsg_addelem_mtu_discovery_padding.o \
|
|
|
|
cwmsg_addelem_result_code.o \
|
2014-08-12 15:45:05 +02:00
|
|
|
cwmsg_addelem_ac_timestamp.o \
|
2014-08-17 18:29:30 +02:00
|
|
|
cwmsg_addelem_vendor_specific_payload.o \
|
|
|
|
cwmsg_addelem_maximum_message_length.o \
|
|
|
|
cwmsg_addelem_image_identifier.o \
|
2014-08-22 22:38:11 +02:00
|
|
|
cwmsg_addelem_radio_operational_state.o \
|
2014-07-11 22:12:11 +02:00
|
|
|
cwmsg_send.o \
|
2014-08-22 22:38:11 +02:00
|
|
|
cwsend_change_state_event_response.o \
|
2014-08-23 09:37:48 +02:00
|
|
|
cwsend_unknow_response.o \
|
2014-07-11 22:12:11 +02:00
|
|
|
cwsend_discovery_response.o \
|
|
|
|
cwread_discovery_response.o \
|
|
|
|
cwsend_discovery_request.o \
|
2014-08-16 19:29:42 +02:00
|
|
|
cwread_image_data_request.o \
|
|
|
|
cwsend_image_data_response.o \
|
2014-07-11 22:12:11 +02:00
|
|
|
cwsend_join_request.o \
|
|
|
|
cwsend_join_response.o \
|
|
|
|
cwread_join_response.o \
|
|
|
|
cwsend_echo_request.o \
|
|
|
|
cwsend_echo_response.o \
|
2014-08-16 09:10:38 +02:00
|
|
|
cwsend_conf_status_response.o\
|
2014-08-18 00:05:46 +02:00
|
|
|
cwread_configuration_status_request.o\
|
2014-08-25 23:37:49 +02:00
|
|
|
cwread_discovery_request.o\
|
2014-08-18 01:40:35 +02:00
|
|
|
cwread_change_state_event_request.o\
|
2014-08-23 09:37:48 +02:00
|
|
|
cwread_wtp_event_request.o \
|
2014-07-11 22:12:11 +02:00
|
|
|
process_msgelems_discovery_request.o \
|
2014-08-15 01:31:17 +02:00
|
|
|
process_conf_status_request.o \
|
2014-07-11 22:12:11 +02:00
|
|
|
process_join_request.o \
|
|
|
|
wtpinfo_readelem_wtp_board_data.o \
|
|
|
|
wtpinfo_readelem_wtp_mac_type.o \
|
|
|
|
wtpinfo_readelem_wtp_radio_info.o \
|
2015-01-11 22:24:15 +01:00
|
|
|
cw_readelem_ieee80211_wtp_radio_info.o \
|
2014-07-11 22:12:11 +02:00
|
|
|
wtpinfo_readelem_wtp_descriptor.o \
|
|
|
|
wtpinfo_readelem_discovery_type.o \
|
|
|
|
wtpinfo_readelem_wtp_frame_tunnel_mode.o \
|
|
|
|
wtpinfo_readelem_location_data.o \
|
|
|
|
wtpinfo_readelem_wtp_name.o \
|
|
|
|
wtpinfo_readelem_session_id.o \
|
|
|
|
wtpinfo.o \
|
|
|
|
aciplist.o \
|
|
|
|
acinfo.o \
|
2014-07-26 11:10:32 +02:00
|
|
|
acinfo_print.o \
|
2014-07-26 20:27:57 +02:00
|
|
|
lwmsg_init.o \
|
2014-07-26 11:10:32 +02:00
|
|
|
wtpinfo_lwreadelem_wtp_descriptor.o \
|
2014-07-29 19:29:13 +02:00
|
|
|
cw_msgelemtostr.o \
|
2014-08-16 15:12:35 +02:00
|
|
|
cw_msgtostr.o \
|
2014-07-31 17:56:57 +02:00
|
|
|
hdr_print.o \
|
2014-08-03 13:33:47 +02:00
|
|
|
cw_ianavendoridtostr.o \
|
2014-08-14 17:16:54 +02:00
|
|
|
cw_readelem_ecn_support.o \
|
2015-01-08 19:33:00 +01:00
|
|
|
cw_readelem_maximum_message_length.o \
|
2014-08-18 01:40:35 +02:00
|
|
|
cw_readelem_result_code.o\
|
2014-08-15 01:31:17 +02:00
|
|
|
cw_readelem_ac_name.o \
|
2014-08-18 00:05:46 +02:00
|
|
|
cw_readelem_radio_administrative_state.o \
|
2014-08-21 21:37:02 +02:00
|
|
|
cw_readelem_radio_operational_state.o \
|
2014-08-18 00:05:46 +02:00
|
|
|
cw_readelem_statistics_timer.o \
|
2014-08-26 00:11:20 +02:00
|
|
|
cw_readelem_mtu_discovery_padding.o \
|
2014-08-26 00:57:13 +02:00
|
|
|
cw_readelem_vendor_specific_payload.o \
|
2014-08-15 01:59:38 +02:00
|
|
|
cw_readelem_wtp_reboot_statistics.o\
|
2014-08-25 07:56:14 +02:00
|
|
|
cwmsg_addelem_vendor_cisco_ap_timesync.o \
|
|
|
|
lw_checksum.o
|
2014-07-26 11:10:32 +02:00
|
|
|
|
2014-08-25 07:56:14 +02:00
|
|
|
# cwsend_image_data_request.o
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
# cwmsg_set_control_header.o
|
|
|
|
# process_msgelems.o \
|
|
|
|
|
|
|
|
|
|
|
|
DTLSOBJS= dtls_openssl.o \
|
|
|
|
dtls_openssl_accept.o \
|
|
|
|
dtls_openssl_connect.o \
|
2014-08-02 14:18:30 +02:00
|
|
|
dtls_openssl_get_cipher.o \
|
2014-08-03 08:48:18 +02:00
|
|
|
dtls_openssl_bio.o \
|
2014-09-14 22:46:14 +02:00
|
|
|
# dtls_gnutls.o \
|
|
|
|
# dtls_gnutls_accept.o \
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
CONNOBJS= conn.o \
|
2015-01-08 21:19:28 +01:00
|
|
|
conn_detect_capwap.o \
|
2014-07-11 22:12:11 +02:00
|
|
|
conn_send_packet.o \
|
|
|
|
conn_send_cwmsg.o \
|
|
|
|
conn_process_packet.o \
|
|
|
|
conn_q_add_packet.o \
|
|
|
|
conn_q_get_packet.o \
|
|
|
|
conn_q_recv_packet.o \
|
|
|
|
conn_recv_packet.o \
|
2014-07-20 12:50:01 +02:00
|
|
|
conn_destroy.o \
|
2014-07-20 16:00:27 +02:00
|
|
|
connlist.o \
|
2014-07-25 00:27:17 +02:00
|
|
|
conn_create_noq.o \
|
2014-08-17 18:29:30 +02:00
|
|
|
conn_send_response.o \
|
|
|
|
conn_get_message.o \
|
2014-08-23 12:00:28 +02:00
|
|
|
conn_get_response.o \
|
|
|
|
conn_prepare_configuration_update_request.o \
|
2014-08-25 07:56:14 +02:00
|
|
|
conn_prepare_request.o \
|
|
|
|
conn_prepare_image_data_request.o
|
2014-07-11 22:12:11 +02:00
|
|
|
|
2015-01-31 12:21:20 +01:00
|
|
|
BSTROBJS= bstr_create.o \
|
|
|
|
bstr_create_from_cfgstr.o \
|
|
|
|
bstr_replace.o
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
FRAGOBJS=fragman.o
|
|
|
|
|
2015-01-31 10:17:20 +01:00
|
|
|
OBJS=$(CONNOBJS) $(FRAGOBJS) $(SOCKOBJS) $(CAPWAPOBJS) $(WTPINFOOBJS) $(LOGOBJS) $(UTILOBJS) $(DTLSOBJS) $(BSTROBJS)
|
2014-07-11 22:12:11 +02:00
|
|
|
O:=$(OBJS);
|
|
|
|
|
|
|
|
OBJS:=$(patsubst %.o,$(ARCH)/%.o,$(OBJS))
|
|
|
|
|
|
|
|
#CFLAGS = -Wall -g -O3 -D_REENTRANT -DWITH_IPV6
|
|
|
|
CFLAGS = -Wall -g -O0 -D_REENTRANT -DWITH_IPV6 -DWITH_RMAC_SUPPORT
|
|
|
|
|
|
|
|
CFLAGS += -DWITH_CW_LOG \
|
|
|
|
-DWITH_CW_LOG_DEBUG \
|
|
|
|
-DWITH_DTLS \
|
2014-08-12 15:45:05 +02:00
|
|
|
-I $(OPENSSLINC)\
|
2014-08-16 09:10:38 +02:00
|
|
|
$(XINCLUDE)\
|
|
|
|
-Werror
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
#SRCS = $(OBJS:.o=.c)
|
|
|
|
|
|
|
|
$(ARCH)/%.o:%.c
|
|
|
|
@mkdir -p $(ARCH)
|
|
|
|
@echo " CC "$<
|
|
|
|
@$(CC) -c $(CFLAGS) $< -o $@
|
|
|
|
|
|
|
|
|
|
|
|
$(ARCH)/$(NAME) : $(OBJS)
|
|
|
|
@echo " AR $(ARCH)/$(NAME)"
|
|
|
|
@$(AR) rcs $(ARCH)/$(NAME) $(OBJS)
|
|
|
|
#$(OBJS)
|
|
|
|
|
|
|
|
#.c.o:
|
|
|
|
# $(CC) -c $(CFLAGS) $<
|
|
|
|
|
|
|
|
SRCS = $(OBJS:.o=.c)
|
|
|
|
DEPS := $(OBJS:.o=.d)
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: deps clean clean_libs libs
|
|
|
|
|
|
|
|
# top-level rule, to compile everything.
|
|
|
|
all: $(ARCH)/$(NAME)
|
|
|
|
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) $(OBJS)
|
|
|
|
$(RM) $(DEPS)
|
2014-08-25 23:37:49 +02:00
|
|
|
$(RM) $(ARCH)/$(NAME)
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
clean_deps:
|
|
|
|
$(DEPS)
|
|
|
|
|
|
|
|
deps: $(SRCS)
|
|
|
|
$(CC) -MD -E $(SRCS) $(CFLAGS) >/dev/null
|
|
|
|
|
|
|
|
-include $(DEPS)
|