[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit
Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/Makefile.am b/ap/lib/libnl/libnl-3.2.25/tests/Makefile.am
new file mode 100644
index 0000000..255033d
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/Makefile.am
@@ -0,0 +1,67 @@
+# -*- Makefile -*-
+
+EXTRA_DIST = \
+ util.h
+
+if ENABLE_UNIT_TESTS
+
+AM_CPPFLAGS = -Wall -I${top_srcdir}/include -I${top_builddir}/include -D_GNU_SOURCE -DSYSCONFDIR=\"$(sysconfdir)/libnl\"
+
+LDADD = \
+ ${top_builddir}/lib/libnl-3.la \
+ ${top_builddir}/lib/libnl-nf-3.la \
+ ${top_builddir}/lib/libnl-genl-3.la \
+ ${top_builddir}/lib/libnl-route-3.la \
+ @CHECK_LIBS@
+
+AM_CFLAGS = @CHECK_CFLAGS@
+
+UNIT_TESTS = check-all
+
+check_PROGRAMS = \
+ test-create-bond \
+ test-create-vlan \
+ test-create-vxlan \
+ test-create-veth \
+ test-create-bridge \
+ test-create-ip6tnl \
+ test-create-ipgre \
+ test-create-ipip \
+ test-create-ipvti \
+ test-create-sit \
+ test-delete-link \
+ test-socket-creation \
+ test-complex-HTB-with-hash-filters \
+ test-u32-filter-with-actions \
+ ${UNIT_TESTS}
+
+TESTS = \
+ ${UNIT_TESTS}
+
+if ENABLE_CLI
+LDADD += ${top_builddir}/src/lib/libnl-cli-3.la
+check_PROGRAMS += \
+ test-cache-mngr \
+ test-genl \
+ test-nf-cache-mngr
+endif
+
+test_cache_mngr_SOURCES = test-cache-mngr.c
+test_create_bond_SOURCES = test-create-bond.c
+test_create_vlan_SOURCES = test-create-vlan.c
+test_create_vxlan_SOURCES = test-create-vxlan.c
+test_create_veth_SOURCES = test-create-veth.c
+test_create_bridge_SOURCES = test-create-bridge.c
+test_delete_link_SOURCES = test-delete-link.c
+test_genl_SOURCES = test-genl.c
+test_nf_cache_mngr_SOURCES = test-nf-cache-mngr.c
+test_socket_creation_SOURCES = test-socket-creation.c
+test_complex_HTB_with_hash_filters_SOURCES = test-complex-HTB-with-hash-filters.c
+test_u32_filter_with_actions_SOURCES = test-u32-filter-with-actions.c
+
+# Unit tests
+check_all_SOURCES = \
+ check-all.c \
+ check-addr.c \
+ check-attr.c
+endif
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/Makefile.in b/ap/lib/libnl/libnl-3.2.25/tests/Makefile.in
new file mode 100644
index 0000000..4cf6b27
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/Makefile.in
@@ -0,0 +1,1311 @@
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# -*- Makefile -*-
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@ENABLE_UNIT_TESTS_TRUE@check_PROGRAMS = test-create-bond$(EXEEXT) \
+@ENABLE_UNIT_TESTS_TRUE@ test-create-vlan$(EXEEXT) \
+@ENABLE_UNIT_TESTS_TRUE@ test-create-vxlan$(EXEEXT) \
+@ENABLE_UNIT_TESTS_TRUE@ test-create-veth$(EXEEXT) \
+@ENABLE_UNIT_TESTS_TRUE@ test-create-bridge$(EXEEXT) \
+@ENABLE_UNIT_TESTS_TRUE@ test-create-ip6tnl$(EXEEXT) \
+@ENABLE_UNIT_TESTS_TRUE@ test-create-ipgre$(EXEEXT) \
+@ENABLE_UNIT_TESTS_TRUE@ test-create-ipip$(EXEEXT) \
+@ENABLE_UNIT_TESTS_TRUE@ test-create-ipvti$(EXEEXT) \
+@ENABLE_UNIT_TESTS_TRUE@ test-create-sit$(EXEEXT) \
+@ENABLE_UNIT_TESTS_TRUE@ test-delete-link$(EXEEXT) \
+@ENABLE_UNIT_TESTS_TRUE@ test-socket-creation$(EXEEXT) \
+@ENABLE_UNIT_TESTS_TRUE@ test-complex-HTB-with-hash-filters$(EXEEXT) \
+@ENABLE_UNIT_TESTS_TRUE@ test-u32-filter-with-actions$(EXEEXT) \
+@ENABLE_UNIT_TESTS_TRUE@ $(am__EXEEXT_1) $(am__EXEEXT_2)
+@ENABLE_UNIT_TESTS_TRUE@TESTS = $(am__EXEEXT_1)
+@ENABLE_CLI_TRUE@@ENABLE_UNIT_TESTS_TRUE@am__append_1 = ${top_builddir}/src/lib/libnl-cli-3.la
+@ENABLE_CLI_TRUE@@ENABLE_UNIT_TESTS_TRUE@am__append_2 = \
+@ENABLE_CLI_TRUE@@ENABLE_UNIT_TESTS_TRUE@ test-cache-mngr \
+@ENABLE_CLI_TRUE@@ENABLE_UNIT_TESTS_TRUE@ test-genl \
+@ENABLE_CLI_TRUE@@ENABLE_UNIT_TESTS_TRUE@ test-nf-cache-mngr
+
+subdir = tests
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/build-aux/depcomp \
+ $(top_srcdir)/build-aux/test-driver
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/lib/defs.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+@ENABLE_UNIT_TESTS_TRUE@am__EXEEXT_1 = check-all$(EXEEXT)
+@ENABLE_CLI_TRUE@@ENABLE_UNIT_TESTS_TRUE@am__EXEEXT_2 = test-cache-mngr$(EXEEXT) \
+@ENABLE_CLI_TRUE@@ENABLE_UNIT_TESTS_TRUE@ test-genl$(EXEEXT) \
+@ENABLE_CLI_TRUE@@ENABLE_UNIT_TESTS_TRUE@ test-nf-cache-mngr$(EXEEXT)
+am__check_all_SOURCES_DIST = check-all.c check-addr.c check-attr.c
+@ENABLE_UNIT_TESTS_TRUE@am_check_all_OBJECTS = check-all.$(OBJEXT) \
+@ENABLE_UNIT_TESTS_TRUE@ check-addr.$(OBJEXT) \
+@ENABLE_UNIT_TESTS_TRUE@ check-attr.$(OBJEXT)
+check_all_OBJECTS = $(am_check_all_OBJECTS)
+check_all_LDADD = $(LDADD)
+@ENABLE_UNIT_TESTS_TRUE@check_all_DEPENDENCIES = \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-nf-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-genl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-route-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ $(am__append_1)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+am__test_cache_mngr_SOURCES_DIST = test-cache-mngr.c
+@ENABLE_UNIT_TESTS_TRUE@am_test_cache_mngr_OBJECTS = \
+@ENABLE_UNIT_TESTS_TRUE@ test-cache-mngr.$(OBJEXT)
+test_cache_mngr_OBJECTS = $(am_test_cache_mngr_OBJECTS)
+test_cache_mngr_LDADD = $(LDADD)
+@ENABLE_UNIT_TESTS_TRUE@test_cache_mngr_DEPENDENCIES = \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-nf-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-genl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-route-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ $(am__append_1)
+am__test_complex_HTB_with_hash_filters_SOURCES_DIST = \
+ test-complex-HTB-with-hash-filters.c
+@ENABLE_UNIT_TESTS_TRUE@am_test_complex_HTB_with_hash_filters_OBJECTS = test-complex-HTB-with-hash-filters.$(OBJEXT)
+test_complex_HTB_with_hash_filters_OBJECTS = \
+ $(am_test_complex_HTB_with_hash_filters_OBJECTS)
+test_complex_HTB_with_hash_filters_LDADD = $(LDADD)
+@ENABLE_UNIT_TESTS_TRUE@test_complex_HTB_with_hash_filters_DEPENDENCIES = \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-nf-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-genl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-route-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ $(am__append_1)
+am__test_create_bond_SOURCES_DIST = test-create-bond.c
+@ENABLE_UNIT_TESTS_TRUE@am_test_create_bond_OBJECTS = \
+@ENABLE_UNIT_TESTS_TRUE@ test-create-bond.$(OBJEXT)
+test_create_bond_OBJECTS = $(am_test_create_bond_OBJECTS)
+test_create_bond_LDADD = $(LDADD)
+@ENABLE_UNIT_TESTS_TRUE@test_create_bond_DEPENDENCIES = \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-nf-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-genl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-route-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ $(am__append_1)
+am__test_create_bridge_SOURCES_DIST = test-create-bridge.c
+@ENABLE_UNIT_TESTS_TRUE@am_test_create_bridge_OBJECTS = \
+@ENABLE_UNIT_TESTS_TRUE@ test-create-bridge.$(OBJEXT)
+test_create_bridge_OBJECTS = $(am_test_create_bridge_OBJECTS)
+test_create_bridge_LDADD = $(LDADD)
+@ENABLE_UNIT_TESTS_TRUE@test_create_bridge_DEPENDENCIES = \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-nf-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-genl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-route-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ $(am__append_1)
+test_create_ip6tnl_SOURCES = test-create-ip6tnl.c
+test_create_ip6tnl_OBJECTS = test-create-ip6tnl.$(OBJEXT)
+test_create_ip6tnl_LDADD = $(LDADD)
+@ENABLE_UNIT_TESTS_TRUE@test_create_ip6tnl_DEPENDENCIES = \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-nf-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-genl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-route-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ $(am__append_1)
+test_create_ipgre_SOURCES = test-create-ipgre.c
+test_create_ipgre_OBJECTS = test-create-ipgre.$(OBJEXT)
+test_create_ipgre_LDADD = $(LDADD)
+@ENABLE_UNIT_TESTS_TRUE@test_create_ipgre_DEPENDENCIES = \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-nf-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-genl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-route-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ $(am__append_1)
+test_create_ipip_SOURCES = test-create-ipip.c
+test_create_ipip_OBJECTS = test-create-ipip.$(OBJEXT)
+test_create_ipip_LDADD = $(LDADD)
+@ENABLE_UNIT_TESTS_TRUE@test_create_ipip_DEPENDENCIES = \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-nf-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-genl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-route-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ $(am__append_1)
+test_create_ipvti_SOURCES = test-create-ipvti.c
+test_create_ipvti_OBJECTS = test-create-ipvti.$(OBJEXT)
+test_create_ipvti_LDADD = $(LDADD)
+@ENABLE_UNIT_TESTS_TRUE@test_create_ipvti_DEPENDENCIES = \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-nf-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-genl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-route-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ $(am__append_1)
+test_create_sit_SOURCES = test-create-sit.c
+test_create_sit_OBJECTS = test-create-sit.$(OBJEXT)
+test_create_sit_LDADD = $(LDADD)
+@ENABLE_UNIT_TESTS_TRUE@test_create_sit_DEPENDENCIES = \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-nf-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-genl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-route-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ $(am__append_1)
+am__test_create_veth_SOURCES_DIST = test-create-veth.c
+@ENABLE_UNIT_TESTS_TRUE@am_test_create_veth_OBJECTS = \
+@ENABLE_UNIT_TESTS_TRUE@ test-create-veth.$(OBJEXT)
+test_create_veth_OBJECTS = $(am_test_create_veth_OBJECTS)
+test_create_veth_LDADD = $(LDADD)
+@ENABLE_UNIT_TESTS_TRUE@test_create_veth_DEPENDENCIES = \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-nf-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-genl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-route-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ $(am__append_1)
+am__test_create_vlan_SOURCES_DIST = test-create-vlan.c
+@ENABLE_UNIT_TESTS_TRUE@am_test_create_vlan_OBJECTS = \
+@ENABLE_UNIT_TESTS_TRUE@ test-create-vlan.$(OBJEXT)
+test_create_vlan_OBJECTS = $(am_test_create_vlan_OBJECTS)
+test_create_vlan_LDADD = $(LDADD)
+@ENABLE_UNIT_TESTS_TRUE@test_create_vlan_DEPENDENCIES = \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-nf-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-genl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-route-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ $(am__append_1)
+am__test_create_vxlan_SOURCES_DIST = test-create-vxlan.c
+@ENABLE_UNIT_TESTS_TRUE@am_test_create_vxlan_OBJECTS = \
+@ENABLE_UNIT_TESTS_TRUE@ test-create-vxlan.$(OBJEXT)
+test_create_vxlan_OBJECTS = $(am_test_create_vxlan_OBJECTS)
+test_create_vxlan_LDADD = $(LDADD)
+@ENABLE_UNIT_TESTS_TRUE@test_create_vxlan_DEPENDENCIES = \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-nf-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-genl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-route-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ $(am__append_1)
+am__test_delete_link_SOURCES_DIST = test-delete-link.c
+@ENABLE_UNIT_TESTS_TRUE@am_test_delete_link_OBJECTS = \
+@ENABLE_UNIT_TESTS_TRUE@ test-delete-link.$(OBJEXT)
+test_delete_link_OBJECTS = $(am_test_delete_link_OBJECTS)
+test_delete_link_LDADD = $(LDADD)
+@ENABLE_UNIT_TESTS_TRUE@test_delete_link_DEPENDENCIES = \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-nf-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-genl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-route-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ $(am__append_1)
+am__test_genl_SOURCES_DIST = test-genl.c
+@ENABLE_UNIT_TESTS_TRUE@am_test_genl_OBJECTS = test-genl.$(OBJEXT)
+test_genl_OBJECTS = $(am_test_genl_OBJECTS)
+test_genl_LDADD = $(LDADD)
+@ENABLE_UNIT_TESTS_TRUE@test_genl_DEPENDENCIES = \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-nf-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-genl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-route-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ $(am__append_1)
+am__test_nf_cache_mngr_SOURCES_DIST = test-nf-cache-mngr.c
+@ENABLE_UNIT_TESTS_TRUE@am_test_nf_cache_mngr_OBJECTS = \
+@ENABLE_UNIT_TESTS_TRUE@ test-nf-cache-mngr.$(OBJEXT)
+test_nf_cache_mngr_OBJECTS = $(am_test_nf_cache_mngr_OBJECTS)
+test_nf_cache_mngr_LDADD = $(LDADD)
+@ENABLE_UNIT_TESTS_TRUE@test_nf_cache_mngr_DEPENDENCIES = \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-nf-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-genl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-route-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ $(am__append_1)
+am__test_socket_creation_SOURCES_DIST = test-socket-creation.c
+@ENABLE_UNIT_TESTS_TRUE@am_test_socket_creation_OBJECTS = \
+@ENABLE_UNIT_TESTS_TRUE@ test-socket-creation.$(OBJEXT)
+test_socket_creation_OBJECTS = $(am_test_socket_creation_OBJECTS)
+test_socket_creation_LDADD = $(LDADD)
+@ENABLE_UNIT_TESTS_TRUE@test_socket_creation_DEPENDENCIES = \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-nf-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-genl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-route-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ $(am__append_1)
+am__test_u32_filter_with_actions_SOURCES_DIST = \
+ test-u32-filter-with-actions.c
+@ENABLE_UNIT_TESTS_TRUE@am_test_u32_filter_with_actions_OBJECTS = test-u32-filter-with-actions.$(OBJEXT)
+test_u32_filter_with_actions_OBJECTS = \
+ $(am_test_u32_filter_with_actions_OBJECTS)
+test_u32_filter_with_actions_LDADD = $(LDADD)
+@ENABLE_UNIT_TESTS_TRUE@test_u32_filter_with_actions_DEPENDENCIES = \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-nf-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-genl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-route-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ $(am__append_1)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/lib
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(check_all_SOURCES) $(test_cache_mngr_SOURCES) \
+ $(test_complex_HTB_with_hash_filters_SOURCES) \
+ $(test_create_bond_SOURCES) $(test_create_bridge_SOURCES) \
+ test-create-ip6tnl.c test-create-ipgre.c test-create-ipip.c \
+ test-create-ipvti.c test-create-sit.c \
+ $(test_create_veth_SOURCES) $(test_create_vlan_SOURCES) \
+ $(test_create_vxlan_SOURCES) $(test_delete_link_SOURCES) \
+ $(test_genl_SOURCES) $(test_nf_cache_mngr_SOURCES) \
+ $(test_socket_creation_SOURCES) \
+ $(test_u32_filter_with_actions_SOURCES)
+DIST_SOURCES = $(am__check_all_SOURCES_DIST) \
+ $(am__test_cache_mngr_SOURCES_DIST) \
+ $(am__test_complex_HTB_with_hash_filters_SOURCES_DIST) \
+ $(am__test_create_bond_SOURCES_DIST) \
+ $(am__test_create_bridge_SOURCES_DIST) test-create-ip6tnl.c \
+ test-create-ipgre.c test-create-ipip.c test-create-ipvti.c \
+ test-create-sit.c $(am__test_create_veth_SOURCES_DIST) \
+ $(am__test_create_vlan_SOURCES_DIST) \
+ $(am__test_create_vxlan_SOURCES_DIST) \
+ $(am__test_delete_link_SOURCES_DIST) \
+ $(am__test_genl_SOURCES_DIST) \
+ $(am__test_nf_cache_mngr_SOURCES_DIST) \
+ $(am__test_socket_creation_SOURCES_DIST) \
+ $(am__test_u32_filter_with_actions_SOURCES_DIST)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red='[0;31m'; \
+ grn='[0;32m'; \
+ lgn='[1;32m'; \
+ blu='[1;34m'; \
+ mgn='[0;35m'; \
+ brg='[1m'; \
+ std='[m'; \
+ fi; \
+}
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__recheck_rx = ^[ ]*:recheck:[ ]*
+am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
+am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+ recheck = 1; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ { \
+ if ((getline line2 < ($$0 ".log")) < 0) \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+ { \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+ { \
+ break; \
+ } \
+ }; \
+ if (recheck) \
+ print $$0; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+ print "fatal: making $@: " msg | "cat >&2"; \
+ exit 1; \
+} \
+function rst_section(header) \
+{ \
+ print header; \
+ len = length(header); \
+ for (i = 1; i <= len; i = i + 1) \
+ printf "="; \
+ printf "\n\n"; \
+} \
+{ \
+ copy_in_global_log = 1; \
+ global_test_result = "RUN"; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".trs"); \
+ if (line ~ /$(am__global_test_result_rx)/) \
+ { \
+ sub("$(am__global_test_result_rx)", "", line); \
+ sub("[ ]*$$", "", line); \
+ global_test_result = line; \
+ } \
+ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+ copy_in_global_log = 0; \
+ }; \
+ if (copy_in_global_log) \
+ { \
+ rst_section(global_test_result ": " $$0); \
+ while ((rc = (getline line < ($$0 ".log"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".log"); \
+ print line; \
+ }; \
+ printf "\n"; \
+ }; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test. Creates the
+# directory for the log if needed. Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log. Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+case "$@" in \
+ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
+ *) am__odir=.;; \
+esac; \
+test "x$$am__odir" = x"." || test -d "$$am__odir" \
+ || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi; \
+case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
+ am__expect_failure=yes;; \
+ *) \
+ am__expect_failure=no;; \
+esac; \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed). The result is saved in the shell variable
+# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+AM_RECURSIVE_TARGETS = check recheck
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
+LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
+am__set_b = \
+ case '$@' in \
+ */*) \
+ case '$*' in \
+ */*) b='$*';; \
+ *) b=`echo '$@' | sed 's/\.log$$//'`; \
+ esac;; \
+ *) \
+ b='$*';; \
+ esac
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+ $(TEST_LOG_FLAGS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHECK_CFLAGS = @CHECK_CFLAGS@
+CHECK_LIBS = @CHECK_LIBS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FLEX = @FLEX@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBNL_VERSION = @LIBNL_VERSION@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_REVISION = @LT_REVISION@
+MAJ_VERSION = @MAJ_VERSION@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MIC_VERSION = @MIC_VERSION@
+MIN_VERSION = @MIN_VERSION@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+YACC = @YACC@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgconfigdir = @pkgconfigdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = \
+ util.h
+
+@ENABLE_UNIT_TESTS_TRUE@AM_CPPFLAGS = -Wall -I${top_srcdir}/include -I${top_builddir}/include -D_GNU_SOURCE -DSYSCONFDIR=\"$(sysconfdir)/libnl\"
+@ENABLE_UNIT_TESTS_TRUE@LDADD = ${top_builddir}/lib/libnl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-nf-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-genl-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ ${top_builddir}/lib/libnl-route-3.la \
+@ENABLE_UNIT_TESTS_TRUE@ @CHECK_LIBS@ $(am__append_1)
+@ENABLE_UNIT_TESTS_TRUE@AM_CFLAGS = @CHECK_CFLAGS@
+@ENABLE_UNIT_TESTS_TRUE@UNIT_TESTS = check-all
+@ENABLE_UNIT_TESTS_TRUE@test_cache_mngr_SOURCES = test-cache-mngr.c
+@ENABLE_UNIT_TESTS_TRUE@test_create_bond_SOURCES = test-create-bond.c
+@ENABLE_UNIT_TESTS_TRUE@test_create_vlan_SOURCES = test-create-vlan.c
+@ENABLE_UNIT_TESTS_TRUE@test_create_vxlan_SOURCES = test-create-vxlan.c
+@ENABLE_UNIT_TESTS_TRUE@test_create_veth_SOURCES = test-create-veth.c
+@ENABLE_UNIT_TESTS_TRUE@test_create_bridge_SOURCES = test-create-bridge.c
+@ENABLE_UNIT_TESTS_TRUE@test_delete_link_SOURCES = test-delete-link.c
+@ENABLE_UNIT_TESTS_TRUE@test_genl_SOURCES = test-genl.c
+@ENABLE_UNIT_TESTS_TRUE@test_nf_cache_mngr_SOURCES = test-nf-cache-mngr.c
+@ENABLE_UNIT_TESTS_TRUE@test_socket_creation_SOURCES = test-socket-creation.c
+@ENABLE_UNIT_TESTS_TRUE@test_complex_HTB_with_hash_filters_SOURCES = test-complex-HTB-with-hash-filters.c
+@ENABLE_UNIT_TESTS_TRUE@test_u32_filter_with_actions_SOURCES = test-u32-filter-with-actions.c
+
+# Unit tests
+@ENABLE_UNIT_TESTS_TRUE@check_all_SOURCES = \
+@ENABLE_UNIT_TESTS_TRUE@ check-all.c \
+@ENABLE_UNIT_TESTS_TRUE@ check-addr.c \
+@ENABLE_UNIT_TESTS_TRUE@ check-attr.c
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign tests/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-checkPROGRAMS:
+ @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+check-all$(EXEEXT): $(check_all_OBJECTS) $(check_all_DEPENDENCIES) $(EXTRA_check_all_DEPENDENCIES)
+ @rm -f check-all$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_all_OBJECTS) $(check_all_LDADD) $(LIBS)
+
+test-cache-mngr$(EXEEXT): $(test_cache_mngr_OBJECTS) $(test_cache_mngr_DEPENDENCIES) $(EXTRA_test_cache_mngr_DEPENDENCIES)
+ @rm -f test-cache-mngr$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_cache_mngr_OBJECTS) $(test_cache_mngr_LDADD) $(LIBS)
+
+test-complex-HTB-with-hash-filters$(EXEEXT): $(test_complex_HTB_with_hash_filters_OBJECTS) $(test_complex_HTB_with_hash_filters_DEPENDENCIES) $(EXTRA_test_complex_HTB_with_hash_filters_DEPENDENCIES)
+ @rm -f test-complex-HTB-with-hash-filters$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_complex_HTB_with_hash_filters_OBJECTS) $(test_complex_HTB_with_hash_filters_LDADD) $(LIBS)
+
+test-create-bond$(EXEEXT): $(test_create_bond_OBJECTS) $(test_create_bond_DEPENDENCIES) $(EXTRA_test_create_bond_DEPENDENCIES)
+ @rm -f test-create-bond$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_create_bond_OBJECTS) $(test_create_bond_LDADD) $(LIBS)
+
+test-create-bridge$(EXEEXT): $(test_create_bridge_OBJECTS) $(test_create_bridge_DEPENDENCIES) $(EXTRA_test_create_bridge_DEPENDENCIES)
+ @rm -f test-create-bridge$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_create_bridge_OBJECTS) $(test_create_bridge_LDADD) $(LIBS)
+
+test-create-ip6tnl$(EXEEXT): $(test_create_ip6tnl_OBJECTS) $(test_create_ip6tnl_DEPENDENCIES) $(EXTRA_test_create_ip6tnl_DEPENDENCIES)
+ @rm -f test-create-ip6tnl$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_create_ip6tnl_OBJECTS) $(test_create_ip6tnl_LDADD) $(LIBS)
+
+test-create-ipgre$(EXEEXT): $(test_create_ipgre_OBJECTS) $(test_create_ipgre_DEPENDENCIES) $(EXTRA_test_create_ipgre_DEPENDENCIES)
+ @rm -f test-create-ipgre$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_create_ipgre_OBJECTS) $(test_create_ipgre_LDADD) $(LIBS)
+
+test-create-ipip$(EXEEXT): $(test_create_ipip_OBJECTS) $(test_create_ipip_DEPENDENCIES) $(EXTRA_test_create_ipip_DEPENDENCIES)
+ @rm -f test-create-ipip$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_create_ipip_OBJECTS) $(test_create_ipip_LDADD) $(LIBS)
+
+test-create-ipvti$(EXEEXT): $(test_create_ipvti_OBJECTS) $(test_create_ipvti_DEPENDENCIES) $(EXTRA_test_create_ipvti_DEPENDENCIES)
+ @rm -f test-create-ipvti$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_create_ipvti_OBJECTS) $(test_create_ipvti_LDADD) $(LIBS)
+
+test-create-sit$(EXEEXT): $(test_create_sit_OBJECTS) $(test_create_sit_DEPENDENCIES) $(EXTRA_test_create_sit_DEPENDENCIES)
+ @rm -f test-create-sit$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_create_sit_OBJECTS) $(test_create_sit_LDADD) $(LIBS)
+
+test-create-veth$(EXEEXT): $(test_create_veth_OBJECTS) $(test_create_veth_DEPENDENCIES) $(EXTRA_test_create_veth_DEPENDENCIES)
+ @rm -f test-create-veth$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_create_veth_OBJECTS) $(test_create_veth_LDADD) $(LIBS)
+
+test-create-vlan$(EXEEXT): $(test_create_vlan_OBJECTS) $(test_create_vlan_DEPENDENCIES) $(EXTRA_test_create_vlan_DEPENDENCIES)
+ @rm -f test-create-vlan$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_create_vlan_OBJECTS) $(test_create_vlan_LDADD) $(LIBS)
+
+test-create-vxlan$(EXEEXT): $(test_create_vxlan_OBJECTS) $(test_create_vxlan_DEPENDENCIES) $(EXTRA_test_create_vxlan_DEPENDENCIES)
+ @rm -f test-create-vxlan$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_create_vxlan_OBJECTS) $(test_create_vxlan_LDADD) $(LIBS)
+
+test-delete-link$(EXEEXT): $(test_delete_link_OBJECTS) $(test_delete_link_DEPENDENCIES) $(EXTRA_test_delete_link_DEPENDENCIES)
+ @rm -f test-delete-link$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_delete_link_OBJECTS) $(test_delete_link_LDADD) $(LIBS)
+
+test-genl$(EXEEXT): $(test_genl_OBJECTS) $(test_genl_DEPENDENCIES) $(EXTRA_test_genl_DEPENDENCIES)
+ @rm -f test-genl$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_genl_OBJECTS) $(test_genl_LDADD) $(LIBS)
+
+test-nf-cache-mngr$(EXEEXT): $(test_nf_cache_mngr_OBJECTS) $(test_nf_cache_mngr_DEPENDENCIES) $(EXTRA_test_nf_cache_mngr_DEPENDENCIES)
+ @rm -f test-nf-cache-mngr$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_nf_cache_mngr_OBJECTS) $(test_nf_cache_mngr_LDADD) $(LIBS)
+
+test-socket-creation$(EXEEXT): $(test_socket_creation_OBJECTS) $(test_socket_creation_DEPENDENCIES) $(EXTRA_test_socket_creation_DEPENDENCIES)
+ @rm -f test-socket-creation$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_socket_creation_OBJECTS) $(test_socket_creation_LDADD) $(LIBS)
+
+test-u32-filter-with-actions$(EXEEXT): $(test_u32_filter_with_actions_OBJECTS) $(test_u32_filter_with_actions_DEPENDENCIES) $(EXTRA_test_u32_filter_with_actions_DEPENDENCIES)
+ @rm -f test-u32-filter-with-actions$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_u32_filter_with_actions_OBJECTS) $(test_u32_filter_with_actions_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check-addr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check-all.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check-attr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cache-mngr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-complex-HTB-with-hash-filters.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-create-bond.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-create-bridge.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-create-ip6tnl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-create-ipgre.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-create-ipip.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-create-ipvti.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-create-sit.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-create-veth.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-create-vlan.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-create-vxlan.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-delete-link.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-genl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-nf-cache-mngr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-socket-creation.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-u32-filter-with-actions.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+ rm -f $< $@
+ $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+ @:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__set_TESTS_bases); \
+ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+ redo_bases=`for i in $$bases; do \
+ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+ done`; \
+ if test -n "$$redo_bases"; then \
+ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+ if $(am__make_dryrun); then :; else \
+ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+ fi; \
+ fi; \
+ if test -n "$$am__remaking_logs"; then \
+ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+ "recursion detected" >&2; \
+ else \
+ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+ fi; \
+ if $(am__make_dryrun); then :; else \
+ st=0; \
+ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+ for i in $$redo_bases; do \
+ test -f $$i.trs && test -r $$i.trs \
+ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+ test -f $$i.log && test -r $$i.log \
+ || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+ done; \
+ test $$st -eq 0 || exit 1; \
+ fi
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
+ else \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+ fi; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
+ else \
+ color_start= color_end=; \
+ fi; \
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for b in $$bases; do echo $$b; done \
+ | $(am__create_global_log); \
+ } >$(TEST_SUITE_LOG).tmp || exit 1; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+
+check-TESTS:
+ @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
+ @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+ exit $$?;
+recheck: all $(check_PROGRAMS)
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ bases=`for i in $$bases; do echo $$i; done \
+ | $(am__list_recheck_tests)` || exit 1; \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ log_list=`echo $$log_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+ am__force_recheck=am--force-recheck \
+ TEST_LOGS="$$log_list"; \
+ exit $$?
+check-all.log: check-all$(EXEEXT)
+ @p='check-all$(EXEEXT)'; \
+ b='check-all'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+.test.log:
+ @p='$<'; \
+ $(am__set_b); \
+ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.test$(EXEEXT).log:
+@am__EXEEXT_TRUE@ @p='$<'; \
+@am__EXEEXT_TRUE@ $(am__set_b); \
+@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+ -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+ -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+ -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \
+ clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \
+ ctags ctags-am distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ recheck tags tags-am uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/check-addr.c b/ap/lib/libnl/libnl-3.2.25/tests/check-addr.c
new file mode 100644
index 0000000..39f3ede
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/check-addr.c
@@ -0,0 +1,212 @@
+/*
+ * tests/check-addr.c nl_addr unit tests
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation version 2.1
+ * of the License.
+ *
+ * Copyright (c) 2013 Thomas Graf <tgraf@suug.ch>
+ */
+
+#include <check.h>
+#include <netlink/addr.h>
+
+START_TEST(addr_alloc)
+{
+ struct nl_addr *addr;
+
+ addr = nl_addr_alloc(16);
+ fail_if(addr == NULL,
+ "Allocation should not return NULL");
+
+ fail_if(nl_addr_iszero(addr) == 0,
+ "New empty address should be all zeros");
+
+ fail_if(nl_addr_get_family(addr) != AF_UNSPEC,
+ "New empty address should have family AF_UNSPEC");
+
+ fail_if(nl_addr_get_prefixlen(addr) != 0,
+ "New empty address should have prefix length 0");
+
+ fail_if(nl_addr_shared(addr),
+ "New empty address should not be shared");
+
+ fail_if(nl_addr_get(addr) != addr,
+ "nl_addr_get() should return pointer to address");
+
+ fail_if(nl_addr_shared(addr) == 0,
+ "Address should be shared after call to nl_addr_get()");
+
+ nl_addr_put(addr);
+
+ fail_if(nl_addr_shared(addr),
+ "Address should not be shared after call to nl_addr_put()");
+
+ fail_if(nl_addr_fill_sockaddr(addr, NULL, 0) == 0,
+ "Socket address filling should fail for empty address");
+
+ nl_addr_put(addr);
+}
+END_TEST
+
+START_TEST(addr_binary_addr)
+{
+ struct nl_addr *addr, *addr2;
+ char baddr[4] = { 0x1, 0x2, 0x3, 0x4 };
+ char baddr2[6] = { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6 };
+
+ addr = nl_addr_alloc(4);
+ fail_if(addr == NULL,
+ "Allocation should not return NULL");
+
+ fail_if(nl_addr_set_binary_addr(addr, baddr, 4) < 0,
+ "Valid binary address should be settable");
+
+ fail_if(nl_addr_get_prefixlen(addr) != 0,
+ "Prefix length should be unchanged after nl_addr_set_binary_addr()");
+
+ fail_if(nl_addr_get_len(addr) != 4,
+ "Address length should be 4");
+
+ fail_if(nl_addr_set_binary_addr(addr, baddr2, 6) == 0,
+ "Should not be able to set binary address exceeding maximum length");
+
+ fail_if(nl_addr_get_len(addr) != 4,
+ "Address length should still be 4");
+
+ fail_if(nl_addr_guess_family(addr) != AF_INET,
+ "Binary address of length 4 should be guessed as AF_INET");
+
+ fail_if(memcmp(baddr, nl_addr_get_binary_addr(addr), 4) != 0,
+ "Binary address mismatches");
+
+ addr2 = nl_addr_build(AF_UNSPEC, baddr, 4);
+ fail_if(addr2 == NULL,
+ "Building of address should not fail");
+
+ nl_addr_set_prefixlen(addr, 32);
+ fail_if(nl_addr_get_prefixlen(addr) != 32,
+ "Prefix length should be successful changed after nl_addr_set_prefixlen()");
+
+ fail_if(nl_addr_cmp(addr, addr2),
+ "Addresses built from same binary address should match");
+
+ nl_addr_put(addr);
+ nl_addr_put(addr2);
+}
+END_TEST
+
+START_TEST(addr_parse4)
+{
+ struct nl_addr *addr4, *clone;
+ struct sockaddr_in sin;
+ socklen_t len = sizeof(sin);
+ char *addr_str = "10.0.0.1/16";
+ char buf[128];
+
+ fail_if(nl_addr_parse(addr_str, AF_INET6, &addr4) == 0,
+ "Should not be able to parse IPv4 address in IPv6 mode");
+
+ fail_if(nl_addr_parse(addr_str, AF_UNSPEC, &addr4) != 0,
+ "Should be able to parse \"%s\"", addr_str);
+
+ fail_if(nl_addr_get_family(addr4) != AF_INET,
+ "Address family should be AF_INET");
+
+ fail_if(nl_addr_get_prefixlen(addr4) != 16,
+ "Prefix length should be 16");
+
+ fail_if(nl_addr_iszero(addr4),
+ "Address should not be all zeroes");
+
+ clone = nl_addr_clone(addr4);
+ fail_if(clone == NULL,
+ "Cloned address should not be NULL");
+
+ fail_if(nl_addr_cmp(addr4, clone) != 0,
+ "Cloned address should not mismatch original");
+
+ fail_if(nl_addr_fill_sockaddr(addr4, (struct sockaddr *) &sin, &len) != 0,
+ "Should be able to fill socketaddr");
+
+ fail_if(strcmp(nl_addr2str(addr4, buf, sizeof(buf)), addr_str),
+ "Address translated back to string does not match original");
+
+ nl_addr_put(addr4);
+ nl_addr_put(clone);
+}
+END_TEST
+
+START_TEST(addr_parse6)
+{
+ struct nl_addr *addr6, *clone;
+ struct sockaddr_in6 sin;
+ socklen_t len = sizeof(sin);
+ char *addr_str = "2001:1:2::3/64";
+ char buf[128];
+
+ fail_if(nl_addr_parse(addr_str, AF_INET, &addr6) == 0,
+ "Should not be able to parse IPv6 address in IPv4 mode");
+
+ fail_if(nl_addr_parse(addr_str, AF_UNSPEC, &addr6) != 0,
+ "Should be able to parse \"%s\"", addr_str);
+
+ fail_if(nl_addr_get_family(addr6) != AF_INET6,
+ "Address family should be AF_INET6");
+
+ fail_if(nl_addr_get_prefixlen(addr6) != 64,
+ "Prefix length should be 64");
+
+ fail_if(nl_addr_iszero(addr6),
+ "Address should not be all zeroes");
+
+ clone = nl_addr_clone(addr6);
+ fail_if(clone == NULL,
+ "Cloned address should not be NULL");
+
+ fail_if(nl_addr_cmp(addr6, clone) != 0,
+ "Cloned address should not mismatch original");
+
+ fail_if(nl_addr_fill_sockaddr(addr6, (struct sockaddr *) &sin, &len) != 0,
+ "Should be able to fill socketaddr");
+
+ fail_if(strcmp(nl_addr2str(addr6, buf, sizeof(buf)), addr_str),
+ "Address translated back to string does not match original");
+
+ nl_addr_put(addr6);
+ nl_addr_put(clone);
+}
+END_TEST
+
+START_TEST(addr_info)
+{
+ struct nl_addr *addr;
+ char *addr_str = "127.0.0.1";
+ struct addrinfo *result;
+
+ fail_if(nl_addr_parse(addr_str, AF_UNSPEC, &addr) != 0,
+ "Parsing of valid address should not fail");
+
+ fail_if(nl_addr_info(addr, &result) != 0,
+ "getaddrinfo() on loopback address should work");
+
+ freeaddrinfo(result);
+ nl_addr_put(addr);
+}
+END_TEST
+
+Suite *make_nl_addr_suite(void)
+{
+ Suite *suite = suite_create("Abstract addresses");
+
+ TCase *tc_addr = tcase_create("Core");
+ tcase_add_test(tc_addr, addr_alloc);
+ tcase_add_test(tc_addr, addr_binary_addr);
+ tcase_add_test(tc_addr, addr_parse4);
+ tcase_add_test(tc_addr, addr_parse6);
+ tcase_add_test(tc_addr, addr_info);
+ suite_add_tcase(suite, tc_addr);
+
+ return suite;
+}
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/check-all.c b/ap/lib/libnl/libnl-3.2.25/tests/check-all.c
new file mode 100644
index 0000000..e431802
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/check-all.c
@@ -0,0 +1,44 @@
+/*
+ * tests/check-all.c overall unit test program
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation version 2.1
+ * of the License.
+ *
+ * Copyright (c) 2013 Thomas Graf <tgraf@suug.ch>
+ */
+
+#include <check.h>
+
+extern Suite *make_nl_addr_suite(void);
+extern Suite *make_nl_attr_suite(void);
+
+static Suite *main_suite(void)
+{
+ Suite *suite = suite_create("main");
+
+ return suite;
+}
+
+int main(int argc, char *argv[])
+{
+ SRunner *runner;
+ int nfailed;
+
+ runner = srunner_create(main_suite());
+
+ /* Add testsuites below */
+
+ srunner_add_suite(runner, make_nl_addr_suite());
+ srunner_add_suite(runner, make_nl_attr_suite());
+
+ /* Do not add testsuites below this line */
+
+ srunner_run_all(runner, CK_ENV);
+
+ nfailed = srunner_ntests_failed(runner);
+ srunner_free(runner);
+
+ return nfailed != 0;
+}
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/check-attr.c b/ap/lib/libnl/libnl-3.2.25/tests/check-attr.c
new file mode 100644
index 0000000..d862230
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/check-attr.c
@@ -0,0 +1,88 @@
+/*
+ * tests/check-attr.c nla_attr unit tests
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation version 2.1
+ * of the License.
+ *
+ * Copyright (c) 2013 Thomas Graf <tgraf@suug.ch>
+ */
+
+#include "util.h"
+#include <netlink/attr.h>
+#include <netlink/msg.h>
+
+START_TEST(attr_size)
+{
+ fail_if(nla_attr_size(0) != NLA_HDRLEN,
+ "Length of empty attribute should match header size");
+ fail_if(nla_attr_size(1) != NLA_HDRLEN + 1,
+ "Length of 1 bytes payload should be NLA_HDRLEN + 1");
+ fail_if(nla_attr_size(2) != NLA_HDRLEN + 2,
+ "Length of 2 bytes payload should be NLA_HDRLEN + 2");
+ fail_if(nla_attr_size(3) != NLA_HDRLEN + 3,
+ "Length of 3 bytes payload should be NLA_HDRLEN + 3");
+ fail_if(nla_attr_size(4) != NLA_HDRLEN + 4,
+ "Length of 4 bytes payload should be NLA_HDRLEN + 4");
+
+ fail_if(nla_total_size(1) != NLA_HDRLEN + 4,
+ "Total size of 1 bytes payload should result in 8 bytes");
+ fail_if(nla_total_size(2) != NLA_HDRLEN + 4,
+ "Total size of 2 bytes payload should result in 8 bytes");
+ fail_if(nla_total_size(3) != NLA_HDRLEN + 4,
+ "Total size of 3 bytes payload should result in 8 bytes");
+ fail_if(nla_total_size(4) != NLA_HDRLEN + 4,
+ "Total size of 4 bytes payload should result in 8 bytes");
+
+ fail_if(nla_padlen(1) != 3,
+ "2 bytes of payload should result in 3 padding bytes");
+ fail_if(nla_padlen(2) != 2,
+ "2 bytes of payload should result in 2 padding bytes");
+ fail_if(nla_padlen(3) != 1,
+ "3 bytes of payload should result in 1 padding bytes");
+ fail_if(nla_padlen(4) != 0,
+ "4 bytes of payload should result in 0 padding bytes");
+ fail_if(nla_padlen(5) != 3,
+ "5 bytes of payload should result in 3 padding bytes");
+}
+END_TEST
+
+START_TEST(msg_construct)
+{
+ struct nl_msg *msg;
+ struct nlmsghdr *nlh;
+ struct nlattr *a;
+ int i, rem;
+
+ msg = nlmsg_alloc();
+ fail_if(!msg, "Unable to allocate netlink message");
+
+ for (i = 1; i < 256; i++) {
+ fail_if(nla_put_u32(msg, i, i+1) != 0,
+ "Unable to add attribute %d", i);
+ }
+
+ nlh = nlmsg_hdr(msg);
+ i = 1;
+ nlmsg_for_each_attr(a, nlh, 0, rem) {
+ fail_if(nla_type(a) != i, "Expected attribute %d", i);
+ i++;
+ fail_if(nla_get_u32(a) != i, "Expected attribute value %d", i);
+ }
+
+ nlmsg_free(msg);
+}
+END_TEST
+
+Suite *make_nl_attr_suite(void)
+{
+ Suite *suite = suite_create("Netlink attributes");
+
+ TCase *nl_attr = tcase_create("Core");
+ tcase_add_test(nl_attr, attr_size);
+ tcase_add_test(nl_attr, msg_construct);
+ suite_add_tcase(suite, nl_attr);
+
+ return suite;
+}
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/test-cache-mngr.c b/ap/lib/libnl/libnl-3.2.25/tests/test-cache-mngr.c
new file mode 100644
index 0000000..8999e58
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/test-cache-mngr.c
@@ -0,0 +1,66 @@
+#include <netlink/netlink.h>
+#include <netlink/cache.h>
+#include <netlink/cli/utils.h>
+#include <signal.h>
+
+#include <netlink-private/cache-api.h>
+
+static int quit = 0;
+
+static struct nl_dump_params dp = {
+ .dp_type = NL_DUMP_LINE,
+};
+
+
+static void change_cb(struct nl_cache *cache, struct nl_object *obj,
+ int action, void *data)
+{
+ if (action == NL_ACT_NEW)
+ printf("NEW ");
+ else if (action == NL_ACT_DEL)
+ printf("DEL ");
+ else if (action == NL_ACT_CHANGE)
+ printf("CHANGE ");
+
+ nl_object_dump(obj, &dp);
+}
+
+static void sigint(int arg)
+{
+ quit = 1;
+}
+
+int main(int argc, char *argv[])
+{
+ struct nl_cache_mngr *mngr;
+ struct nl_cache *cache;
+ int err, i;
+
+ dp.dp_fd = stdout;
+
+ signal(SIGINT, sigint);
+
+ err = nl_cache_mngr_alloc(NULL, NETLINK_ROUTE, NL_AUTO_PROVIDE, &mngr);
+ if (err < 0)
+ nl_cli_fatal(err, "Unable to allocate cache manager: %s",
+ nl_geterror(err));
+
+ for (i = 1; i < argc; i++) {
+ err = nl_cache_mngr_add(mngr, argv[i], &change_cb, NULL, &cache);
+ if (err < 0)
+ nl_cli_fatal(err, "Unable to add cache %s: %s",
+ argv[i], nl_geterror(err));
+ }
+
+ while (!quit) {
+ int err = nl_cache_mngr_poll(mngr, 1000);
+ if (err < 0 && err != -NLE_INTR)
+ nl_cli_fatal(err, "Polling failed: %s", nl_geterror(err));
+
+ nl_cache_mngr_info(mngr, &dp);
+ }
+
+ nl_cache_mngr_free(mngr);
+
+ return 0;
+}
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/test-complex-HTB-with-hash-filters.c b/ap/lib/libnl/libnl-3.2.25/tests/test-complex-HTB-with-hash-filters.c
new file mode 100644
index 0000000..48cf5e3
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/test-complex-HTB-with-hash-filters.c
@@ -0,0 +1,761 @@
+/*
+ * test/test-complex-HTB-with-hash-filters.c Add HTB qdisc, HTB classes and creates some hash filters
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation version 2.1
+ * of the License.
+ *
+ * Copyright (c) 2011 Adrian Ban <adrian.ban@mantech.ro>
+ */
+
+#include <netlink/route/link.h>
+#include <netlink/route/tc.h>
+#include <netlink/route/qdisc.h>
+#include <netlink/route/qdisc/htb.h>
+#include <netlink/route/qdisc/sfq.h>
+#include <netlink/route/cls/u32.h>
+#include <netlink/route/classifier.h>
+#include <netlink/route/class.h>
+#include <linux/if_ether.h>
+
+#include <netlink/attr.h>
+//#include "include/rtnl_u32.h"
+
+#include <stdio.h>
+#include <string.h>
+//#include "include/rtnl_u32_addon.h"
+
+#define TC_HANDLE(maj, min) (TC_H_MAJ((maj) << 16) | TC_H_MIN(min))
+
+/* some functions are copied from iproute-tc tool */
+int get_u32(__u32 *val, const char *arg, int base)
+{
+ unsigned long res;
+ char *ptr;
+
+ if (!arg || !*arg)
+ return -1;
+ res = strtoul(arg, &ptr, base);
+ if (!ptr || ptr == arg || *ptr || res > 0xFFFFFFFFUL)
+ return -1;
+ *val = res;
+ return 0;
+}
+
+int get_u32_handle(__u32 *handle, const char *str)
+{
+ __u32 htid=0, hash=0, nodeid=0;
+ char *tmp = strchr(str, ':');
+
+ if (tmp == NULL) {
+ if (memcmp("0x", str, 2) == 0)
+ return get_u32(handle, str, 16);
+ return -1;
+ }
+ htid = strtoul(str, &tmp, 16);
+ if (tmp == str && *str != ':' && *str != 0)
+ return -1;
+ if (htid>=0x1000)
+ return -1;
+ if (*tmp) {
+ str = tmp+1;
+ hash = strtoul(str, &tmp, 16);
+ if (tmp == str && *str != ':' && *str != 0)
+ return -1;
+ if (hash>=0x100)
+ return -1;
+ if (*tmp) {
+ str = tmp+1;
+ nodeid = strtoul(str, &tmp, 16);
+ if (tmp == str && *str != 0)
+ return -1;
+ if (nodeid>=0x1000)
+ return -1;
+ }
+ }
+ *handle = (htid<<20)|(hash<<12)|nodeid;
+ return 0;
+}
+
+uint32_t get_u32_parse_handle(const char *cHandle)
+{
+ uint32_t handle=0;
+
+ if(get_u32_handle(&handle, cHandle)) {
+ printf ("Illegal \"ht\"\n");
+ return -1;
+ }
+
+ if (handle && TC_U32_NODE(handle)) {
+ printf("\"link\" must be a hash table.\n");
+ return -1;
+ }
+ return handle;
+}
+
+int get_tc_classid(__u32 *h, const char *str)
+{
+ __u32 maj, min;
+ char *p;
+
+ maj = TC_H_ROOT;
+ if (strcmp(str, "root") == 0)
+ goto ok;
+ maj = TC_H_UNSPEC;
+ if (strcmp(str, "none") == 0)
+ goto ok;
+ maj = strtoul(str, &p, 16);
+ if (p == str) {
+ maj = 0;
+ if (*p != ':')
+ return -1;
+ }
+ if (*p == ':') {
+ if (maj >= (1<<16))
+ return -1;
+ maj <<= 16;
+ str = p+1;
+ min = strtoul(str, &p, 16);
+ if (*p != 0)
+ return -1;
+ if (min >= (1<<16))
+ return -1;
+ maj |= min;
+ } else if (*p != 0)
+ return -1;
+
+ok:
+ *h = maj;
+ return 0;
+}
+
+/*
+ * Function that adds a new filter and attach it to a hash table
+ *
+ */
+int u32_add_filter_on_ht(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t prio,
+ uint32_t keyval, uint32_t keymask, int keyoff, int keyoffmask,
+ uint32_t htid, uint32_t classid
+)
+{
+ struct rtnl_cls *cls;
+ int err;
+
+ //printf("Key Val : 0x%x\n", keyval);
+ //printf("Key Mask : 0x%x\n", keymask);
+
+ cls=rtnl_cls_alloc();
+ if (!(cls)) {
+ printf("Can not allocate classifier\n");
+ nl_socket_free(sock);
+ exit(1);
+ }
+
+ rtnl_tc_set_link(TC_CAST(cls), rtnlLink);
+
+ if ((err = rtnl_tc_set_kind(TC_CAST(cls), "u32"))) {
+ printf("Can not set classifier as u32\n");
+ return 1;
+ }
+
+ rtnl_cls_set_prio(cls, prio);
+ rtnl_cls_set_protocol(cls, ETH_P_IP);
+
+ rtnl_tc_set_parent(TC_CAST(cls), TC_HANDLE(1, 0));
+
+ rtnl_u32_set_hashtable(cls, htid);
+
+ rtnl_u32_add_key_uint32(cls, keyval, keymask, keyoff, keyoffmask); /* 10.0.0.0/8 */
+
+ rtnl_u32_set_classid(cls, classid);
+
+ rtnl_u32_set_cls_terminal(cls);
+
+ if ((err = rtnl_cls_add(sock, cls, NLM_F_CREATE))) {
+ printf("Can not add classifier: %s\n", nl_geterror(err));
+ return -1;
+ }
+ rtnl_cls_put(cls);
+ return 0;
+
+}
+
+/*
+ * Function that adds a new filter and attach it to a hash table
+ * and set next hash table link with hash mask
+ *
+ */
+int u32_add_filter_on_ht_with_hashmask(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t prio,
+ uint32_t keyval, uint32_t keymask, int keyoff, int keyoffmask,
+ uint32_t htid, uint32_t htlink, uint32_t hmask, uint32_t hoffset
+)
+{
+ struct rtnl_cls *cls;
+ int err;
+
+ //printf("Key Val : 0x%x\n", keyval);
+ //printf("Key Mask : 0x%x\n", keymask);
+
+ cls=rtnl_cls_alloc();
+ if (!(cls)) {
+ printf("Can not allocate classifier\n");
+ nl_socket_free(sock);
+ exit(1);
+ }
+
+ rtnl_tc_set_link(TC_CAST(cls), rtnlLink);
+
+ if ((err = rtnl_tc_set_kind(TC_CAST(cls), "u32"))) {
+ printf("Can not set classifier as u32\n");
+ return 1;
+ }
+
+ rtnl_cls_set_prio(cls, prio);
+ rtnl_cls_set_protocol(cls, ETH_P_IP);
+
+ rtnl_tc_set_parent(TC_CAST(cls), TC_HANDLE(1, 0));
+
+ if (htid)
+ rtnl_u32_set_hashtable(cls, htid);
+
+ rtnl_u32_add_key_uint32(cls, keyval, keymask, keyoff, keyoffmask);
+
+ rtnl_u32_set_hashmask(cls, hmask, hoffset);
+
+ rtnl_u32_set_link(cls, htlink);
+
+
+ if ((err = rtnl_cls_add(sock, cls, NLM_F_CREATE))) {
+ printf("Can not add classifier: %s\n", nl_geterror(err));
+ return -1;
+ }
+ rtnl_cls_put(cls);
+ return 0;
+}
+
+/*
+ * function that creates a new hash table
+ */
+int u32_add_ht(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t prio, uint32_t htid, uint32_t divisor)
+{
+
+ int err;
+ struct rtnl_cls *cls;
+
+ cls=rtnl_cls_alloc();
+ if (!(cls)) {
+ printf("Can not allocate classifier\n");
+ nl_socket_free(sock);
+ exit(1);
+ }
+
+ rtnl_tc_set_link(TC_CAST(cls), rtnlLink);
+
+ if ((err = rtnl_tc_set_kind(TC_CAST(cls), "u32"))) {
+ printf("Can not set classifier as u32\n");
+ return 1;
+ }
+
+ rtnl_cls_set_prio(cls, prio);
+ rtnl_cls_set_protocol(cls, ETH_P_IP);
+ rtnl_tc_set_parent(TC_CAST(cls), TC_HANDLE(1, 0));
+
+ rtnl_u32_set_handle(cls, htid, 0x0, 0x0);
+ //printf("htid: 0x%X\n", htid);
+ rtnl_u32_set_divisor(cls, divisor);
+
+ if ((err = rtnl_cls_add(sock, cls, NLM_F_CREATE))) {
+ printf("Can not add classifier: %s\n", nl_geterror(err));
+ return -1;
+ }
+ rtnl_cls_put(cls);
+ return 0;
+}
+
+/*
+ * function that adds a new HTB qdisc and set the default class for unclassified traffic
+ */
+int qdisc_add_HTB(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t defaultClass)
+{
+
+ struct rtnl_qdisc *qdisc;
+ int err;
+
+ /* Allocation of a qdisc object */
+ if (!(qdisc = rtnl_qdisc_alloc())) {
+ printf("Can not allocate Qdisc\n");
+ return -1;
+ }
+
+ //rtnl_tc_set_ifindex(TC_CAST(qdisc), master_index);
+ rtnl_tc_set_link(TC_CAST(qdisc), rtnlLink);
+ rtnl_tc_set_parent(TC_CAST(qdisc), TC_H_ROOT);
+
+ //delete the qdisc
+ //printf("Delete current qdisc\n");
+ rtnl_qdisc_delete(sock, qdisc);
+ //rtnl_qdisc_put(qdisc);
+
+ //add a HTB qdisc
+ //printf("Add a new HTB qdisc\n");
+ rtnl_tc_set_handle(TC_CAST(qdisc), TC_HANDLE(1,0));
+
+ if ((err = rtnl_tc_set_kind(TC_CAST(qdisc), "htb"))) {
+ printf("Can not allocate HTB\n");
+ return -1;
+ }
+
+ /* Set default class for unclassified traffic */
+ //printf("Set default class for unclassified traffic\n");
+ rtnl_htb_set_defcls(qdisc, TC_HANDLE(1, defaultClass));
+ rtnl_htb_set_rate2quantum(qdisc, 1);
+
+ /* Submit request to kernel and wait for response */
+ if ((err = rtnl_qdisc_add(sock, qdisc, NLM_F_CREATE))) {
+ printf("Can not allocate HTB Qdisc\n");
+ return -1;
+ }
+
+ /* Return the qdisc object to free memory resources */
+ rtnl_qdisc_put(qdisc);
+
+ return 0;
+}
+
+/*
+ * function that adds a new HTB class and set its parameters
+ */
+int class_add_HTB(struct nl_sock *sock, struct rtnl_link *rtnlLink,
+ uint32_t parentMaj, uint32_t parentMin,
+ uint32_t childMaj, uint32_t childMin,
+ uint64_t rate, uint64_t ceil,
+ uint32_t burst, uint32_t cburst,
+ uint32_t prio
+)
+{
+ int err;
+ struct rtnl_class *class;
+ //struct rtnl_class *class = (struct rtnl_class *) tc;
+
+ //create a HTB class
+ //class = (struct rtnl_class *)rtnl_class_alloc();
+ if (!(class = rtnl_class_alloc())) {
+ printf("Can not allocate class object\n");
+ return 1;
+ }
+ //
+ rtnl_tc_set_link(TC_CAST(class), rtnlLink);
+ //add a HTB qdisc
+ //printf("Add a new HTB class with 0x%X:0x%X on parent 0x%X:0x%X\n", childMaj, childMin, parentMaj, parentMin);
+ rtnl_tc_set_parent(TC_CAST(class), TC_HANDLE(parentMaj, parentMin));
+ rtnl_tc_set_handle(TC_CAST(class), TC_HANDLE(childMaj, childMin));
+
+ if ((err = rtnl_tc_set_kind(TC_CAST(class), "htb"))) {
+ printf("Can not set HTB to class\n");
+ return 1;
+ }
+
+ //printf("set HTB class prio to %u\n", prio);
+ rtnl_htb_set_prio((struct rtnl_class *)class, prio);
+
+ if (rate) {
+ //rate=rate/8;
+ rtnl_htb_set_rate(class, rate);
+ }
+ if (ceil) {
+ //ceil=ceil/8;
+ rtnl_htb_set_ceil(class, ceil);
+ }
+
+ if (burst) {
+ //printf ("Class HTB: set rate burst: %u\n", burst);
+ rtnl_htb_set_rbuffer(class, burst);
+ }
+ if (cburst) {
+ //printf ("Class HTB: set rate cburst: %u\n", cburst);
+ rtnl_htb_set_cbuffer(class, cburst);
+ }
+ /* Submit request to kernel and wait for response */
+ if ((err = rtnl_class_add(sock, class, NLM_F_CREATE))) {
+ printf("Can not allocate HTB Qdisc\n");
+ return 1;
+ }
+ rtnl_class_put(class);
+ return 0;
+}
+
+/*
+ * function that adds a HTB root class and set its parameters
+ */
+int class_add_HTB_root(struct nl_sock *sock, struct rtnl_link *rtnlLink,
+ uint64_t rate, uint64_t ceil,
+ uint32_t burst, uint32_t cburst
+)
+{
+ int err;
+ struct rtnl_class *class;
+
+ //create a HTB class
+ class = (struct rtnl_class *)rtnl_class_alloc();
+ //class = rtnl_class_alloc();
+ if (!class) {
+ printf("Can not allocate class object\n");
+ return 1;
+ }
+ //
+ rtnl_tc_set_link(TC_CAST(class), rtnlLink);
+ rtnl_tc_set_parent(TC_CAST(class), TC_H_ROOT);
+ //add a HTB class
+ //printf("Add a new HTB ROOT class\n");
+ rtnl_tc_set_handle(TC_CAST(class), 1);
+
+ if ((err = rtnl_tc_set_kind(TC_CAST(class), "htb"))) {
+ printf("Can not set HTB to class\n");
+ return 1;
+ }
+
+ if (rate) {
+ //rate=rate/8;
+ rtnl_htb_set_rate(class, rate);
+ }
+ if (ceil) {
+ //ceil=ceil/8;
+ rtnl_htb_set_ceil(class, ceil);
+ }
+
+ if (burst) {
+ rtnl_htb_set_rbuffer(class, burst);
+ }
+ if (cburst) {
+ rtnl_htb_set_cbuffer(class, cburst);
+ }
+
+ /* Submit request to kernel and wait for response */
+ if ((err = rtnl_class_add(sock, class, NLM_F_CREATE))) {
+ printf("Can not allocate HTB Qdisc\n");
+ return 1;
+ }
+ rtnl_class_put(class);
+ return 0;
+}
+
+/*
+ * function that adds a new SFQ qdisc as a leaf for a HTB class
+ */
+int qdisc_add_SFQ_leaf(struct nl_sock *sock, struct rtnl_link *rtnlLink,
+ uint32_t parentMaj, uint32_t parentMin,
+ int quantum, int limit, int perturb
+)
+{
+ int err;
+ struct rtnl_qdisc *qdisc;
+
+ if (!(qdisc = rtnl_qdisc_alloc())) {
+ printf("Can not allocate qdisc object\n");
+ return 1;
+ }
+ rtnl_tc_set_link(TC_CAST(qdisc), rtnlLink);
+ rtnl_tc_set_parent(TC_CAST(qdisc), TC_HANDLE(parentMaj, parentMin));
+
+ rtnl_tc_set_handle(TC_CAST(qdisc), TC_HANDLE(parentMin,0));
+
+ if ((err = rtnl_tc_set_kind(TC_CAST(qdisc), "sfq"))) {
+ printf("Can not set SQF class\n");
+ return 1;
+ }
+
+ if(quantum) {
+ rtnl_sfq_set_quantum(qdisc, quantum);
+ } else {
+ rtnl_sfq_set_quantum(qdisc, 16000); // tc default value
+ }
+ if(limit) {
+ rtnl_sfq_set_limit(qdisc, limit); // default is 127
+ }
+ if(perturb) {
+ rtnl_sfq_set_perturb(qdisc, perturb); // default never perturb the hash
+ }
+
+ /* Submit request to kernel and wait for response */
+ if ((err = rtnl_qdisc_add(sock, qdisc, NLM_F_CREATE))) {
+ printf("Can not allocate SFQ qdisc\n");
+ return -1;
+ }
+
+ /* Return the qdisc object to free memory resources */
+ rtnl_qdisc_put(qdisc);
+ return 0;
+}
+
+
+
+
+int main() {
+
+ struct nl_sock *sock;
+ struct rtnl_link *link;
+
+ //struct rtnl_qdisc *qdisc;
+ //struct rtnl_class *class;
+ //struct rtnl_cls *cls;
+
+ uint32_t ht, htlink, htid, direction, classid;
+ //uint32_t hash, hashmask, nodeid, divisor, handle;
+ //struct rtnl_u32 *f_u32;
+ char chashlink[16]="";
+
+ //uint64_t drops, qlen;
+
+ //int master_index;
+ int err;
+
+ //uint64_t rate=0, ceil=0;
+
+ struct nl_cache *link_cache;
+
+ if (!(sock = nl_socket_alloc())) {
+ printf("Unable to allocate netlink socket\n");
+ exit(1);
+ }
+
+ if ((err = nl_connect(sock, NETLINK_ROUTE)) < 0 ) {
+ printf("Nu s-a putut conecta la NETLINK!\n");
+ nl_socket_free(sock);
+ exit(1);
+ }
+
+
+ if ((err = rtnl_link_alloc_cache(sock, AF_UNSPEC, &link_cache)) < 0) {
+ printf("Unable to allocate link cache: %s\n",
+ nl_geterror(err));
+ nl_socket_free(sock);
+ exit(1);
+ }
+
+ /* lookup interface index of eth0 */
+ if (!(link = rtnl_link_get_by_name(link_cache, "imq0"))) {
+ /* error */
+ printf("Interface not found\n");
+ nl_socket_free(sock);
+ exit(1);
+ }
+
+ err=qdisc_add_HTB(sock, link, 0xffff);
+ //drops = rtnl_tc_get_stat(TC_CAST(qdisc), RTNL_TC_DROPS);
+
+ //printf("Add ROOT HTB class\n");
+ err=class_add_HTB_root(sock, link, 12500000, 12500000, 25000, 25000);
+ err=class_add_HTB(sock, link, 1, 0, 1, 0xffff, 1250000, 12500000, 25000, 25000, 5);
+ err=qdisc_add_SFQ_leaf(sock, link, 1, 0xffff, 16000, 0, 10);
+ err=class_add_HTB(sock, link, 1, 1, 1, 0x5, 2000000, 2000000, 25000, 25000, 5);
+ err=qdisc_add_SFQ_leaf(sock, link, 1, 0x5, 16000, 0, 10);
+ err=class_add_HTB(sock, link, 1, 1, 1, 0x6, 1000000, 1000000, 25000, 25000, 5);
+ err=qdisc_add_SFQ_leaf(sock, link, 1, 0x6, 16000, 0, 10);
+ //err=class_add_HTB(sock, link, 1, 0, 1, 0x7, 1024000, 100000000, 5);
+ //err=class_add_HTB(sock, link, 1, 0, 1, 0x8, 2048000, 100000000, 5);
+ //err=class_add_HTB(sock, link, 1, 0, 1, 0x9, 4096000, 100000000, 5);
+ //err=class_add_HTB(sock, link, 1, 0, 1, 0xa, 8192000, 100000000, 5);
+
+ //printf("Add main hash table\n");
+
+ /* create u32 first hash filter table
+ *
+ */
+ /* formula calcul handle:
+ * uint32_t handle = (htid << 20) | (hash << 12) | nodeid;
+ */
+
+ /*
+ * Upper limit of number of hash tables: 4096 (0xFFF)
+ * Number of hashes in a table: 256 values (0xFF)
+ *
+ */
+
+ /* using 256 values for hash table
+ * each entry in hash table match a byte from IP address specified later by a hash key
+ */
+
+ uint32_t i;
+ for (i = 1; i <= 0xf; i++)
+ u32_add_ht(sock, link, 1, i, 256);
+
+ /*
+ * attach a u32 filter to the first hash
+ * that redirects all traffic and make a hash key
+ * from the fist byte of the IP address
+ *
+ */
+
+ //divisor=0x0; // unused here
+ //handle = 0x0; // unused here
+ //hash = 0x0; // unused here
+ //htid = 0x0; // unused here
+ //nodeid = 0x0; // unused here
+
+ // direction = 12 -> source IP
+ // direction = 16 -> destination IP
+ direction = 16;
+
+ /*
+ * which hash table will use
+ * in our case is hash table no 1 defined previous
+ *
+ * There are 2 posibilities to set the the hash table:
+ * 1. Using function get_u32_handle and sent a string in
+ * format 10: where 10 is number of the hash table
+ * 2. Create your own value in format: 0xa00000
+ *
+ */
+ strcpy(chashlink, "1:");
+ //printf("Hash Link: %s\n", chashlink);
+ //chashlink=malloc(sizeof(char) *
+ htlink = 0x0; // is used by get_u32_handle to return the correct value of hash table (link)
+
+ if(get_u32_handle(&htlink, chashlink)) {
+ printf ("Illegal \"link\"");
+ nl_socket_free(sock);
+ exit(1);
+ }
+ //printf ("hash link : 0x%X\n", htlink);
+ //printf ("hash link test : %u\n", (htlink && TC_U32_NODE(htlink)));
+
+ if (htlink && TC_U32_NODE(htlink)) {
+ printf("\"link\" must be a hash table.\n");
+ nl_socket_free(sock);
+ exit(1);
+ }
+ /* the hash mask will hit the hash table (link) no 1: in our case
+ */
+
+ /* set the hash key mask */
+ //hashmask = 0xFF000000UL; // the mask that is used to match the hash in specific table, in our case for example 1:a with mean the first byte which is 10 in hash table 1
+
+ /* Here we add a hash filter which match the first byte (see the hashmask value)
+ * of the source IP (offset 12 in the packet header)
+ * You can use also offset 16 to match the destination IP
+ */
+
+ /*
+ * Also we need a filter to match our rule
+ * This mean that we will put a 0.0.0.0/0 filter in our first rule
+ * that match the offset 12 (source IP)
+ * Also you can put offset 16 to match the destination IP
+ */
+
+ u32_add_filter_on_ht_with_hashmask(sock, link, 1,
+ 0x0, 0x0, direction, 0,
+ 0, htlink, 0xff000000, direction);
+
+ /*
+ * For each first byte that we need to match we will create a new hash table
+ * For example: you have those clases: 10.0.0.0/24 and 172.16.0.0/23
+ * For byte 10 and byte 172 will create a separate hash table that will match the second
+ * byte from each class.
+ *
+ */
+
+
+ // Create a new hash table with prio 1, id 2 and 256 entries
+// u32_CreateNewHashTable(sock, link, 1, 2, 256);
+ // Create a new hash table with prio 1, id 3 and 256 entries
+// u32_CreateNewHashTable(sock, link, 1, 3, 256);
+// u32_CreateNewHashTable(sock, link, 1, 4, 256);
+// u32_CreateNewHashTable(sock, link, 1, 5, 256);
+
+ /*
+ * Now we will create other filter under (ATENTION) our first hash table (link) 1:
+ * Previous rule redirects the trafic according the hash mask to hash table (link) no 1:
+ * Here we will match the hash tables from 1:0 to 1:ff. Under each hash table we will attach
+ * other rules that matches next byte from IP source/destination IP and we will repeat the
+ * previous steps.
+ *
+ */
+
+
+ // /8 check
+
+ // 10.0.0.0/8
+ ht=get_u32_parse_handle("1:a:");
+ htid = (ht&0xFFFFF000);
+ htlink=get_u32_parse_handle("2:");
+
+ u32_add_filter_on_ht_with_hashmask(sock, link, 1,
+ 0x0a000000, 0xff000000, direction, 0,
+ htid, htlink, 0x00ff0000, direction);
+
+ // 172.0.0.0/8
+ ht=get_u32_parse_handle("1:ac:");
+ htid = (ht&0xFFFFF000);
+ htlink=get_u32_parse_handle("3:");
+
+ u32_add_filter_on_ht_with_hashmask(sock, link, 1,
+ 0xac000000, 0xff000000, direction, 0,
+ htid, htlink, 0x00ff0000, direction);
+
+
+ // /16 check
+ // 10.0.0.0/16
+ ht=get_u32_parse_handle("2:0:");
+ htid = (ht&0xFFFFF000);
+ htlink=get_u32_parse_handle("4:");
+
+ u32_add_filter_on_ht_with_hashmask(sock, link, 1,
+ 0x0a000000, 0xffff0000, direction, 0,
+ htid, htlink, 0x0000ff00, direction);
+
+ // 172.17.0.0/16
+ ht=get_u32_parse_handle("3:11:");
+ htid = (ht&0xFFFFF000);
+ htlink=get_u32_parse_handle("5:");
+
+ u32_add_filter_on_ht_with_hashmask(sock, link, 1,
+ 0xac110000, 0xffff0000, direction, 0,
+ htid, htlink, 0x0000ff00, direction);
+
+ // /24 check
+ // 10.0.9.0/24
+ ht=get_u32_parse_handle("4:9:");
+ htid = (ht&0xFFFFF000);
+ htlink=get_u32_parse_handle("6:");
+
+ u32_add_filter_on_ht_with_hashmask(sock, link, 1,
+ 0x0a000900, 0xffffff00, direction, 0,
+ htid, htlink, 0x000000ff, direction);
+
+ // 172.17.2.0/16
+ ht=get_u32_parse_handle("5:2:");
+ htid = (ht&0xFFFFF000);
+ htlink=get_u32_parse_handle("7:");
+
+ u32_add_filter_on_ht_with_hashmask(sock, link, 1,
+ 0xac110200, 0xffffff00, direction, 0,
+ htid, htlink, 0x000000ff, direction);
+
+
+ // final filters
+ // 10.0.9.20
+ ht=get_u32_parse_handle("6:14:");
+ htid = (ht&0xFFFFF000);
+
+ err = get_tc_classid(&classid, "1:5");
+
+ u32_add_filter_on_ht(sock, link, 1,
+ 0x0a000914, 0xffffffff, direction, 0,
+ htid, classid);
+
+ // 172.17.2.120
+ ht=get_u32_parse_handle("7:78:");
+ htid = (ht&0xFFFFF000);
+
+ err = get_tc_classid(&classid, "1:6");
+
+ u32_add_filter_on_ht(sock, link, 1,
+ 0xac110278, 0xffffffff, direction, 0,
+ htid, classid);
+
+
+
+ nl_socket_free(sock);
+ return 0;
+}
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/test-create-bond.c b/ap/lib/libnl/libnl-3.2.25/tests/test-create-bond.c
new file mode 100644
index 0000000..11bc5b0
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/test-create-bond.c
@@ -0,0 +1,29 @@
+#include <netlink/netlink.h>
+#include <netlink/route/link.h>
+#include <netlink/route/link/bonding.h>
+
+int main(int argc, char *argv[])
+{
+ struct rtnl_link *link;
+ struct nl_sock *sk;
+ int err;
+
+ sk = nl_socket_alloc();
+ if ((err = nl_connect(sk, NETLINK_ROUTE)) < 0) {
+ nl_perror(err, "Unable to connect socket");
+ return err;
+ }
+
+ link = rtnl_link_bond_alloc();
+ rtnl_link_set_name(link, "my_bond");
+
+ if ((err = rtnl_link_add(sk, link, NLM_F_CREATE)) < 0) {
+ nl_perror(err, "Unable to add link");
+ return err;
+ }
+
+ rtnl_link_put(link);
+ nl_close(sk);
+
+ return 0;
+}
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/test-create-bridge.c b/ap/lib/libnl/libnl-3.2.25/tests/test-create-bridge.c
new file mode 100644
index 0000000..7202cd7
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/test-create-bridge.c
@@ -0,0 +1,80 @@
+#include <netlink/netlink.h>
+#include <netlink/route/link.h>
+#include <netlink/route/link/bridge.h>
+
+#define TEST_BRIDGE_NAME "testbridge"
+#define TEST_INTERFACE_NAME "testtap1"
+
+int create_bridge(struct nl_sock *sk, struct nl_cache *link_cache, const char *name) {
+ struct rtnl_link *link;
+ int err;
+
+ link = rtnl_link_alloc();
+ if ((err = rtnl_link_set_type(link, "bridge")) < 0) {
+ rtnl_link_put(link);
+ return err;
+ }
+ rtnl_link_set_name(link, name);
+
+ if ((err = rtnl_link_add(sk, link, NLM_F_CREATE)) < 0) {
+ return err;
+ }
+ rtnl_link_put(link);
+
+ return 0;
+}
+
+int main(int argc, char *argv[])
+{
+ struct rtnl_link *link;
+ struct nl_cache *link_cache;
+ struct nl_sock *sk;
+ int err;
+
+ sk = nl_socket_alloc();
+ if ((err = nl_connect(sk, NETLINK_ROUTE)) < 0) {
+ nl_perror(err, "Unable to connect socket");
+ return err;
+ }
+
+ if ((err = rtnl_link_alloc_cache(sk, AF_UNSPEC, &link_cache)) < 0) {
+ nl_perror(err, "Unable to allocate cache");
+ return err;
+ }
+
+ if ((err = create_bridge(sk, link_cache, TEST_BRIDGE_NAME)) < 0) {
+ nl_perror(err, "Unable to allocate testbridge");
+ return err;
+ }
+
+ nl_cache_refill(sk, link_cache);
+
+ link = rtnl_link_get_by_name(link_cache, TEST_BRIDGE_NAME);
+ struct rtnl_link *ltap = rtnl_link_get_by_name(link_cache, TEST_INTERFACE_NAME);
+ if (!ltap) {
+ fprintf(stderr, "You should create a tap interface before lunch this test (# tunctl -t %s)\n", TEST_INTERFACE_NAME);
+ return -1;
+ }
+
+ if ((err = rtnl_link_enslave(sk, link, ltap)) < 0) {
+ nl_perror(err, "Unable to enslave interface to his bridge\n");
+ return err;
+ }
+
+ if(rtnl_link_is_bridge(link) == 0) {
+ fprintf(stderr, "Link is not a bridge\n");
+ return -2;
+ }
+ if(rtnl_link_get_master(ltap) <= 0) {
+ fprintf(stderr, "Interface is not attached to a bridge\n");
+ return -3;
+ }
+
+ rtnl_link_put(ltap);
+ rtnl_link_put(link);
+
+ nl_cache_free(link_cache);
+ nl_socket_free(sk);
+
+ return 0;
+}
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/test-create-ip6tnl.c b/ap/lib/libnl/libnl-3.2.25/tests/test-create-ip6tnl.c
new file mode 100644
index 0000000..b36ab3d
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/test-create-ip6tnl.c
@@ -0,0 +1,55 @@
+#include <netlink/route/link/ip6tnl.h>
+#include <netlink-private/netlink.h>
+
+int main(int argc, char *argv[])
+{
+ struct nl_cache *link_cache;
+ struct rtnl_link *link;
+ struct in6_addr addr;
+ struct nl_sock *sk;
+ int err, if_index;
+
+ sk = nl_socket_alloc();
+ if ((err = nl_connect(sk, NETLINK_ROUTE)) < 0) {
+ nl_perror(err, "Unable to connect socket");
+ return err;
+ }
+
+ err = rtnl_link_alloc_cache(sk, AF_UNSPEC, &link_cache);
+ if ( err < 0) {
+ nl_perror(err, "Unable to allocate cache");
+ return err;
+ }
+
+ if_index = rtnl_link_name2i(link_cache, "ens33");
+ if (!if_index) {
+ fprintf(stderr, "Unable to lookup ens33");
+ return -1;
+ }
+
+ link = rtnl_link_ip6_tnl_alloc();
+ if(!link) {
+ nl_perror(err, "Unable to allocate link");
+ return -1;
+
+ }
+ rtnl_link_set_name(link, "ip6tnl-tun");
+ rtnl_link_ip6_tnl_set_link(link, if_index);
+
+ inet_pton(AF_INET6, "2607:f0d0:1002:51::4", &addr);
+ rtnl_link_ip6_tnl_set_local(link, &addr);
+
+ inet_pton(AF_INET6, "2607:f0d0:1002:52::5", &addr);
+ rtnl_link_ip6_tnl_set_remote(link, &addr);
+
+ err = rtnl_link_add(sk, link, NLM_F_CREATE);
+ if (err < 0) {
+ nl_perror(err, "Unable to add link");
+ return err;
+ }
+
+ rtnl_link_put(link);
+ nl_close(sk);
+
+ return 0;
+}
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/test-create-ipgre.c b/ap/lib/libnl/libnl-3.2.25/tests/test-create-ipgre.c
new file mode 100644
index 0000000..66ea6da
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/test-create-ipgre.c
@@ -0,0 +1,56 @@
+#include <netlink/route/link/ipgre.h>
+#include <netlink-private/netlink.h>
+
+int main(int argc, char *argv[])
+{
+ struct nl_cache *link_cache;
+ struct rtnl_link *link;
+ struct in_addr addr;
+ struct nl_sock *sk;
+ int err, if_index;
+
+ sk = nl_socket_alloc();
+ if ((err = nl_connect(sk, NETLINK_ROUTE)) < 0) {
+ nl_perror(err, "Unable to connect socket");
+ return err;
+ }
+
+ err = rtnl_link_alloc_cache(sk, AF_UNSPEC, &link_cache);
+ if ( err < 0) {
+ nl_perror(err, "Unable to allocate cache");
+ return err;
+ }
+
+ if_index = rtnl_link_name2i(link_cache, "eno16777736");
+ if (!if_index) {
+ fprintf(stderr, "Unable to lookup eno16777736");
+ return -1;
+ }
+
+ link = rtnl_link_ipgre_alloc();
+ if(!link) {
+ nl_perror(err, "Unable to allocate link");
+ return -1;
+
+ }
+ rtnl_link_set_name(link, "ipgre-tun");
+ rtnl_link_ipgre_set_link(link, if_index);
+
+ inet_pton(AF_INET, "192.168.254.12", &addr.s_addr);
+ rtnl_link_ipgre_set_local(link, addr.s_addr);
+
+ inet_pton(AF_INET, "192.168.254.13", &addr.s_addr);
+ rtnl_link_ipgre_set_remote(link, addr.s_addr);
+
+ rtnl_link_ipgre_set_ttl(link, 64);
+ err = rtnl_link_add(sk, link, NLM_F_CREATE);
+ if (err < 0) {
+ nl_perror(err, "Unable to add link");
+ return err;
+ }
+
+ rtnl_link_put(link);
+ nl_close(sk);
+
+ return 0;
+}
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/test-create-ipip.c b/ap/lib/libnl/libnl-3.2.25/tests/test-create-ipip.c
new file mode 100644
index 0000000..44b9b2c
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/test-create-ipip.c
@@ -0,0 +1,56 @@
+#include <netlink/route/link/ipip.h>
+#include <netlink-private/netlink.h>
+
+int main(int argc, char *argv[])
+{
+ struct nl_cache *link_cache;
+ struct rtnl_link *link;
+ struct in_addr addr;
+ struct nl_sock *sk;
+ int err, if_index;
+
+ sk = nl_socket_alloc();
+ if ((err = nl_connect(sk, NETLINK_ROUTE)) < 0) {
+ nl_perror(err, "Unable to connect socket");
+ return err;
+ }
+
+ err = rtnl_link_alloc_cache(sk, AF_UNSPEC, &link_cache);
+ if ( err < 0) {
+ nl_perror(err, "Unable to allocate cache");
+ return err;
+ }
+
+ if_index = rtnl_link_name2i(link_cache, "eno16777736");
+ if (!if_index) {
+ fprintf(stderr, "Unable to lookup eno16777736");
+ return -1;
+ }
+
+ link = rtnl_link_ipip_alloc();
+ if(!link) {
+ nl_perror(err, "Unable to allocate link");
+ return -1;
+ }
+
+ rtnl_link_set_name(link, "ipip-tun");
+ rtnl_link_ipip_set_link(link, if_index);
+
+ inet_pton(AF_INET, "192.168.254.12", &addr.s_addr);
+ rtnl_link_ipip_set_local(link, addr.s_addr);
+
+ inet_pton(AF_INET, "192.168.254.13", &addr.s_addr);
+ rtnl_link_ipip_set_remote(link, addr.s_addr);
+
+ rtnl_link_ipip_set_ttl(link, 64);
+ err = rtnl_link_add(sk, link, NLM_F_CREATE);
+ if (err < 0) {
+ nl_perror(err, "Unable to add link");
+ return err;
+ }
+
+ rtnl_link_put(link);
+ nl_close(sk);
+
+ return 0;
+}
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/test-create-ipvti.c b/ap/lib/libnl/libnl-3.2.25/tests/test-create-ipvti.c
new file mode 100644
index 0000000..6cb92d7
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/test-create-ipvti.c
@@ -0,0 +1,55 @@
+#include <netlink/route/link/ipvti.h>
+#include <netlink-private/netlink.h>
+
+int main(int argc, char *argv[])
+{
+ struct nl_cache *link_cache;
+ struct rtnl_link *link;
+ struct in_addr addr;
+ struct nl_sock *sk;
+ int err, if_index;
+
+ sk = nl_socket_alloc();
+ if ((err = nl_connect(sk, NETLINK_ROUTE)) < 0) {
+ nl_perror(err, "Unable to connect socket");
+ return err;
+ }
+
+ err = rtnl_link_alloc_cache(sk, AF_UNSPEC, &link_cache);
+ if ( err < 0) {
+ nl_perror(err, "Unable to allocate cache");
+ return err;
+ }
+
+ if_index = rtnl_link_name2i(link_cache, "ens33");
+ if (!if_index) {
+ fprintf(stderr, "Unable to lookup ens33");
+ return -1;
+ }
+
+ link = rtnl_link_ipvti_alloc();
+ if(!link) {
+ nl_perror(err, "Unable to allocate link");
+ return -1;
+
+ }
+ rtnl_link_set_name(link, "ipvti-tun");
+ rtnl_link_ipvti_set_link(link, if_index);
+
+ inet_pton(AF_INET, "192.168.254.12", &addr.s_addr);
+ rtnl_link_ipvti_set_local(link, addr.s_addr);
+
+ inet_pton(AF_INET, "192.168.254.13", &addr.s_addr);
+ rtnl_link_ipvti_set_remote(link, addr.s_addr);
+
+ err = rtnl_link_add(sk, link, NLM_F_CREATE);
+ if (err < 0) {
+ nl_perror(err, "Unable to add link");
+ return err;
+ }
+
+ rtnl_link_put(link);
+ nl_close(sk);
+
+ return 0;
+}
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/test-create-sit.c b/ap/lib/libnl/libnl-3.2.25/tests/test-create-sit.c
new file mode 100644
index 0000000..d33e496
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/test-create-sit.c
@@ -0,0 +1,56 @@
+#include <netlink/route/link/sit.h>
+#include <netlink-private/netlink.h>
+
+int main(int argc, char *argv[])
+{
+ struct nl_cache *link_cache;
+ struct rtnl_link *link;
+ struct in_addr addr;
+ struct nl_sock *sk;
+ int err, if_index;
+
+ sk = nl_socket_alloc();
+ if ((err = nl_connect(sk, NETLINK_ROUTE)) < 0) {
+ nl_perror(err, "Unable to connect socket");
+ return err;
+ }
+
+ err = rtnl_link_alloc_cache(sk, AF_UNSPEC, &link_cache);
+ if ( err < 0) {
+ nl_perror(err, "Unable to allocate cache");
+ return err;
+ }
+
+ if_index = rtnl_link_name2i(link_cache, "eno16777736");
+ if (!if_index) {
+ fprintf(stderr, "Unable to lookup eno16777736");
+ return -1;
+ }
+
+ link = rtnl_link_sit_alloc();
+ if(!link) {
+ nl_perror(err, "Unable to allocate link");
+ return -1;
+
+ }
+ rtnl_link_set_name(link, "sit-tun");
+ rtnl_link_sit_set_link(link, if_index);
+
+ inet_pton(AF_INET, "192.168.254.12", &addr.s_addr);
+ rtnl_link_sit_set_local(link, addr.s_addr);
+
+ inet_pton(AF_INET, "192.168.254.13", &addr.s_addr);
+ rtnl_link_sit_set_remote(link, addr.s_addr);
+
+ rtnl_link_sit_set_ttl(link, 64);
+ err = rtnl_link_add(sk, link, NLM_F_CREATE);
+ if (err < 0) {
+ nl_perror(err, "Unable to add link");
+ return err;
+ }
+
+ rtnl_link_put(link);
+ nl_close(sk);
+
+ return 0;
+}
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/test-create-veth.c b/ap/lib/libnl/libnl-3.2.25/tests/test-create-veth.c
new file mode 100644
index 0000000..db5ab8b
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/test-create-veth.c
@@ -0,0 +1,42 @@
+#include <netlink/netlink.h>
+#include <netlink/route/link.h>
+#include <netlink/route/link/veth.h>
+
+int main(int argc, char *argv[])
+{
+ struct rtnl_link *link;
+ struct nl_sock *sk;
+ int err;
+ struct rtnl_link *peer;
+
+ sk = nl_socket_alloc();
+ if ((err = nl_connect(sk, NETLINK_ROUTE)) < 0) {
+ nl_perror(err, "Unable to connect socket");
+ return err;
+ }
+
+#if 0
+ rtnl_link_veth_add(sk, "veth2", "veth3", getpid());
+#else
+ link = rtnl_link_veth_alloc();
+ if (!link) {
+ nl_perror(err, "Unable to alloc link");
+ return err;
+ }
+
+ rtnl_link_set_name(link, "veth8");
+ peer = rtnl_link_veth_get_peer(link);
+ rtnl_link_set_name(peer, "veth9");
+
+ if ((err = rtnl_link_add(sk, link, NLM_F_CREATE)) < 0) {
+ nl_perror(err, "Unable to add link");
+ return err;
+ }
+ printf("peer is %s\n", rtnl_link_get_name(peer));
+ rtnl_link_put(peer);
+ rtnl_link_put(link);
+#endif
+ nl_close(sk);
+
+ return 0;
+}
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/test-create-vlan.c b/ap/lib/libnl/libnl-3.2.25/tests/test-create-vlan.c
new file mode 100644
index 0000000..64e478f
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/test-create-vlan.c
@@ -0,0 +1,43 @@
+#include <netlink/netlink.h>
+#include <netlink/route/link.h>
+#include <netlink/route/link/vlan.h>
+
+int main(int argc, char *argv[])
+{
+ struct rtnl_link *link;
+ struct nl_cache *link_cache;
+ struct nl_sock *sk;
+ int err, master_index;
+
+ sk = nl_socket_alloc();
+ if ((err = nl_connect(sk, NETLINK_ROUTE)) < 0) {
+ nl_perror(err, "Unable to connect socket");
+ return err;
+ }
+
+ if ((err = rtnl_link_alloc_cache(sk, AF_UNSPEC, &link_cache)) < 0) {
+ nl_perror(err, "Unable to allocate cache");
+ return err;
+ }
+
+ if (!(master_index = rtnl_link_name2i(link_cache, "eth0"))) {
+ fprintf(stderr, "Unable to lookup eth0");
+ return -1;
+ }
+
+ link = rtnl_link_vlan_alloc();
+
+ rtnl_link_set_link(link, master_index);
+
+ rtnl_link_vlan_set_id(link, 10);
+
+ if ((err = rtnl_link_add(sk, link, NLM_F_CREATE)) < 0) {
+ nl_perror(err, "Unable to add link");
+ return err;
+ }
+
+ rtnl_link_put(link);
+ nl_close(sk);
+
+ return 0;
+}
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/test-create-vxlan.c b/ap/lib/libnl/libnl-3.2.25/tests/test-create-vxlan.c
new file mode 100644
index 0000000..98a5103
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/test-create-vxlan.c
@@ -0,0 +1,47 @@
+#include <netlink/netlink.h>
+#include <netlink/route/link.h>
+#include <netlink/route/link/vxlan.h>
+
+int main(int argc, char *argv[])
+{
+ struct rtnl_link *link;
+ struct nl_addr *addr;
+ struct nl_sock *sk;
+ int err;
+
+ sk = nl_socket_alloc();
+ if ((err = nl_connect(sk, NETLINK_ROUTE)) < 0) {
+ nl_perror(err, "Unable to connect socket");
+ return err;
+ }
+
+ link = rtnl_link_vxlan_alloc();
+
+ rtnl_link_set_name(link, "vxlan128");
+
+ if ((err = rtnl_link_vxlan_set_id(link, 128)) < 0) {
+ nl_perror(err, "Unable to set VXLAN network identifier");
+ return err;
+ }
+
+ if ((err = nl_addr_parse("239.0.0.1", AF_INET, &addr)) < 0) {
+ nl_perror(err, "Unable to parse IP address");
+ return err;
+ }
+
+ if ((err = rtnl_link_vxlan_set_group(link, addr)) < 0) {
+ nl_perror(err, "Unable to set multicast IP address");
+ return err;
+ }
+ nl_addr_put(addr);
+
+ if ((err = rtnl_link_add(sk, link, NLM_F_CREATE)) < 0) {
+ nl_perror(err, "Unable to add link");
+ return err;
+ }
+
+ rtnl_link_put(link);
+ nl_close(sk);
+
+ return 0;
+}
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/test-delete-link.c b/ap/lib/libnl/libnl-3.2.25/tests/test-delete-link.c
new file mode 100644
index 0000000..9cf1034
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/test-delete-link.c
@@ -0,0 +1,28 @@
+#include <netlink/netlink.h>
+#include <netlink/route/link.h>
+
+int main(int argc, char *argv[])
+{
+ struct rtnl_link *link;
+ struct nl_sock *sk;
+ int err;
+
+ sk = nl_socket_alloc();
+ if ((err = nl_connect(sk, NETLINK_ROUTE)) < 0) {
+ nl_perror(err, "Unable to connect socket");
+ return err;
+ }
+
+ link = rtnl_link_alloc();
+ rtnl_link_set_name(link, "my_bond");
+
+ if ((err = rtnl_link_delete(sk, link)) < 0) {
+ nl_perror(err, "Unable to delete link");
+ return err;
+ }
+
+ rtnl_link_put(link);
+ nl_close(sk);
+
+ return 0;
+}
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/test-genl.c b/ap/lib/libnl/libnl-3.2.25/tests/test-genl.c
new file mode 100644
index 0000000..74aea10
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/test-genl.c
@@ -0,0 +1,118 @@
+#include <netlink/cli/utils.h>
+#include <linux/taskstats.h>
+
+static struct nla_policy attr_policy[TASKSTATS_TYPE_MAX+1] = {
+ [TASKSTATS_TYPE_PID] = { .type = NLA_U32 },
+ [TASKSTATS_TYPE_TGID] = { .type = NLA_U32 },
+ [TASKSTATS_TYPE_STATS] = { .minlen = sizeof(struct taskstats) },
+ [TASKSTATS_TYPE_AGGR_PID] = { .type = NLA_NESTED },
+ [TASKSTATS_TYPE_AGGR_TGID] = { .type = NLA_NESTED },
+};
+
+
+static int parse_cmd_new(struct nl_cache_ops *unused, struct genl_cmd *cmd,
+ struct genl_info *info, void *arg)
+{
+ struct nlattr *attrs[TASKSTATS_TYPE_MAX+1];
+ struct nlattr *nested;
+ int err;
+
+ if (info->attrs[TASKSTATS_TYPE_AGGR_PID])
+ nested = info->attrs[TASKSTATS_TYPE_AGGR_PID];
+ else if (info->attrs[TASKSTATS_TYPE_AGGR_TGID])
+ nested = info->attrs[TASKSTATS_TYPE_AGGR_TGID];
+ else {
+ fprintf(stderr, "Invalid taskstats message: Unable to find "
+ "nested attribute/\n");
+ return NL_SKIP;
+ }
+
+ err = nla_parse_nested(attrs, TASKSTATS_TYPE_MAX, nested, attr_policy);
+ if (err < 0) {
+ nl_perror(err, "Error while parsing generic netlink message");
+ return err;
+ }
+
+
+ if (attrs[TASKSTATS_TYPE_STATS]) {
+ struct taskstats *stats = nla_data(attrs[TASKSTATS_TYPE_STATS]);
+
+ printf("%s pid %u uid %u gid %u parent %u\n",
+ stats->ac_comm, stats->ac_pid, stats->ac_uid,
+ stats->ac_gid, stats->ac_ppid);
+ }
+
+ return 0;
+}
+
+static int parse_cb(struct nl_msg *msg, void *arg)
+{
+ return genl_handle_msg(msg, NULL);
+}
+
+static struct genl_cmd cmds[] = {
+ {
+ .c_id = TASKSTATS_CMD_NEW,
+ .c_name = "taskstats_new()",
+ .c_maxattr = TASKSTATS_TYPE_MAX,
+ .c_attr_policy = attr_policy,
+ .c_msg_parser = &parse_cmd_new,
+ },
+};
+
+#define ARRAY_SIZE(X) (sizeof(X) / sizeof((X)[0]))
+
+static struct genl_ops ops = {
+ .o_name = TASKSTATS_GENL_NAME,
+ .o_cmds = cmds,
+ .o_ncmds = ARRAY_SIZE(cmds),
+};
+
+int main(int argc, char *argv[])
+{
+ struct nl_sock *sock;
+ struct nl_msg *msg;
+ void *hdr;
+ int err;
+
+ sock = nl_cli_alloc_socket();
+ nl_cli_connect(sock, NETLINK_GENERIC);
+
+ if ((err = genl_register_family(&ops)) < 0)
+ nl_cli_fatal(err, "Unable to register Generic Netlink family");
+
+ if ((err = genl_ops_resolve(sock, &ops)) < 0)
+ nl_cli_fatal(err, "Unable to resolve family name");
+
+ if (genl_ctrl_resolve(sock, "nlctrl") != GENL_ID_CTRL)
+ nl_cli_fatal(NLE_INVAL, "Resolving of \"nlctrl\" failed");
+
+ msg = nlmsg_alloc();
+ if (msg == NULL)
+ nl_cli_fatal(NLE_NOMEM, "Unable to allocate netlink message");
+
+ hdr = genlmsg_put(msg, NL_AUTO_PORT, NL_AUTO_SEQ, ops.o_id,
+ 0, 0, TASKSTATS_CMD_GET, TASKSTATS_GENL_VERSION);
+ if (hdr == NULL)
+ nl_cli_fatal(ENOMEM, "Unable to write genl header");
+
+ if ((err = nla_put_u32(msg, TASKSTATS_CMD_ATTR_PID, 1)) < 0)
+ nl_cli_fatal(err, "Unable to add attribute: %s", nl_geterror(err));
+
+ if ((err = nl_send_auto_complete(sock, msg)) < 0)
+ nl_cli_fatal(err, "Unable to send message: %s", nl_geterror(err));
+
+ nlmsg_free(msg);
+
+ if ((err = nl_socket_modify_cb(sock, NL_CB_VALID, NL_CB_CUSTOM,
+ parse_cb, NULL)) < 0)
+ nl_cli_fatal(err, "Unable to modify valid message callback");
+
+ if ((err = nl_recvmsgs_default(sock)) < 0)
+ nl_cli_fatal(err, "Unable to receive message: %s", nl_geterror(err));
+
+ nl_close(sock);
+ nl_socket_free(sock);
+
+ return 0;
+}
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/test-nf-cache-mngr.c b/ap/lib/libnl/libnl-3.2.25/tests/test-nf-cache-mngr.c
new file mode 100644
index 0000000..b4f3022
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/test-nf-cache-mngr.c
@@ -0,0 +1,57 @@
+#include <netlink/cli/utils.h>
+
+static void change_cb(struct nl_cache *cache, struct nl_object *obj,
+ int action, void *data)
+{
+ struct nfnl_ct *ct = (struct nfnl_ct *) obj;
+ static struct nl_addr *hack = NULL;
+
+ if (!hack)
+ nl_addr_parse("194.88.212.233", AF_INET, &hack);
+
+ if (!nl_addr_cmp(hack, nfnl_ct_get_src(ct, 1)) ||
+ !nl_addr_cmp(hack, nfnl_ct_get_dst(ct, 1))) {
+ struct nl_dump_params dp = {
+ .dp_type = NL_DUMP_LINE,
+ .dp_fd = stdout,
+ };
+
+ printf("UPDATE ");
+ nl_object_dump(obj, &dp);
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ struct nl_cache_mngr *mngr;
+ struct nl_sock *sock;
+ struct nl_cache *ct;
+ int err;
+
+ sock = nl_cli_alloc_socket();
+
+ err = nl_cache_mngr_alloc(sock, NETLINK_NETFILTER, NL_AUTO_PROVIDE, &mngr);
+ if (err < 0) {
+ nl_perror(err, "nl_cache_mngr_alloc");
+ return -1;
+ }
+
+ err = nl_cache_mngr_add(mngr, "netfilter/ct", &change_cb, NULL, &ct);
+ if (err < 0) {
+ nl_perror(err, "nl_cache_mngr_add(netfilter/ct)");
+ return -1;
+ }
+
+ for (;;) {
+ int err = nl_cache_mngr_poll(mngr, 5000);
+ if (err < 0) {
+ nl_perror(err, "nl_cache_mngr_poll()");
+ return -1;
+ }
+
+ }
+
+ nl_cache_mngr_free(mngr);
+
+ return 0;
+}
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/test-socket-creation.c b/ap/lib/libnl/libnl-3.2.25/tests/test-socket-creation.c
new file mode 100644
index 0000000..83f3ad4
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/test-socket-creation.c
@@ -0,0 +1,28 @@
+#include <netlink/netlink.h>
+#include <errno.h>
+
+int main(int argc, char *argv[])
+{
+ struct nl_sock *h[1025];
+ int i;
+
+ h[0] = nl_socket_alloc();
+ printf("Created handle with port 0x%x\n",
+ nl_socket_get_local_port(h[0]));
+ nl_socket_free(h[0]);
+ h[0] = nl_socket_alloc();
+ printf("Created handle with port 0x%x\n",
+ nl_socket_get_local_port(h[0]));
+ nl_socket_free(h[0]);
+
+ for (i = 0; i < 1025; i++) {
+ h[i] = nl_socket_alloc();
+ if (h[i] == NULL)
+ nl_perror(ENOMEM, "Unable to allocate socket");
+ else
+ printf("Created handle with port 0x%x\n",
+ nl_socket_get_local_port(h[i]));
+ }
+
+ return 0;
+}
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/test-u32-filter-with-actions.c b/ap/lib/libnl/libnl-3.2.25/tests/test-u32-filter-with-actions.c
new file mode 100644
index 0000000..55f913a
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/test-u32-filter-with-actions.c
@@ -0,0 +1,400 @@
+/*
+ * test/tests-u32-with-actions.c Add ingress qdisc, create some hash filters, and add redirect action
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation version 2.1
+ * of the License.
+ *
+ * Stolen from tests/test-complex-HTB-with-hash-filters.c
+ *
+ * Copyright (c) 2013 Cong Wang <xiyou.wangcong@gmail.com>
+ */
+
+#include <netlink/route/link.h>
+#include <netlink/route/tc.h>
+#include <netlink/route/qdisc.h>
+#include <netlink/route/cls/u32.h>
+#include <netlink/route/classifier.h>
+#include <netlink/route/action.h>
+#include <netlink/route/act/mirred.h>
+#include <netlink/route/class.h>
+#include <linux/if_ether.h>
+
+#include <netlink/attr.h>
+#include <stdio.h>
+#include <string.h>
+
+#define TC_HANDLE(maj, min) (TC_H_MAJ((maj) << 16) | TC_H_MIN(min))
+
+/* some functions are copied from iproute-tc tool */
+static int get_u32(__u32 *val, const char *arg, int base)
+{
+ unsigned long res;
+ char *ptr;
+
+ if (!arg || !*arg)
+ return -1;
+ res = strtoul(arg, &ptr, base);
+ if (!ptr || ptr == arg || *ptr || res > 0xFFFFFFFFUL)
+ return -1;
+ *val = res;
+ return 0;
+}
+
+static int get_u32_handle(__u32 *handle, const char *str)
+{
+ __u32 htid=0, hash=0, nodeid=0;
+ char *tmp = strchr(str, ':');
+
+ if (tmp == NULL) {
+ if (memcmp("0x", str, 2) == 0)
+ return get_u32(handle, str, 16);
+ return -1;
+ }
+ htid = strtoul(str, &tmp, 16);
+ if (tmp == str && *str != ':' && *str != 0)
+ return -1;
+ if (htid>=0x1000)
+ return -1;
+ if (*tmp) {
+ str = tmp+1;
+ hash = strtoul(str, &tmp, 16);
+ if (tmp == str && *str != ':' && *str != 0)
+ return -1;
+ if (hash>=0x100)
+ return -1;
+ if (*tmp) {
+ str = tmp+1;
+ nodeid = strtoul(str, &tmp, 16);
+ if (tmp == str && *str != 0)
+ return -1;
+ if (nodeid>=0x1000)
+ return -1;
+ }
+ }
+ *handle = (htid<<20)|(hash<<12)|nodeid;
+ return 0;
+}
+
+static uint32_t get_u32_parse_handle(const char *cHandle)
+{
+ uint32_t handle=0;
+
+ if(get_u32_handle(&handle, cHandle)) {
+ printf ("Illegal \"ht\"\n");
+ return -1;
+ }
+
+ if (handle && TC_U32_NODE(handle)) {
+ printf("\"link\" must be a hash table.\n");
+ return -1;
+ }
+ return handle;
+}
+
+/*
+ * Function that adds a new filter and attach it to a hash table
+ * and set next hash table link with hash mask
+ *
+ */
+static
+int u32_add_filter_on_ht_with_hashmask(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t prio,
+ uint32_t keyval, uint32_t keymask, int keyoff, int keyoffmask,
+ uint32_t htid, uint32_t htlink, uint32_t hmask, uint32_t hoffset, struct rtnl_act *act)
+{
+ struct rtnl_cls *cls;
+ int err;
+
+ cls=rtnl_cls_alloc();
+ if (!(cls)) {
+ printf("Can not allocate classifier\n");
+ nl_socket_free(sock);
+ exit(1);
+ }
+
+ rtnl_tc_set_link(TC_CAST(cls), rtnlLink);
+
+ if ((err = rtnl_tc_set_kind(TC_CAST(cls), "u32"))) {
+ printf("Can not set classifier as u32\n");
+ return 1;
+ }
+
+ rtnl_cls_set_prio(cls, prio);
+ rtnl_cls_set_protocol(cls, ETH_P_IP);
+
+ rtnl_tc_set_parent(TC_CAST(cls), TC_HANDLE(0xffff, 0));
+
+ if (htid)
+ rtnl_u32_set_hashtable(cls, htid);
+
+ rtnl_u32_add_key_uint32(cls, keyval, keymask, keyoff, keyoffmask);
+
+ rtnl_u32_set_hashmask(cls, hmask, hoffset);
+
+ rtnl_u32_set_link(cls, htlink);
+
+ rtnl_u32_add_action(cls, act);
+
+
+ if ((err = rtnl_cls_add(sock, cls, NLM_F_CREATE))) {
+ printf("Can not add classifier: %s\n", nl_geterror(err));
+ return -1;
+ }
+ rtnl_cls_put(cls);
+ return 0;
+}
+
+/*
+ * function that creates a new hash table
+ */
+static
+int u32_add_ht(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t prio, uint32_t htid, uint32_t divisor)
+{
+
+ int err;
+ struct rtnl_cls *cls;
+
+ cls=rtnl_cls_alloc();
+ if (!(cls)) {
+ printf("Can not allocate classifier\n");
+ nl_socket_free(sock);
+ exit(1);
+ }
+
+ rtnl_tc_set_link(TC_CAST(cls), rtnlLink);
+
+ if ((err = rtnl_tc_set_kind(TC_CAST(cls), "u32"))) {
+ printf("Can not set classifier as u32\n");
+ return 1;
+ }
+
+ rtnl_cls_set_prio(cls, prio);
+ rtnl_cls_set_protocol(cls, ETH_P_IP);
+ rtnl_tc_set_parent(TC_CAST(cls), TC_HANDLE(0xffff, 0));
+
+ rtnl_u32_set_handle(cls, htid, 0x0, 0x0);
+ //printf("htid: 0x%X\n", htid);
+ rtnl_u32_set_divisor(cls, divisor);
+
+ if ((err = rtnl_cls_add(sock, cls, NLM_F_CREATE))) {
+ printf("Can not add classifier: %s\n", nl_geterror(err));
+ return -1;
+ }
+ rtnl_cls_put(cls);
+ return 0;
+}
+
+/*
+ * function that adds a new ingress qdisc and set the default class for unclassified traffic
+ */
+static
+int qdisc_add_ingress(struct nl_sock *sock, struct rtnl_link *rtnlLink)
+{
+
+ struct rtnl_qdisc *qdisc;
+ int err;
+
+ /* Allocation of a qdisc object */
+ if (!(qdisc = rtnl_qdisc_alloc())) {
+ printf("Can not allocate Qdisc\n");
+ return -1;
+ }
+
+ //rtnl_tc_set_ifindex(TC_CAST(qdisc), master_index);
+ rtnl_tc_set_link(TC_CAST(qdisc), rtnlLink);
+ rtnl_tc_set_parent(TC_CAST(qdisc), TC_H_ROOT);
+
+ //printf("Delete current qdisc\n");
+ rtnl_qdisc_delete(sock, qdisc);
+ //rtnl_qdisc_put(qdisc);
+
+ rtnl_tc_set_handle(TC_CAST(qdisc), TC_HANDLE(0xffff, 0));
+
+ if ((err = rtnl_tc_set_kind(TC_CAST(qdisc), "ingress"))) {
+ printf("Can not allocate ingress\n");
+ return -1;
+ }
+
+ /* Submit request to kernel and wait for response */
+ if ((err = rtnl_qdisc_add(sock, qdisc, NLM_F_CREATE))) {
+ printf("Can not allocate ingress Qdisc\n");
+ return -1;
+ }
+
+ /* Return the qdisc object to free memory resources */
+ rtnl_qdisc_put(qdisc);
+
+ return 0;
+}
+
+int main(void)
+{
+ struct nl_sock *sock;
+ struct rtnl_link *link;
+ uint32_t ht, htlink, htid, direction;
+ char chashlink[16]="";
+ int err;
+ struct nl_cache *link_cache;
+ struct rtnl_act *act;
+
+ if (!(sock = nl_socket_alloc())) {
+ printf("Unable to allocate netlink socket\n");
+ exit(1);
+ }
+
+ if ((err = nl_connect(sock, NETLINK_ROUTE)) < 0 ) {
+ printf("Nu s-a putut conecta la NETLINK!\n");
+ nl_socket_free(sock);
+ exit(1);
+ }
+
+ if ((err = rtnl_link_alloc_cache(sock, AF_UNSPEC, &link_cache)) < 0) {
+ printf("Unable to allocate link cache: %s\n",
+ nl_geterror(err));
+ nl_socket_free(sock);
+ exit(1);
+ }
+
+ /* lookup interface index of eth0 */
+ if (!(link = rtnl_link_get_by_name(link_cache, "eth0"))) {
+ /* error */
+ printf("Interface not found\n");
+ nl_socket_free(sock);
+ exit(1);
+ }
+
+ err=qdisc_add_ingress(sock, link);
+ //printf("Add main hash table\n");
+
+ /* create u32 first hash filter table
+ *
+ */
+ /* formula calcul handle:
+ * uint32_t handle = (htid << 20) | (hash << 12) | nodeid;
+ */
+
+ /*
+ * Upper limit of number of hash tables: 4096 (0xFFF)
+ * Number of hashes in a table: 256 values (0xFF)
+ *
+ */
+
+ /* using 256 values for hash table
+ * each entry in hash table match a byte from IP address specified later by a hash key
+ */
+
+ uint32_t i;
+ for (i = 1; i <= 0xf; i++)
+ u32_add_ht(sock, link, 1, i, 256);
+
+ /*
+ * attach a u32 filter to the first hash
+ * that redirects all traffic and make a hash key
+ * from the fist byte of the IP address
+ *
+ */
+
+ //divisor=0x0; // unused here
+ //handle = 0x0; // unused here
+ //hash = 0x0; // unused here
+ //htid = 0x0; // unused here
+ //nodeid = 0x0; // unused here
+
+ // direction = 12 -> source IP
+ // direction = 16 -> destination IP
+ direction = 16;
+
+ /*
+ * which hash table will use
+ * in our case is hash table no 1 defined previous
+ *
+ * There are 2 posibilities to set the the hash table:
+ * 1. Using function get_u32_handle and sent a string in
+ * format 10: where 10 is number of the hash table
+ * 2. Create your own value in format: 0xa00000
+ *
+ */
+ strcpy(chashlink, "1:");
+ //printf("Hash Link: %s\n", chashlink);
+ //chashlink=malloc(sizeof(char) *
+ htlink = 0x0; // is used by get_u32_handle to return the correct value of hash table (link)
+
+ if(get_u32_handle(&htlink, chashlink)) {
+ printf ("Illegal \"link\"");
+ nl_socket_free(sock);
+ exit(1);
+ }
+ //printf ("hash link : 0x%X\n", htlink);
+ //printf ("hash link test : %u\n", (htlink && TC_U32_NODE(htlink)));
+
+ if (htlink && TC_U32_NODE(htlink)) {
+ printf("\"link\" must be a hash table.\n");
+ nl_socket_free(sock);
+ exit(1);
+ }
+
+ /* the hash mask will hit the hash table (link) no 1: in our case
+ */
+
+ /* set the hash key mask */
+ //hashmask = 0xFF000000UL; // the mask that is used to match the hash in specific table, in our case for example 1:a with mean the first byte which is 10 in hash table 1
+
+ /* Here we add a hash filter which match the first byte (see the hashmask value)
+ * of the source IP (offset 12 in the packet header)
+ * You can use also offset 16 to match the destination IP
+ */
+
+ /*
+ * Also we need a filter to match our rule
+ * This mean that we will put a 0.0.0.0/0 filter in our first rule
+ * that match the offset 12 (source IP)
+ * Also you can put offset 16 to match the destination IP
+ */
+
+ u32_add_filter_on_ht_with_hashmask(sock, link, 1,
+ 0x0, 0x0, direction, 0,
+ 0, htlink, 0xff000000, direction, NULL);
+
+ /*
+ * For each first byte that we need to match we will create a new hash table
+ * For example: you have those clases: 10.0.0.0/24 and 172.16.0.0/23
+ * For byte 10 and byte 172 will create a separate hash table that will match the second
+ * byte from each class.
+ *
+ */
+
+
+ /*
+ * Now we will create other filter under (ATENTION) our first hash table (link) 1:
+ * Previous rule redirects the trafic according the hash mask to hash table (link) no 1:
+ * Here we will match the hash tables from 1:0 to 1:ff. Under each hash table we will attach
+ * other rules that matches next byte from IP source/destination IP and we will repeat the
+ * previous steps.
+ *
+ */
+
+ act = rtnl_act_alloc();
+ if (!act) {
+ printf("rtnl_act_alloc() returns %p\n", act);
+ return -1;
+ }
+ rtnl_tc_set_kind(TC_CAST(act), "mirred");
+ rtnl_mirred_set_action(act, TCA_EGRESS_REDIR);
+ rtnl_mirred_set_policy(act, TC_ACT_STOLEN);
+ rtnl_mirred_set_ifindex(act, rtnl_link_name2i(link_cache, "eth1"));
+ // /8 check
+
+ // 10.0.0.0/8
+ ht=get_u32_parse_handle("1:a:");
+ htid = (ht&0xFFFFF000);
+ htlink=get_u32_parse_handle("2:");
+
+ u32_add_filter_on_ht_with_hashmask(sock, link, 1,
+ 0x0a000000, 0xff000000, direction, 0,
+ htid, htlink, 0x00ff0000, direction, act);
+
+ rtnl_act_put(act);
+ nl_socket_free(sock);
+ return 0;
+}
diff --git a/ap/lib/libnl/libnl-3.2.25/tests/util.h b/ap/lib/libnl/libnl-3.2.25/tests/util.h
new file mode 100644
index 0000000..c675383
--- /dev/null
+++ b/ap/lib/libnl/libnl-3.2.25/tests/util.h
@@ -0,0 +1,5 @@
+#include <check.h>
+
+#define nl_fail_if(condition, error, message) \
+ fail_if((condition), "nlerr=%d (%s): %s", \
+ (error), nl_geterror(error), (message))