fork SmartCAWPAP as FreeWTP

This commit is contained in:
Andreas Schultz 2016-08-22 16:59:55 +02:00
parent 8cc6559f08
commit 0101ea6e56
341 changed files with 724 additions and 17737 deletions

View File

@ -1,4 +1,4 @@
This is a GPLv2 only fork of SmartCAWAP. The original project
This is a GPLv2 only fork of SmartCAPWAP. The original project
can be found here: https://bitbucket.org/vemax78/smartcapwap
All changes and contribution to this fork are GPL licensed only.

View File

@ -1,6 +1,7 @@
# SmartCAPWAP -- An Open Source CAPWAP WTP / AC
# FreeWTP -- An Open Source CAPWAP WTP
#
# Copyright (C) 2012-2013 Massimo Vellucci <vemax78@gmail.com>
# Copyright SmartCAPWAP (C) 2012-2013 Massimo Vellucci <vemax78@gmail.com>
# Copyright FreeWTP (C) 2016 Travelping GmbH <info@travelping.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -23,20 +24,24 @@ ACLOCAL_AMFLAGS = -I m4
MAINTAINERCLEANFILES = $(srcdir)/config.log \
$(srcdir)/config.status \
$(srcdir)/Makefile.in \
$(srcdir)/config.h.in \
$(srcdir)/config.h.in~ \
$(srcdir)/lib/Makefile.in \
$(srcdir)/src/Makefile.in \
$(srcdir)/lib/config.h.in \
$(srcdir)/lib/config.h.in~ \
$(srcdir)/configure \
$(srcdir)/build/install-sh \
$(srcdir)/ltmain.sh \
$(srcdir)/build/missing \
$(srcdir)/config/install-sh \
$(srcdir)/config/ltmain.sh \
$(srcdir)/config/compile \
$(srcdir)/config/missing \
$(srcdir)/config/ar-lib \
$(srcdir)/config/depcomp \
$(srcdir)/config/config.guess \
$(srcdir)/config/config.sub \
$(srcdir)/m4/libtool.m4 \
$(srcdir)/m4/lt~obsolete.m4 \
$(srcdir)/m4/ltoptions.m4 \
$(srcdir)/m4/ltsugar.m4 \
$(srcdir)/m4/ltversion.m4 \
$(srcdir)/depcomp \
$(srcdir)/aclocal.m4 \
$(srcdir)/build/config.guess \
$(srcdir)/build/config.sub
$(srcdir)/m4/lt~obsolete.m4 \
$(srcdir)/aclocal.m4
SUBDIRS = build
SUBDIRS = lib src

View File

@ -1,8 +1,8 @@
# README
[RFC-5415](https://tools.ietf.org/html/rfc5415) and [RFC-5416](https://tools.ietf.org/html/rfc5416) compliant CAPWAP WTP (and AC) implementation.
[RFC-5415](https://tools.ietf.org/html/rfc5415) and [RFC-5416](https://tools.ietf.org/html/rfc5416) compliant CAPWAP WTP implementation.
This fork is currently focusing on the WTP side only.
This project started as a fork of SmartCAPWAP, but has since dropped the AC part on focuses on WTP functionality only (hence the new name).
## STATUS
@ -62,7 +62,7 @@ WolfSSL:
make
make install
SmartCAPWAP:
FreeWTP:
autoreconf -f -i
./configure --disable-ac

View File

@ -1,30 +0,0 @@
# SmartCAPWAP -- An Open Source CAPWAP WTP / AC
#
# Copyright (C) 2012-2013 Massimo Vellucci <vemax78@gmail.com>
#
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program (see the file COPYING included with this
# distribution); if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
SUBDIRS =
if BUILD_AC
SUBDIRS += ac
endif
if BUILD_WTP
SUBDIRS += wtp
endif

View File

@ -1,114 +0,0 @@
# SmartCAPWAP -- An Open Source CAPWAP WTP / AC
#
# Copyright (C) 2012-2013 Massimo Vellucci <vemax78@gmail.com>
#
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program (see the file COPYING included with this
# distribution); if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
capwap_SOURCES = $(top_srcdir)/src/common/capwap.c \
$(top_srcdir)/src/common/capwap_timeout.c \
$(top_srcdir)/src/common/capwap_network.c \
$(top_srcdir)/src/common/capwap_protocol.c \
$(top_srcdir)/src/common/capwap_logging.c \
$(top_srcdir)/src/common/capwap_list.c \
$(top_srcdir)/src/common/capwap_array.c \
$(top_srcdir)/src/common/capwap_hash.c \
$(top_srcdir)/src/common/capwap_dtls.c \
$(top_srcdir)/src/common/capwap_dfa.c \
$(top_srcdir)/src/common/capwap_element.c \
$(top_srcdir)/src/common/capwap_element_acdescriptor.c \
$(top_srcdir)/src/common/capwap_element_actimestamp.c \
$(top_srcdir)/src/common/capwap_element_addmacacl.c \
$(top_srcdir)/src/common/capwap_element_deletemacacl.c \
$(top_srcdir)/src/common/capwap_element_addstation.c \
$(top_srcdir)/src/common/capwap_element_deletestation.c \
$(top_srcdir)/src/common/capwap_element_discoverytype.c \
$(top_srcdir)/src/common/capwap_element_duplicateipv4.c \
$(top_srcdir)/src/common/capwap_element_duplicateipv6.c \
$(top_srcdir)/src/common/capwap_element_datatransferdata.c \
$(top_srcdir)/src/common/capwap_element_datatransfermode.c \
$(top_srcdir)/src/common/capwap_element_decrypterrorreport.c \
$(top_srcdir)/src/common/capwap_element_imagedata.c \
$(top_srcdir)/src/common/capwap_element_imageinfo.c \
$(top_srcdir)/src/common/capwap_element_initdownload.c \
$(top_srcdir)/src/common/capwap_element_wtpboarddata.c \
$(top_srcdir)/src/common/capwap_element_wtpdescriptor.c \
$(top_srcdir)/src/common/capwap_element_wtpframetunnelmode.c \
$(top_srcdir)/src/common/capwap_element_wtpmactype.c \
$(top_srcdir)/src/common/capwap_element_acname.c \
$(top_srcdir)/src/common/capwap_element_controlipv4.c \
$(top_srcdir)/src/common/capwap_element_controlipv6.c \
$(top_srcdir)/src/common/capwap_element_location.c \
$(top_srcdir)/src/common/capwap_element_wtpname.c \
$(top_srcdir)/src/common/capwap_element_sessionid.c \
$(top_srcdir)/src/common/capwap_element_ecnsupport.c \
$(top_srcdir)/src/common/capwap_element_localipv4.c \
$(top_srcdir)/src/common/capwap_element_localipv6.c \
$(top_srcdir)/src/common/capwap_element_transport.c \
$(top_srcdir)/src/common/capwap_element_mtudiscovery.c \
$(top_srcdir)/src/common/capwap_element_vendorpayload.c \
$(top_srcdir)/src/common/capwap_element_maximumlength.c \
$(top_srcdir)/src/common/capwap_element_wtprebootstat.c \
$(top_srcdir)/src/common/capwap_element_wtpradiostat.c \
$(top_srcdir)/src/common/capwap_element_resultcode.c \
$(top_srcdir)/src/common/capwap_element_returnedmessage.c \
$(top_srcdir)/src/common/capwap_element_acipv4list.c \
$(top_srcdir)/src/common/capwap_element_acipv6list.c \
$(top_srcdir)/src/common/capwap_element_imageidentifier.c \
$(top_srcdir)/src/common/capwap_element_radioadmstate.c \
$(top_srcdir)/src/common/capwap_element_statisticstimer.c \
$(top_srcdir)/src/common/capwap_element_acnamepriority.c \
$(top_srcdir)/src/common/capwap_element_wtpstaticipaddress.c \
$(top_srcdir)/src/common/capwap_element_timers.c \
$(top_srcdir)/src/common/capwap_element_decrypterrorreportperiod.c \
$(top_srcdir)/src/common/capwap_element_idletimeout.c \
$(top_srcdir)/src/common/capwap_element_wtpfallback.c \
$(top_srcdir)/src/common/capwap_element_radiooprstate.c \
$(top_srcdir)/src/common/capwap_element_80211_addwlan.c \
$(top_srcdir)/src/common/capwap_element_80211_antenna.c \
$(top_srcdir)/src/common/capwap_element_80211_assignbssid.c \
$(top_srcdir)/src/common/capwap_element_80211_deletewlan.c \
$(top_srcdir)/src/common/capwap_element_80211_directsequencecontrol.c \
$(top_srcdir)/src/common/capwap_element_80211_ie.c \
$(top_srcdir)/src/common/capwap_element_80211_mac_profile.c \
$(top_srcdir)/src/common/capwap_element_80211_macoperation.c \
$(top_srcdir)/src/common/capwap_element_80211_miccountermeasures.c \
$(top_srcdir)/src/common/capwap_element_80211_multidomaincapability.c \
$(top_srcdir)/src/common/capwap_element_80211_ofdmcontrol.c \
$(top_srcdir)/src/common/capwap_element_80211_rateset.c \
$(top_srcdir)/src/common/capwap_element_80211_rsnaerrorreport.c \
$(top_srcdir)/src/common/capwap_element_80211_station.c \
$(top_srcdir)/src/common/capwap_element_80211_stationqos.c \
$(top_srcdir)/src/common/capwap_element_80211_stationkey.c \
$(top_srcdir)/src/common/capwap_element_80211_statistics.c \
$(top_srcdir)/src/common/capwap_element_80211_supported_mac_profiles.c \
$(top_srcdir)/src/common/capwap_element_80211_supportedrates.c \
$(top_srcdir)/src/common/capwap_element_80211_txpower.c \
$(top_srcdir)/src/common/capwap_element_80211_txpowerlevel.c \
$(top_srcdir)/src/common/capwap_element_80211_updatestationqos.c \
$(top_srcdir)/src/common/capwap_element_80211_updatewlan.c \
$(top_srcdir)/src/common/capwap_element_80211_wtpqos.c \
$(top_srcdir)/src/common/capwap_element_80211_wtpradioconf.c \
$(top_srcdir)/src/common/capwap_element_80211_wtpradiofailalarm.c \
$(top_srcdir)/src/common/capwap_element_80211_wtpradioinformation.c \
$(top_srcdir)/src/common/capwap_element_80211n_radioconf.c \
$(top_srcdir)/src/common/capwap_element_80211n_station_information.c \
$(top_srcdir)/src/common/capwap_element_vendor_travelping_wtp_timestamp.c \
$(top_srcdir)/src/common/capwap_element_vendor_travelping_80211_encryption_capability.c \
$(top_srcdir)/src/common/capwap_element_vendor_travelping_80211_update_key.c
if DEBUG_BUILD
capwap_SOURCES += $(top_srcdir)/src/common/capwap_debug.c
endif

View File

@ -1,90 +0,0 @@
# SmartCAPWAP -- An Open Source CAPWAP WTP / AC
#
# Copyright (C) 2012-2013 Massimo Vellucci <vemax78@gmail.com>
#
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program (see the file COPYING included with this
# distribution); if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
bin_PROGRAMS = ac
AM_CFLAGS = -DCAPWAP_MULTITHREADING_ENABLE \
-D_REENTRANT \
-D_GNU_SOURCE \
${LIBNL_CFLAGS} \
$(LIBXML2_CFLAGS) \
$(WOLFSSL_CFLAGS)
AM_CFLAGS += -I$(top_srcdir)/build \
-I$(top_srcdir)/src/common \
-I$(top_srcdir)/src/ac \
-I$(top_srcdir)/src/ac/kmod \
-I$(top_srcdir)/src/common/binding/ieee80211
include $(top_srcdir)/build/Makefile_common.am
ac_SOURCES = $(capwap_SOURCES) \
$(top_srcdir)/src/common/capwap_event.c \
$(top_srcdir)/src/common/capwap_lock.c \
$(top_srcdir)/src/common/capwap_rwlock.c \
$(top_srcdir)/src/common/capwap_socket.c \
$(top_srcdir)/src/ac/ac.c \
$(top_srcdir)/src/ac/ac_backend.c \
$(top_srcdir)/src/ac/ac_execute.c \
$(top_srcdir)/src/ac/ac_session.c \
$(top_srcdir)/src/ac/ac_wlans.c \
$(top_srcdir)/src/ac/ac_kmod.c \
$(top_srcdir)/src/ac/ac_ieee80211_data.c \
$(top_srcdir)/src/ac/ac_discovery.c \
$(top_srcdir)/src/ac/ac_80211_json.c \
$(top_srcdir)/src/ac/ac_80211_json_addwlan.c \
$(top_srcdir)/src/ac/ac_80211_json_antenna.c \
$(top_srcdir)/src/ac/ac_80211_json_assignbssid.c \
$(top_srcdir)/src/ac/ac_80211_json_deletewlan.c \
$(top_srcdir)/src/ac/ac_80211_json_directsequencecontrol.c \
$(top_srcdir)/src/ac/ac_80211_json_ie.c \
$(top_srcdir)/src/ac/ac_80211_json_macoperation.c \
$(top_srcdir)/src/ac/ac_80211_json_miccountermeasures.c \
$(top_srcdir)/src/ac/ac_80211_json_multidomaincapability.c \
$(top_srcdir)/src/ac/ac_80211_json_ofdmcontrol.c \
$(top_srcdir)/src/ac/ac_80211_json_rateset.c \
$(top_srcdir)/src/ac/ac_80211_json_rsnaerrorreport.c \
$(top_srcdir)/src/ac/ac_80211_json_statistics.c \
$(top_srcdir)/src/ac/ac_80211_json_supportedrates.c \
$(top_srcdir)/src/ac/ac_80211_json_txpower.c \
$(top_srcdir)/src/ac/ac_80211_json_txpowerlevel.c \
$(top_srcdir)/src/ac/ac_80211_json_updatewlan.c \
$(top_srcdir)/src/ac/ac_80211_json_wtpqos.c \
$(top_srcdir)/src/ac/ac_80211_json_wtpradioconf.c \
$(top_srcdir)/src/ac/ac_80211_json_wtpradiofailalarm.c \
$(top_srcdir)/src/ac/ac_80211_json_wtpradioinformation.c \
$(top_srcdir)/src/ac/ac_dfa_join.c \
$(top_srcdir)/src/ac/ac_dfa_configure.c \
$(top_srcdir)/src/ac/ac_dfa_imagedata.c \
$(top_srcdir)/src/ac/ac_dfa_datacheck.c \
$(top_srcdir)/src/ac/ac_dfa_dtls.c \
$(top_srcdir)/src/ac/ac_dfa_run.c \
$(top_srcdir)/src/ac/ac_dfa_reset.c \
$(top_srcdir)/src/ac/ac_dfa_teardown.c \
$(top_srcdir)/src/ac/ac_soap.c \
$(top_srcdir)/src/common/binding/ieee80211/ieee80211.c
ac_LDADD = $(CONFIG_LIBS) \
$(PTHREAD_LIBS) \
$(LIBXML2_LIBS) \
$(LIBJSON_LIBS) \
$(WOLFSSL_LIBS) \
$(LIBNL_LIBS)

View File

@ -1,71 +0,0 @@
# SmartCAPWAP -- An Open Source CAPWAP WTP / AC
#
# Copyright (C) 2012-2013 Massimo Vellucci <vemax78@gmail.com>
#
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program (see the file COPYING included with this
# distribution); if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
bin_PROGRAMS = wtp
AM_CFLAGS = -D_REENTRANT \
-D_GNU_SOURCE \
-fno-strict-aliasing \
${LIBNL_CFLAGS}
if DTLS_ENABLED
AM_CFLAGS += $(WOLFSSL_CFLAGS)
endif
AM_CFLAGS += -I$(top_srcdir)/build \
-I$(top_srcdir)/src/common \
-I$(top_srcdir)/src/wtp \
-I$(top_srcdir)/src/wtp/kmod \
-I$(top_srcdir)/src/common/binding/ieee80211 \
-I$(top_srcdir)/src/wtp/binding/ieee80211
include $(top_srcdir)/build/Makefile_common.am
wtp_SOURCES = $(capwap_SOURCES) \
$(top_srcdir)/src/wtp/wtp.c \
$(top_srcdir)/src/wtp/wtp_kmod.c \
$(top_srcdir)/src/wtp/wtp_element_helper.c \
$(top_srcdir)/src/wtp/wtp_dfa.c \
$(top_srcdir)/src/wtp/wtp_dfa_idle.c \
$(top_srcdir)/src/wtp/wtp_dfa_discovery.c \
$(top_srcdir)/src/wtp/wtp_dfa_sulking.c \
$(top_srcdir)/src/wtp/wtp_dfa_dtls.c \
$(top_srcdir)/src/wtp/wtp_dfa_join.c \
$(top_srcdir)/src/wtp/wtp_dfa_configure.c \
$(top_srcdir)/src/wtp/wtp_dfa_datacheck.c \
$(top_srcdir)/src/wtp/wtp_dfa_run.c \
$(top_srcdir)/src/wtp/wtp_dfa_reset.c \
$(top_srcdir)/src/wtp/wtp_dfa_imagedata.c \
$(top_srcdir)/src/wtp/wtp_radio.c \
$(top_srcdir)/src/common/binding/ieee80211/ieee80211.c \
$(top_srcdir)/src/wtp/binding/ieee80211/netlink_link.c \
$(top_srcdir)/src/wtp/binding/ieee80211/wifi_drivers.c
wtp_LDADD = $(CONFIG_LIBS) \
$(LIBNL_LIBS)
if DTLS_ENABLED
wtp_LDADD += $(WOLFSSL_LIBS)
endif
if BUILD_WTP_WIFI_DRIVERS_NL80211
wtp_SOURCES += $(top_srcdir)/src/wtp/binding/ieee80211/wifi_nl80211.c
endif

View File

@ -1,6 +1,7 @@
# SmartCAPWAP -- An Open Source CAPWAP WTP / AC
# FreeWTP -- An Open Source CAPWAP AC
#
# Copyright (C) 2012-2013 Massimo Vellucci <vemax78@gmail.com>
# Copyright (C) 2016 Travelping GmbH <info@travelping.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -19,20 +20,26 @@
AC_PREREQ(2.63)
AC_INIT([SmartCAPWAP], [1.2.1], [https://github.com/travelping/smartcapwap], [smartcapwap])
AC_CONFIG_AUX_DIR([build])
AC_INIT([freewtp], [1.3.0], [https://github.com/travelping/freewtp], [freewtp])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.11 -Wall])
AM_INIT_AUTOMAKE([1.11 -Wall foreign subdir-objects silent-rules])
AC_USE_SYSTEM_EXTENSIONS
AM_SILENT_RULES([yes])
# cross-compile macros
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
#
AC_COPYRIGHT("SmartCapwap by Massimo Vellucci <vemax78@gmail.com>")
AC_COPYRIGHT("FreeWTP by Travelping <info@travelping.com>")
AC_REVISION($Revision: 1.0 $)
#
AM_MAINTAINER_MODE
#
AC_PROG_INSTALL
AC_LANG(C)
@ -60,16 +67,6 @@ AC_ARG_ENABLE(
[enable_logging="yes"]
)
AC_ARG_ENABLE([ac],
[AS_HELP_STRING([--enable-ac], [enable ac support])])
AC_ARG_ENABLE(
[wtp],
[AS_HELP_STRING([--disable-wtp], [disable wtp support])],
,
[enable_wtp="yes"]
)
AC_ARG_WITH(
[mem-check],
[AS_HELP_STRING([--with-mem-check=TYPE], [build with debug memory checking, TYPE=no|internal|valgrind])],
@ -82,7 +79,7 @@ AC_ARG_WITH(
[with_mem_check="internal"]
)
# WTP drivers wifi binding
# WTP drivers wifi binding
AC_ARG_ENABLE(
[wifi-drivers-nl80211],
[AS_HELP_STRING([--disable-wifi-drivers-nl80211], [disable WTP support for nl80211 wifi binding])],
@ -91,15 +88,18 @@ AC_ARG_ENABLE(
)
# specify output header file
AM_CONFIG_HEADER(build/config.h)
AM_CONFIG_HEADER(lib/config.h)
#
old_CFLAGS="${CFLAGS}"
AC_PROG_CC([gcc])
CFLAGS="${old_CFLAGS}"
AC_PROG_CC_C99
AC_PROG_CPP
AM_PROG_CC_C_O
AM_PROG_AR
AM_PROG_LIBTOOL
#
AM_CONDITIONAL([DEBUG_BUILD], [test "$enable_debug" = yes])
AM_CONDITIONAL([DEBUG_BUILD], [test "$enable_debug" = yes])
if test "${enable_debug}" = "yes"; then
CFLAGS="${CFLAGS} -DDEBUG -Wall -Werror -g -O0"
@ -171,32 +171,11 @@ LDFLAGS="$saved_LDFLAGS"
AC_DEFINE_UNQUOTED([LIBCONFIG_LOOKUP_INT_ARG], [$LIBCONFIG_LOOKUP_INT_ARG], [config_lookup_int() argument type])
# Check PTHREAD library
AC_CHECK_HEADER([pthread.h], [], [AC_MSG_ERROR(You need the pthread headers)])
AC_CHECK_LIB([pthread], [pthread_create], [PTHREAD_LIBS="-lpthread"], [AC_MSG_ERROR(You need the pthread library)])
AC_CHECK_LIB([ev], [ev_run],, [AC_MSG_ERROR(Required library ev missing)])
# Check SSL library
PKG_CHECK_MODULES([WOLFSSL], [wolfssl >= 3.8.0], [have_wolfssl_ssl="yes"], [have_wolfssl_ssl="no"])
# Check JSON library
if test "${enable_ac}" = "yes"; then
test "x${have_wolfssl_ssl}" != "xyes" && AC_MSG_ERROR(You need the wolfssl library)
PKG_CHECK_MODULES(
[LIBJSON],
[json-c >= 0.11],
[],
[AC_MSG_ERROR(You need the libjson)]
)
# Check XML2 library
PKG_CHECK_MODULES(
[LIBXML2],
[libxml-2.0 >= 2.6]
)
fi
# Check Netlink library
PKG_CHECK_MODULES(
[LIBNL3],
@ -256,10 +235,6 @@ case "${with_mem_check}" in
;;
esac
#
AM_CONDITIONAL([BUILD_AC], [test "${enable_ac}" = "yes"])
AM_CONDITIONAL([BUILD_WTP], [test "${enable_wtp}" = "yes"])
#
test "${enable_logging}" = "yes" && AC_DEFINE([ENABLE_LOGGING], [1], [Enable logging])
@ -271,14 +246,12 @@ AM_CONDITIONAL([DTLS_ENABLED], [test "${enable_dtls}" = "yes"])
AC_SUBST([SSL_CFLAGS])
AC_SUBST([SSL_LIBS])
AC_SUBST([CONFIG_LIBS])
AC_SUBST([PTHREAD_LIBS])
#
AC_CONFIG_FILES([
Makefile
build/Makefile
build/ac/Makefile
build/wtp/Makefile
lib/Makefile
src/Makefile
])
AC_OUTPUT

218
lib/Makefile.am Executable file
View File

@ -0,0 +1,218 @@
# FreeWTP -- An Open Source CAPWAP WTP
#
# Copyright SmartCAPWAP (C) 2012-2013 Massimo Vellucci <vemax78@gmail.com>
# Copyright FreeCAPWAP (C) 2016 Travelping GmbH <info@travelping.com>
#
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program (see the file COPYING included with this
# distribution); if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
AM_CFLAGS = -std=gnu99 -D_GNU_SOURCE
noinst_LTLIBRARIES = libcapwap.la
libcapwap_la_LIBADD = -lwolfssl
libcapwap_la_SOURCES = \
capwap.c \
network.c \
protocol.c \
logging.c \
list.c \
array.c \
hash.c \
dtls.c \
dfa.c \
binding/ieee80211/ieee80211.c \
element.c \
element_acdescriptor.c \
element_acipv4list.c \
element_acipv6list.c \
element_acname.c \
element_acnamepriority.c \
element_actimestamp.c \
element_addmacacl.c \
element_addstation.c \
element_controlipv4.c \
element_controlipv6.c \
element_datatransferdata.c \
element_datatransfermode.c \
element_decrypterrorreport.c \
element_decrypterrorreportperiod.c \
element_deletemacacl.c \
element_deletestation.c \
element_discoverytype.c \
element_duplicateipv4.c \
element_duplicateipv6.c \
element_ecnsupport.c \
element_idletimeout.c \
element_imagedata.c \
element_imageidentifier.c \
element_imageinfo.c \
element_initdownload.c \
element_localipv4.c \
element_localipv6.c \
element_location.c \
element_maximumlength.c \
element_mtudiscovery.c \
element_radioadmstate.c \
element_radiooprstate.c \
element_resultcode.c \
element_returnedmessage.c \
element_sessionid.c \
element_statisticstimer.c \
element_timers.c \
element_transport.c \
element_vendorpayload.c \
element_wtpboarddata.c \
element_wtpdescriptor.c \
element_wtpfallback.c \
element_wtpframetunnelmode.c \
element_wtpmactype.c \
element_wtpname.c \
element_wtpradiostat.c \
element_wtprebootstat.c \
element_wtpstaticipaddress.c \
element_80211_addwlan.c \
element_80211_antenna.c \
element_80211_assignbssid.c \
element_80211_deletewlan.c \
element_80211_directsequencecontrol.c \
element_80211_ie.c \
element_80211_mac_profile.c \
element_80211_macoperation.c \
element_80211_miccountermeasures.c \
element_80211_multidomaincapability.c \
element_80211_ofdmcontrol.c \
element_80211_rateset.c \
element_80211_rsnaerrorreport.c \
element_80211_station.c \
element_80211_stationkey.c \
element_80211_stationqos.c \
element_80211_statistics.c \
element_80211_supported_mac_profiles.c \
element_80211_supportedrates.c \
element_80211_txpower.c \
element_80211_txpowerlevel.c \
element_80211_updatestationqos.c \
element_80211_updatewlan.c \
element_80211_wtpqos.c \
element_80211_wtpradioconf.c \
element_80211_wtpradiofailalarm.c \
element_80211_wtpradioinformation.c \
element_80211n_radioconf.c \
element_80211n_station_information.c \
element_vendor_travelping_wtp_timestamp.c \
element_vendor_travelping_80211_encryption_capability.c \
element_vendor_travelping_80211_update_key.c
noinst_HEADERS = \
error.h \
rfc.h \
capwap.h \
network.h \
protocol.h \
logging.h \
list.h \
array.h \
hash.h \
dtls.h \
capwap_dfa.h \
binding/ieee80211/ieee80211.c \
element.h \
element_acdescriptor.h \
element_acipv4list.h \
element_acipv6list.h \
element_acname.h \
element_acnamepriority.h \
element_actimestamp.h \
element_addmacacl.h \
element_addstation.h \
element_controlipv4.h \
element_controlipv6.h \
element_datatransferdata.h \
element_datatransfermode.h \
element_decrypterrorreport.h \
element_decrypterrorreportperiod.h \
element_deletemacacl.h \
element_deletestation.h \
element_discoverytype.h \
element_duplicateipv4.h \
element_duplicateipv6.h \
element_ecnsupport.h \
element_idletimeout.h \
element_imagedata.h \
element_imageidentifier.h \
element_imageinfo.h \
element_initdownload.h \
element_localipv4.h \
element_localipv6.h \
element_location.h \
element_maximumlength.h \
element_mtudiscovery.h \
element_radioadmstate.h \
element_radiooprstate.h \
element_resultcode.h \
element_returnedmessage.h \
element_sessionid.h \
element_statisticstimer.h \
element_timers.h \
element_transport.h \
element_vendorpayload.h \
element_wtpboarddata.h \
element_wtpdescriptor.h \
element_wtpfallback.h \
element_wtpframetunnelmode.h \
element_wtpmactype.h \
element_wtpname.h \
element_wtpradiostat.h \
element_wtprebootstat.h \
element_wtpstaticipaddress.h \
element_80211_addwlan.h \
element_80211_antenna.h \
element_80211_assignbssid.h \
element_80211_deletewlan.h \
element_80211_directsequencecontrol.h \
element_80211_ie.h \
element_80211_macoperation.h \
element_80211_mac_profile.h \
element_80211_miccountermeasures.h \
element_80211_multidomaincapability.h \
element_80211_ofdmcontrol.h \
element_80211_rateset.h \
element_80211_rsnaerrorreport.h \
element_80211_station.h \
element_80211_stationkey.h \
element_80211_stationqos.h \
element_80211_statistics.h \
element_80211_supported_mac_profiles.h \
element_80211_supportedrates.h \
element_80211_txpower.h \
element_80211_txpowerlevel.h \
element_80211_updatestationqos.h \
element_80211_updatewlan.h \
element_80211_wtpqos.h \
element_80211_wtpradioconf.h \
element_80211_wtpradiofailalarm.h \
element_80211_wtpradioinformation.h \
element_80211n_radioconf.h \
element_80211n_station_information.h \
element_vendor_travelping_wtp_timestamp.h \
element_vendor_travelping_80211_encryption_capability.h \
element_vendor_travelping_80211_update_key.h \
vendor_travelping.h
if DEBUG_BUILD
libcapwap_la_SOURCES += debug.c
noinst_HEADERS += debug.h
endif

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_array.h"
#include "array.h"
/* */
struct capwap_array* capwap_array_create(unsigned short itemsize, unsigned long initcount, int zeroed) {

View File

@ -58,11 +58,10 @@
#endif
/* standard include */
#include "capwap_rfc.h"
#include "capwap_logging.h"
#include "capwap_debug.h"
#include "capwap_error.h"
#include "capwap_timeout.h"
#include "rfc.h"
#include "logging.h"
#include "debug.h"
#include "error.h"
/* Helper exit */
void capwap_exit(int errorcode);

View File

@ -10,8 +10,8 @@
#include <execinfo.h>
#endif
#include "capwap_logging.h"
#include "capwap_error.h"
#include "logging.h"
#include "error.h"
#define BACKTRACE_BUFFER 256

View File

@ -1,6 +1,6 @@
#include "capwap.h"
#include "capwap_dtls.h"
#include "capwap_protocol.h"
#include "dtls.h"
#include "protocol.h"
#include <wolfssl/options.h>
#include <wolfssl/ssl.h>
#include <wolfssl/wolfcrypt/sha.h>

View File

@ -1,8 +1,8 @@
#ifndef __CAPWAP_DTLS_HEADER__
#define __CAPWAP_DTLS_HEADER__
#include "capwap_list.h"
#include "capwap_network.h"
#include "list.h"
#include "network.h"
#define CAPWAP_DTLS_CLIENT 0
#define CAPWAP_DTLS_SERVER 1

View File

@ -1,7 +1,7 @@
#include "capwap.h"
#include "capwap_element.h"
#include "capwap_protocol.h"
#include "capwap_array.h"
#include "element.h"
#include "protocol.h"
#include "array.h"
/* */
#define element_ops(Id, Ops) [(Id) - CAPWAP_MESSAGE_ELEMENTS_START] = &(Ops)

169
lib/element.h Normal file
View File

@ -0,0 +1,169 @@
#ifndef __CAPWAP_ELEMENT_HEADER__
#define __CAPWAP_ELEMENT_HEADER__
#include "array.h"
#include "list.h"
struct capwap_message_element_id
{
uint32_t vendor;
uint16_t type;
};
#define message_element_id_eq(a, b) \
(((a).vendor == (b).vendor) && ((a).type == (b).type))
/* */
typedef void* capwap_message_elements_handle;
struct capwap_write_message_elements_ops {
int (*write_u8)(capwap_message_elements_handle handle, uint8_t data);
int (*write_u16)(capwap_message_elements_handle handle, uint16_t data);
int (*write_u32)(capwap_message_elements_handle handle, uint32_t data);
int (*write_block)(capwap_message_elements_handle handle, const uint8_t* data, unsigned short length);
};
struct capwap_read_message_elements_ops {
unsigned short (*read_ready)(capwap_message_elements_handle handle);
int (*read_u8)(capwap_message_elements_handle handle, uint8_t* data);
int (*read_u16)(capwap_message_elements_handle handle, uint16_t* data);
int (*read_u32)(capwap_message_elements_handle handle, uint32_t* data);
int (*read_block)(capwap_message_elements_handle handle, uint8_t* data, unsigned short length);
};
struct capwap_message_elements_ops
{
int category;
/* Build message element */
void (*create)(void* data, capwap_message_elements_handle handle, struct capwap_write_message_elements_ops* func);
/* Parsing message element */
void* (*parse)(capwap_message_elements_handle handle, struct capwap_read_message_elements_ops* func);
/* Memory management */
void* (*clone)(void*);
void (*free)(void*);
};
const struct capwap_message_elements_ops *capwap_get_message_element_ops(const struct capwap_message_element_id id);
/*********************************************************************************************************************/
/* Standard message elements */
#include "element_acdescriptor.h" /* 00001 */
#include "element_acipv4list.h" /* 00002 */
#include "element_acipv6list.h" /* 00003 */
#include "element_acname.h" /* 00004 */
#include "element_acnamepriority.h" /* 00005 */
#include "element_actimestamp.h" /* 00006 */
#include "element_addmacacl.h" /* 00007 */
#include "element_addstation.h" /* 00008 */
/* Reserved */ /* 00009 */
#include "element_controlipv4.h" /* 00010 */
#include "element_controlipv6.h" /* 00011 */
#include "element_timers.h" /* 00012 */
#include "element_datatransferdata.h" /* 00013 */
#include "element_datatransfermode.h" /* 00014 */
#include "element_decrypterrorreport.h" /* 00015 */
#include "element_decrypterrorreportperiod.h" /* 00016 */
#include "element_deletemacacl.h" /* 00017 */
#include "element_deletestation.h" /* 00018 */
/* Reserved */ /* 00019 */
#include "element_discoverytype.h" /* 00020 */
#include "element_duplicateipv4.h" /* 00021 */
#include "element_duplicateipv6.h" /* 00022 */
#include "element_idletimeout.h" /* 00023 */
#include "element_imagedata.h" /* 00024 */
#include "element_imageidentifier.h" /* 00025 */
#include "element_imageinfo.h" /* 00026 */
#include "element_initdownload.h" /* 00027 */
#include "element_location.h" /* 00028 */
#include "element_maximumlength.h" /* 00029 */
#include "element_localipv4.h" /* 00030 */
#include "element_radioadmstate.h" /* 00031 */
#include "element_radiooprstate.h" /* 00032 */
#include "element_resultcode.h" /* 00033 */
#include "element_returnedmessage.h" /* 00034 */
#include "element_sessionid.h" /* 00035 */
#include "element_statisticstimer.h" /* 00036 */
#include "element_vendorpayload.h" /* 00037 */
#include "element_wtpboarddata.h" /* 00038 */
#include "element_wtpdescriptor.h" /* 00039 */
#include "element_wtpfallback.h" /* 00040 */
#include "element_wtpframetunnelmode.h" /* 00041 */
/* Reserved */ /* 00042 */
/* Reserved */ /* 00043 */
#include "element_wtpmactype.h" /* 00044 */
#include "element_wtpname.h" /* 00045 */
/* Reserved */ /* 00046 */
#include "element_wtpradiostat.h" /* 00047 */
#include "element_wtprebootstat.h" /* 00048 */
#include "element_wtpstaticipaddress.h" /* 00049 */
#include "element_localipv6.h" /* 00050 */
#include "element_transport.h" /* 00051 */
#include "element_mtudiscovery.h" /* 00052 */
#include "element_ecnsupport.h" /* 00053 */
/* IEEE 802.11 message elements */
#include "element_80211_addwlan.h" /* 01024 */
#include "element_80211_antenna.h" /* 01025 */
#include "element_80211_assignbssid.h" /* 01026 */
#include "element_80211_deletewlan.h" /* 01027 */
#include "element_80211_directsequencecontrol.h" /* 01028 */
#include "element_80211_ie.h" /* 01029 */
#include "element_80211_macoperation.h" /* 01030 */
#include "element_80211_miccountermeasures.h" /* 01031 */
#include "element_80211_multidomaincapability.h" /* 01032 */
#include "element_80211_ofdmcontrol.h" /* 01033 */
#include "element_80211_rateset.h" /* 01034 */
#include "element_80211_rsnaerrorreport.h" /* 01035 */
#include "element_80211_station.h" /* 01036 */
#include "element_80211_stationqos.h" /* 01037 */
#include "element_80211_stationkey.h" /* 01038 */
#include "element_80211_statistics.h" /* 01039 */
#include "element_80211_supportedrates.h" /* 01040 */
#include "element_80211_txpower.h" /* 01041 */
#include "element_80211_txpowerlevel.h" /* 01042 */
#include "element_80211_updatestationqos.h" /* 01043 */
#include "element_80211_updatewlan.h" /* 01044 */
#include "element_80211_wtpqos.h" /* 01045 */
#include "element_80211_wtpradioconf.h" /* 01046 */
#include "element_80211_wtpradiofailalarm.h" /* 01047 */
#include "element_80211_wtpradioinformation.h" /* 01048 */
#include "element_80211_supported_mac_profiles.h" /* 01060 */
#include "element_80211_mac_profile.h" /* 01061 */
#include "vendor_travelping.h"
/*********************************************************************************************************************/
#define CAPWAP_MESSAGE_ELEMENT_SINGLE 0
#define CAPWAP_MESSAGE_ELEMENT_ARRAY 1
int capwap_get_message_element_category(uint16_t type);
struct capwap_message_element_itemlist
{
struct capwap_message_element_id id;
int category;
void* data;
};
struct capwap_parsed_packet {
struct capwap_packet_rxmng* rxmngpacket;
struct capwap_list* messages;
};
/* */
#define PARSING_COMPLETE 0
#define UNRECOGNIZED_MESSAGE_ELEMENT 1
#define INVALID_MESSAGE_ELEMENT 2
int capwap_parsing_packet(struct capwap_packet_rxmng* rxmngpacket, struct capwap_parsed_packet* packet);
int capwap_validate_parsed_packet(struct capwap_parsed_packet* packet, struct capwap_array* returnedmessage);
void capwap_free_parsed_packet(struct capwap_parsed_packet* packet);
struct capwap_list_item *capwap_get_message_element(struct capwap_parsed_packet *packet,
const struct capwap_message_element_id id);
void *capwap_get_message_element_data(struct capwap_parsed_packet *packet,
const struct capwap_message_element_id id);
#endif /* __CAPWAP_ELEMENT_HEADER__ */

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/*
* The IEEE 802.11 MAC Profile message element allows the AC to select a

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/*
* The IEEE 802.11 Supported MAC Profile message element allows the WTP

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/*
* 0 1 2 3

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/*
* 0 1 2 3

View File

@ -1,6 +1,6 @@
#include "capwap.h"
#include "capwap_array.h"
#include "capwap_element.h"
#include "array.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

View File

@ -1,5 +1,5 @@
#include "capwap.h"
#include "capwap_element.h"
#include "element.h"
/********************************************************************

Some files were not shown because too many files have changed in this diff Show More