diff --git a/.gitignore b/.gitignore index 2607a911..f352ba55 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,9 @@ m4/ bbf_ubus memory-report.xml *.la +CMakeCache.txt +CMakeFiles/ +cmake_install.cmake +install_manifest.txt +*.so + diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..b8f437bc --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,207 @@ +cmake_minimum_required(VERSION 3.0) + +PROJECT(bbf C) + +ADD_DEFINITIONS(-Wall -Werror) +ADD_DEFINITIONS(-D_GNU_SOURCE) +ADD_DEFINITIONS(-DBBF_VENDOR_PREFIX="${BBF_VENDOR_PREFIX}") + +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I. -I./dmtree -I./dmtree/tr181 -I./dmtree/tr104 -I./dmtree/tr143") + +OPTION(BBF_TR181 "build with tr181 datamodel" ON) +OPTION(BBF_TR104 "build with tr104 datamodel" ON) +OPTION(BBF_TR143 "build with tr143 datamodel" ON) +OPTION(BBF_DOTSO_PLUGIN "build with dotso plugin" ON) +OPTION(BBF_JSON_PLUGIN "build with json plugin" ON) +OPTION(BBF_VENDOR_EXTENSION "build with vendor extension enabled" ON) +OPTION(WITH_WOLFSSL "build with lib wolfssl" OFF) +OPTION(WITH_OPENSSL "build with lib openssl" ON) +OPTION(WITH_MBEDTLS "build with lib mbedtls" OFF) + +SET(BBF_API_SOURCES libbbf_api/dmbbf.c + libbbf_api/dmubus.c + libbbf_api/dmjson.c + libbbf_api/dmuci.c + libbbf_api/dmcommon.c + libbbf_api/dmmem.c + libbbf_api/dmapi.c) + +SET(BBF_DM_SOURCES dmentry.c + dmdiagnostics.c + dmbbfcommon.c) + +IF(BBF_TR181) + SET(BBF_TR181_SOURCES dmtree/tr181/device.c + dmtree/tr181/deviceinfo.c + dmtree/tr181/managementserver.c + dmtree/tr181/times.c + dmtree/tr181/upnp.c + dmtree/tr181/wifi.c + dmtree/tr181/ethernet.c + dmtree/tr181/atm.c + dmtree/tr181/ptm.c + dmtree/tr181/bridging.c + dmtree/tr181/hosts.c + dmtree/tr181/dhcpv4.c + dmtree/tr181/ip.c + dmtree/tr181/ppp.c + dmtree/tr181/nat.c + dmtree/tr181/routing.c + dmtree/tr181/firewall.c + dmtree/tr181/dns.c + dmtree/tr181/users.c + dmtree/tr181/dhcpv6.c + dmtree/tr181/dsl.c + dmtree/tr181/fast.c + dmtree/tr181/interfacestack.c + dmtree/tr181/usb.c + dmtree/tr181/gre.c + dmtree/tr181/dynamicdns.c + dmtree/tr181/security.c + dmtree/tr181/lanconfigsecurity.c + dmtree/tr181/ieee1905.c + dmtree/tr181/qos.c + dmtree/tr181/routeradvertisement.c) + add_compile_definitions(BBF_TR181) +ENDIF(BBF_TR181) + +IF(BBF_TR104) + SET(BBF_TR104_SOURCES dmtree/tr104/common.c + dmtree/tr104/servicesvoiceservicecalllog.c + dmtree/tr104/servicesvoiceservicesip.c + dmtree/tr104/servicesvoiceservice.c + dmtree/tr104/servicesvoiceservicecapabilities.c + dmtree/tr104/servicesvoiceservicepots.c + dmtree/tr104/servicesvoiceservicevoipprofile.c + dmtree/tr104/servicesvoiceservicecallcontrol.c + dmtree/tr104/servicesvoiceservicecodecprofile.c + dmtree/tr104/servicesvoiceservicereservedports.c + dmtree/tr104/servicesvoiceservicedect.c) + add_compile_definitions(BBF_TR104) +ENDIF(BBF_TR104) + +IF(BBF_TR143) + SET(BBF_TR143_SOURCES dmtree/tr143/diagnostics.c) + add_compile_definitions(BBF_TR143) +ENDIF(BBF_TR143) + +IF(BBF_DOTSO_PLUGIN) + SET(BBF_DOTSO_PLUGIN_SOURCES dmdynamiclibrary.c) + add_compile_definitions(BBFDM_ENABLE_DOTSO_PLUGIN) +ENDIF(BBF_DOTSO_PLUGIN) + +IF(BBF_JSON_PLUGIN) + SET(BBF_JSON_PLUGIN_SOURCES dmdynamicjson.c) + add_compile_definitions(BBFDM_ENABLE_JSON_PLUGIN) +endif(BBF_JSON_PLUGIN) + +IF(WITH_WOLFSSL) + SET(SSL_LIBS wolfssl) + SET(CRYPTO_LIBS crypto) + add_compile_definitions(LWOLFSSL) +ENDIF(WITH_WOLFSSL) + +IF(WITH_OPENSSL) + SET(SSL_LIBS ssl) + SET(CRYPTO_LIBS crypto) + add_compile_definitions(LOPENSSL) +ENDIF(WITH_OPENSSL) + +IF(WITH_MBEDTLS) + SET(SSL_LIBS mbedtls) + SET(CRYPTO_LIBS mbedcrypto) + add_compile_definitions(LMBEDTLS) +ENDIF(WITH_MBEDTLS) + +IF(BBF_VENDOR_EXTENSION) + SET(BBF_VENDOR_EXTENSION_SOURCES dmdynamicvendor.c dmtree/vendor/vendor.c) + ADD_DEFINITIONS(-DBBF_VENDOR_LIST="${BBF_VENDOR_LIST}") + add_compile_definitions(BBF_VENDOR_EXTENSION) + + SET(BBF_VENDOR_LIST "iopsys" CACHE STRING "vendor list to be used") + + IF(BBF_VENDOR_LIST MATCHES "(.*)iopsys(.*)") + add_compile_definitions(BBF_VENDOR_IOPSYS) + + IF(BBF_TR181) + SET(BBF_VENDOR_IOPSYS_TR181_SOURCES dmtree/vendor/iopsys/tr181/vendor.c + dmtree/vendor/iopsys/tr181/device.c + dmtree/vendor/iopsys/tr181/deviceinfo.c + dmtree/vendor/iopsys/tr181/bridging.c + dmtree/vendor/iopsys/tr181/ethernet.c + dmtree/vendor/iopsys/tr181/times.c + dmtree/vendor/iopsys/tr181/x_iopsys_eu_igmp.c + dmtree/vendor/iopsys/tr181/x_iopsys_eu_mld.c) + ENDIF(BBF_TR181) + + IF(BBF_TR104) + SET(BBF_VENDOR_IOPSYS_TR104_SOURCES dmtree/vendor/iopsys/tr104/servicesvoiceservicecallcontrol.c + dmtree/vendor/iopsys/tr104/servicesvoiceservicecalllog.c + dmtree/vendor/iopsys/tr104/servicesvoiceservicedect.c) + ENDIF(BBF_TR104) + + ENDIF(BBF_VENDOR_LIST MATCHES "(.*)iopsys(.*)") + + IF(BBF_VENDOR_LIST MATCHES "(.*)openwrt(.*)") + add_compile_definitions(BBF_VENDOR_OPENWRT) + + IF(BBF_TR181) + SET(BBF_VENDOR_OPENWRT_TR181_SOURCES dmtree/vendor/openwrt/tr181/vendor.c + dmtree/vendor/openwrt/tr181/deviceinfo.c + dmtree/vendor/openwrt/tr181/qos.c) + ENDIF(BBF_TR181) + + ENDIF(BBF_VENDOR_LIST MATCHES "(.*)openwrt(.*)") + + IF(BBF_VENDOR_LIST MATCHES "(.*)test(.*)") + add_compile_definitions(BBF_VENDOR_TEST) + + IF(BBF_TR181) + SET(BBF_VENDOR_TEST_TR181_SOURCES dmtree/vendor/test/tr181/vendor.c + dmtree/vendor/test/tr181/deviceinfo.c + dmtree/vendor/test/tr181/firewall.c + dmtree/vendor/test/tr181/device.c + dmtree/vendor/test/tr181/x_test_com_dropbear.c) + ENDIF(BBF_TR181) + + ENDIF(BBF_VENDOR_LIST MATCHES "(.*)test(.*)") + +ENDIF(BBF_VENDOR_EXTENSION) + +ADD_LIBRARY(bbfdm SHARED ${BBF_API_SOURCES} ${BBF_DM_SOURCES} + ${BBF_TR181_SOURCES} ${BBF_TR104_SOURCES} ${BBF_TR143_SOURCES} + ${BBF_DOTSO_PLUGIN_SOURCES} ${BBF_JSON_PLUGIN_SOURCES} ${BBF_VENDOR_EXTENSION_SOURCES} + ${BBF_VENDOR_IOPSYS_TR181_SOURCES} ${BBF_VENDOR_IOPSYS_TR104_SOURCES} + ${BBF_VENDOR_OPENWRT_TR181_SOURCES} + ${BBF_VENDOR_TEST_TR181_SOURCES}) + +TARGET_LINK_LIBRARIES(bbfdm uci ubus ubox json-c blobmsg_json trace dl curl ${SSL_LIBS} ${CRYPTO_LIBS}) + +INSTALL(TARGETS bbfdm + LIBRARY DESTINATION "/usr/lib") + +INSTALL(DIRECTORY DESTINATION "/etc/bbfdm") +INSTALL(DIRECTORY DESTINATION "/etc/bbfdm/dmmap") +INSTALL(DIRECTORY DESTINATION "/etc/bbfdm/json") +INSTALL(DIRECTORY DESTINATION "/usr/share/bbfdm") +INSTALL(DIRECTORY DESTINATION "/usr/lib/bbfdm") + +FILE(GLOB headers include/*.h) +INSTALL(FILES ${headers} + DESTINATION include +) + +FILE(GLOB libbbf_api_headers libbbf_api/*.h) +INSTALL(FILES ${libbbf_api_headers} + DESTINATION include/libbbf_api +) + +FILE(GLOB libbbfdm_headers *.h) +INSTALL(FILES ${libbbfdm_headers} + DESTINATION include/libbbfdm +) + +FILE(GLOB scripts scripts/*) +INSTALL(FILES ${scripts} + DESTINATION "/usr/share/bbfdm" +) diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index c34dc353..00000000 --- a/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -MAINTAINERCLEANFILES = Makefile.in - -libbbfdm_includedir = $(includedir)/libbbfdm -libbbf_api_includedir = $(includedir)/libbbf_api -libbbf_includedir = $(includedir)/ - -libbbfdm_tr181_includedir = $(libbbfdm_includedir) -libbbfdm_include_HEADERS = *.h -libbbf_api_include_HEADERS = libbbf_api/*.h -libbbf_include_HEADERS = include/*.h - -SUBDIRS = bin diff --git a/bin/Makefile.am b/bin/Makefile.am deleted file mode 100644 index e6cce1b9..00000000 --- a/bin/Makefile.am +++ /dev/null @@ -1,166 +0,0 @@ -lib_LTLIBRARIES = libbbfdm.la - -libbbfdm_la_SOURCES = \ - ../dmentry.c \ - ../dmdiagnostics.c \ - ../dmbbfcommon.c \ - ../libbbf_api/dmbbf.c \ - ../libbbf_api/dmubus.c \ - ../libbbf_api/dmjson.c \ - ../libbbf_api/dmuci.c \ - ../libbbf_api/dmcommon.c \ - ../libbbf_api/dmmem.c \ - ../libbbf_api/dmapi.c - -if BBF_TR181 -libbbfdm_la_SOURCES += \ - ../dmtree/tr181/device.c \ - ../dmtree/tr181/deviceinfo.c \ - ../dmtree/tr181/managementserver.c \ - ../dmtree/tr181/times.c \ - ../dmtree/tr181/upnp.c \ - ../dmtree/tr181/wifi.c \ - ../dmtree/tr181/ethernet.c \ - ../dmtree/tr181/atm.c \ - ../dmtree/tr181/ptm.c \ - ../dmtree/tr181/bridging.c \ - ../dmtree/tr181/hosts.c \ - ../dmtree/tr181/dhcpv4.c \ - ../dmtree/tr181/ip.c \ - ../dmtree/tr181/ppp.c \ - ../dmtree/tr181/nat.c \ - ../dmtree/tr181/routing.c \ - ../dmtree/tr181/firewall.c \ - ../dmtree/tr181/dns.c \ - ../dmtree/tr181/users.c \ - ../dmtree/tr181/dhcpv6.c \ - ../dmtree/tr181/dsl.c \ - ../dmtree/tr181/fast.c \ - ../dmtree/tr181/interfacestack.c \ - ../dmtree/tr181/usb.c \ - ../dmtree/tr181/gre.c \ - ../dmtree/tr181/dynamicdns.c \ - ../dmtree/tr181/security.c \ - ../dmtree/tr181/lanconfigsecurity.c \ - ../dmtree/tr181/ieee1905.c \ - ../dmtree/tr181/qos.c \ - ../dmtree/tr181/routeradvertisement.c -endif #BBF_TR181 - -if BBF_TR104 -libbbfdm_la_SOURCES += \ - ../dmtree/tr104/common.c \ - ../dmtree/tr104/servicesvoiceservicecalllog.c \ - ../dmtree/tr104/servicesvoiceservicesip.c \ - ../dmtree/tr104/servicesvoiceservice.c \ - ../dmtree/tr104/servicesvoiceservicecapabilities.c \ - ../dmtree/tr104/servicesvoiceservicepots.c \ - ../dmtree/tr104/servicesvoiceservicevoipprofile.c \ - ../dmtree/tr104/servicesvoiceservicecallcontrol.c \ - ../dmtree/tr104/servicesvoiceservicecodecprofile.c \ - ../dmtree/tr104/servicesvoiceservicereservedports.c \ - ../dmtree/tr104/servicesvoiceservicedect.c -endif #BBF_TR104 - -if BBF_TR143 -libbbfdm_la_SOURCES += \ - ../dmtree/tr143/diagnostics.c -endif #BBF_TR143 - -if BBFDM_ENABLE_DOTSO_PLUGIN -libbbfdm_la_SOURCES += \ - ../dmdynamiclibrary.c -endif #BBFDM_ENABLE_DOTSO_PLUGIN - -if BBFDM_ENABLE_JSON_PLUGIN -libbbfdm_la_SOURCES += \ - ../dmdynamicjson.c -endif #BBFDM_ENABLE_JSON_PLUGIN - -if BBF_VENDOR_EXTENSION - -libbbfdm_la_SOURCES += \ - ../dmdynamicvendor.c \ - ../dmtree/vendor/vendor.c - -if BBF_VENDOR_IOPSYS - -if BBF_TR181 -libbbfdm_la_SOURCES += \ - ../dmtree/vendor/iopsys/tr181/vendor.c \ - ../dmtree/vendor/iopsys/tr181/device.c \ - ../dmtree/vendor/iopsys/tr181/deviceinfo.c \ - ../dmtree/vendor/iopsys/tr181/bridging.c \ - ../dmtree/vendor/iopsys/tr181/ethernet.c \ - ../dmtree/vendor/iopsys/tr181/times.c \ - ../dmtree/vendor/iopsys/tr181/x_iopsys_eu_igmp.c \ - ../dmtree/vendor/iopsys/tr181/x_iopsys_eu_mld.c -endif #BBF_TR181 - -if BBF_TR104 -libbbfdm_la_SOURCES += \ - ../dmtree/vendor/iopsys/tr104/servicesvoiceservicecallcontrol.c \ - ../dmtree/vendor/iopsys/tr104/servicesvoiceservicecalllog.c \ - ../dmtree/vendor/iopsys/tr104/servicesvoiceservicedect.c -endif #BBF_TR104 - -endif #BBF_VENDOR_IOPSYS - -if BBF_VENDOR_OPENWRT - -if BBF_TR181 -libbbfdm_la_SOURCES += \ - ../dmtree/vendor/openwrt/tr181/vendor.c \ - ../dmtree/vendor/openwrt/tr181/deviceinfo.c \ - ../dmtree/vendor/openwrt/tr181/qos.c -endif #BBF_TR181 - -endif #BBF_VENDOR_OPENWRT - -if BBF_VENDOR_TEST - -if BBF_TR181 -libbbfdm_la_SOURCES += \ - ../dmtree/vendor/test/tr181/vendor.c \ - ../dmtree/vendor/test/tr181/deviceinfo.c \ - ../dmtree/vendor/test/tr181/firewall.c \ - ../dmtree/vendor/test/tr181/device.c \ - ../dmtree/vendor/test/tr181/x_test_com_dropbear.c -endif #BBF_TR181 - -endif #BBF_VENDOR_TEST - -endif #BBF_VENDOR_EXTENSION - -libbbfdm_la_CFLAGS = \ - $(AM_CFLAGS) \ - $(LIBUCI_CFLAGS) \ - $(LIBUBOX_CFLAGS) \ - $(LIBUBUS_CFLAGS) - -libbbfdm_la_LDFLAGS = \ - $(AM_LDFLAGS) \ - $(LIBUCI_LDFLAGS) \ - $(LIBUBOX_LDFLAGS) \ - $(LIBUBUS_LDFLAGS) \ - $(LIBSSL_LIBS) \ - $(LIBMBETLS_LIBS) - -libbbfdm_la_LIBADD = \ - $(AM_LIBS) \ - $(LIBUCI_LIBS) \ - $(LIBUBOX_LIBS) \ - $(LIBUBUS_LIBS) \ - $(LIBJSON_LIBS) \ - $(LIBTRACE_LIBS) \ - $(LBLOBMSG_LIBS) \ - $(LIBDLOPEN_LIBS) \ - $(LIBCURL_LIBS) \ - $(LIBSSL_LIBS) \ - $(LIBCRYPTO_LIBS) - -libbbfdm_la_CFLAGS+=-I../ -libbbfdm_la_CFLAGS+=-I../dmtree -libbbfdm_la_CFLAGS+=-I../dmtree/tr181 -libbbfdm_la_CFLAGS+=-I../dmtree/tr104 -libbbfdm_la_CFLAGS+=-I../dmtree/tr143 diff --git a/configure.ac b/configure.ac deleted file mode 100644 index e4558a5e..00000000 --- a/configure.ac +++ /dev/null @@ -1,146 +0,0 @@ -AC_INIT([libbbfdm], [1.0], [dev@iopsys.eu]) -AC_CONFIG_MACRO_DIR([m4]) - -AM_INIT_AUTOMAKE([foreign subdir-objects]) - -#AC_CONFIG_SUBDIRS([libbbf_ubus]) - -AC_ARG_ENABLE(tr181, [AS_HELP_STRING([--enable-tr181], [enable tr181 device feature])], AC_DEFINE(BBF_TR181),) -AM_CONDITIONAL([BBF_TR181],[test "x$enable_tr181" = "xyes"]) - -AC_ARG_ENABLE(tr104, [AS_HELP_STRING([--enable-tr104], [enable tr104 voice feature])], AC_DEFINE(BBF_TR104),) -AM_CONDITIONAL([BBF_TR104],[test "x$enable_tr104" = "xyes"]) - -AC_ARG_ENABLE(tr143, [AS_HELP_STRING([--enable-tr143], [enable tr143 diagnostics feature])], AC_DEFINE(BBF_TR143),) -AM_CONDITIONAL([BBF_TR143],[test "x$enable_tr143" = "xyes"]) - -AC_ARG_ENABLE(libopenssl, [AS_HELP_STRING([--enable-libopenssl], [enable libopenssl feature])], AC_DEFINE(LOPENSSL),) -AM_CONDITIONAL([LOPENSSL],[test "x$enable_libopenssl" = "xyes"]) - -AC_ARG_ENABLE(libwolfssl, [AS_HELP_STRING([--enable-libwolfssl], [enable libwolfssl feature])], AC_DEFINE(LWOLFSSL),) -AM_CONDITIONAL([LWOLFSSL],[test "x$enable_libwolfssl" = "xyes"]) - -AC_ARG_ENABLE(libmbedtls, [AS_HELP_STRING([--enable-libmbedtls], [enable libmbedtls feature])], AC_DEFINE(LMBEDTLS),) -AM_CONDITIONAL([LMBEDTLS],[test "x$enable_libmbedtls" = "xyes"]) - -AC_ARG_ENABLE(vendor_extension, [AS_HELP_STRING([--enable-vendor-extension], [enable vendor extension])], AC_DEFINE(BBF_VENDOR_EXTENSION),) -AM_CONDITIONAL([BBF_VENDOR_EXTENSION],[test "x$enable_vendor_extension" = "xyes"]) - -AC_ARG_ENABLE(json_plugin, [AS_HELP_STRING([--enable-json-plugin], [enable json plugin to extend datamodel])], AC_DEFINE(BBFDM_ENABLE_JSON_PLUGIN),) -AM_CONDITIONAL([BBFDM_ENABLE_JSON_PLUGIN],[test "x$enable_json_plugin" = "xyes"]) - -AC_ARG_ENABLE(shared_library, [AS_HELP_STRING([--enable-shared-library], [enable shared library support to extend datamodel])], AC_DEFINE(BBFDM_ENABLE_DOTSO_PLUGIN),) -AM_CONDITIONAL([BBFDM_ENABLE_DOTSO_PLUGIN],[test "x$enable_shared_library" = "xyes"]) - -AC_DEFINE_UNQUOTED(BBF_VENDOR_LIST, "$BBF_VENDOR_LIST") -AC_DEFINE_UNQUOTED(BBF_VENDOR_PREFIX, "$BBF_VENDOR_PREFIX") - -case $BBF_VENDOR_LIST in - *openwrt*) vendor_openwrt=yes ;;& - *iopsys*) vendor_iopsys=yes ;;& - *test*) vendor_test=yes ;;& - *) ;; -esac - -AM_CONDITIONAL([BBF_VENDOR_IOPSYS],[test "x$vendor_iopsys" = "xyes"]) -AM_COND_IF([BBF_VENDOR_IOPSYS], [AC_DEFINE(BBF_VENDOR_IOPSYS)],) - -AM_CONDITIONAL([BBF_VENDOR_OPENWRT],[test "x$vendor_openwrt" = "xyes"]) -AM_COND_IF([BBF_VENDOR_OPENWRT], [AC_DEFINE(BBF_VENDOR_OPENWRT)],) - -AM_CONDITIONAL([BBF_VENDOR_TEST],[test "x$vendor_test" = "xyes"]) -AM_COND_IF([BBF_VENDOR_TEST], [AC_DEFINE(BBF_VENDOR_TEST)],) - -# checks for programs -AC_PROG_CC -AM_PROG_CC_C_O -LT_INIT -AC_ENABLE_SHARED - -LIBJSON_LIBS='-ljson-c' -AC_SUBST([LIBJSON_LIBS]) - -AC_ARG_WITH([uci-include-path], - [AS_HELP_STRING([--with-uci-include-path], - [location of the uci library headers])], - [LIBUCI_CFLAGS="-I$withval"]) -AC_SUBST([LIBUCI_CFLAGS]) - -AC_ARG_WITH([uci-lib-path], - [AS_HELP_STRING([--with-uci-lib-path], [location of the uci library])], [LIBUCI_LDFLAGS="-L$withval"]) -AC_SUBST([LIBUCI_LDFLAGS]) - -LIBUCI_LIBS='-luci' -AC_SUBST([LIBUCI_LIBS]) - -LIBTRACE_LIBS='-ltrace' -AC_SUBST([LIBTRACE_LIBS]) - -AC_ARG_WITH([libubox-include-path], - [AS_HELP_STRING([--with-libubox-include-path], - [location of the libubox library headers])], - [LIBUBOX_CFLAGS="-I$withval"]) -AC_SUBST([LIBUBOX_CFLAGS]) - -AC_ARG_WITH([libubox-lib-path], - [AS_HELP_STRING([--with-libubox-lib-path], [location of the libubox library])], [LIBUBOX_LDFLAGS="-L$withval"]) -AC_SUBST([LIBUBOX_LDFLAGS]) - -LIBUBOX_LIBS='-lubox' -AC_SUBST([LIBUBOX_LIBS]) - -AC_ARG_WITH([libubus-include-path], - [AS_HELP_STRING([--with-libubus-include-path], - [location of the libubus library headers])], - [LIBUBUS_CFLAGS="-I$withval"]) -AC_SUBST([LIBUBUS_CFLAGS]) - -AC_ARG_WITH([libubus-lib-path], - [AS_HELP_STRING([--with-libubus-lib-path], [location of the libubus library])], [LIBUBOX_LDFLAGS="-L$withval"]) -AC_SUBST([LIBUBUS_LDFLAGS]) - -LIBUBUS_LIBS='-lubus' -AC_SUBST([LIBUBUS_LIBS]) - -LBLOBMSG_LIBS='-lblobmsg_json' -AC_SUBST([LBLOBMSG_LIBS]) - -LIBDLOPEN_LIBS='-ldl' -AC_SUBST([LIBDLOPEN_LIBS]) - -LIBCURL_LIBS='-lcurl' -AC_SUBST([LIBCURL_LIBS]) - -AM_COND_IF([LWOLFSSL], [ - LIBSSL_LIBS='-lwolfssl' - AC_SUBST([LIBSSL_LIBS]) - AC_SUBST([LIBCRYPTO_LIBS]) -]) - -AM_COND_IF([LOPENSSL], [ - LIBSSL_LIBS='-lssl' - AC_SUBST([LIBSSL_LIBS]) - LIBCRYPTO_LIBS='-lcrypto' - AC_SUBST([LIBCRYPTO_LIBS]) -]) - -AM_COND_IF([LMBEDTLS], [ - LIBSSL_LIBS='-lmbedtls' - AC_SUBST([LIBSSL_LIBS]) - LIBCRYPTO_LIBS='-lmbedcrypto' - AC_SUBST([LIBCRYPTO_LIBS]) -]) - -# checks for header files -AC_CHECK_HEADERS([stdlib.h string.h]) - -# checks for typedefs, structures, and compiler characteristics -AC_TYPE_UINT8_T - -# Makefiles -AC_CONFIG_FILES([ -Makefile -bin/Makefile -]) - -AC_OUTPUT diff --git a/dmbbfcommon.h b/dmbbfcommon.h index d436b5a7..942db49e 100644 --- a/dmbbfcommon.h +++ b/dmbbfcommon.h @@ -12,7 +12,7 @@ #ifndef __DMBBFCOMMON_H__ #define __DMBBFCOMMON_H__ -#include +#include "libbbf_api/dmcommon.h" #include "dmentry.h" void bbf_uci_commit_bbfdm(void); diff --git a/dmdiagnostics.h b/dmdiagnostics.h index 7f4451f7..ad2df66b 100644 --- a/dmdiagnostics.h +++ b/dmdiagnostics.h @@ -12,7 +12,7 @@ #ifndef __DMDIAGNOSTICS_H__ #define __DMDIAGNOSTICS_H__ -#include +#include "libbbf_api/dmcommon.h" #include #define HTTP_URI "http" diff --git a/dmdynamicjson.h b/dmdynamicjson.h index 74149890..68080315 100644 --- a/dmdynamicjson.h +++ b/dmdynamicjson.h @@ -12,7 +12,7 @@ #ifndef __DMENTRYJSON_H__ #define __DMENTRYJSON_H__ -#include +#include "libbbf_api/dmcommon.h" #define JSON_FOLDER_PATH "/etc/bbfdm/json" diff --git a/dmdynamiclibrary.h b/dmdynamiclibrary.h index dd978dfc..49a71647 100644 --- a/dmdynamiclibrary.h +++ b/dmdynamiclibrary.h @@ -12,7 +12,7 @@ #ifndef __DMENTRYLIBRARY_H__ #define __DMENTRYLIBRARY_H__ -#include +#include "libbbf_api/dmcommon.h" #define LIBRARY_FOLDER_PATH "/usr/lib/bbfdm" diff --git a/dmdynamicvendor.h b/dmdynamicvendor.h index 3e647008..abc452d8 100644 --- a/dmdynamicvendor.h +++ b/dmdynamicvendor.h @@ -12,7 +12,7 @@ #ifndef __DMENTRYVENDOR_H__ #define __DMENTRYVENDOR_H__ -#include +#include "libbbf_api/dmcommon.h" void load_vendor_dynamic_arrays(struct dmctx *ctx); void free_vendor_dynamic_arrays(DMOBJ *dm_entryobj); diff --git a/dmentry.h b/dmentry.h index d5fd46ac..a88854e0 100644 --- a/dmentry.h +++ b/dmentry.h @@ -15,7 +15,7 @@ #ifndef __DMENTRY_H__ #define __DMENTRY_H__ -#include +#include "libbbf_api/dmcommon.h" extern struct list_head head_package_change; extern struct list_head main_memhead; diff --git a/dmtree/tr104/common.h b/dmtree/tr104/common.h index c03d7f44..e49de780 100644 --- a/dmtree/tr104/common.h +++ b/dmtree/tr104/common.h @@ -8,7 +8,7 @@ * Author: Yalu Zhang, yalu.zhang@iopsys.eu */ -#include +#include "libbbf_api/dmcommon.h" #define TR104_UCI_PACKAGE "asterisk" #define DEFAULT_SIP_PORT_STR "5060" diff --git a/dmtree/tr104/servicesvoiceservice.h b/dmtree/tr104/servicesvoiceservice.h index c67aeb42..4a1cd8c8 100644 --- a/dmtree/tr104/servicesvoiceservice.h +++ b/dmtree/tr104/servicesvoiceservice.h @@ -11,7 +11,7 @@ #ifndef __SERVICESVOICESERVICE_H #define __SERVICESVOICESERVICE_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tServicesObj[]; extern DMOBJ tServicesVoiceServiceObj[]; diff --git a/dmtree/tr104/servicesvoiceservicecallcontrol.h b/dmtree/tr104/servicesvoiceservicecallcontrol.h index 843d5641..15e37537 100644 --- a/dmtree/tr104/servicesvoiceservicecallcontrol.h +++ b/dmtree/tr104/servicesvoiceservicecallcontrol.h @@ -11,7 +11,7 @@ #ifndef __SERVICESVOICESERVICECALLCONTROL_H #define __SERVICESVOICESERVICECALLCONTROL_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tServicesVoiceServiceCallControlObj[]; extern DMLEAF tServicesVoiceServiceCallControlLineParams[]; diff --git a/dmtree/tr104/servicesvoiceservicecalllog.h b/dmtree/tr104/servicesvoiceservicecalllog.h index e3e720d1..15f86392 100644 --- a/dmtree/tr104/servicesvoiceservicecalllog.h +++ b/dmtree/tr104/servicesvoiceservicecalllog.h @@ -11,7 +11,7 @@ #ifndef __SERVICESVOICESERVICECALLLOG_H #define __SERVICESVOICESERVICECALLLOG_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tServicesVoiceServiceCallLogObj[]; extern DMLEAF tServicesVoiceServiceCallLogParams[]; diff --git a/dmtree/tr104/servicesvoiceservicecapabilities.h b/dmtree/tr104/servicesvoiceservicecapabilities.h index 0e89a599..250de108 100644 --- a/dmtree/tr104/servicesvoiceservicecapabilities.h +++ b/dmtree/tr104/servicesvoiceservicecapabilities.h @@ -11,7 +11,7 @@ #ifndef __SERVICESVOICESERVICECAPABILITIES_H #define __SERVICESVOICESERVICECAPABILITIES_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tServicesVoiceServiceCapabilitiesObj[]; extern DMLEAF tServicesVoiceServiceCapabilitiesParams[]; diff --git a/dmtree/tr104/servicesvoiceservicecodecprofile.h b/dmtree/tr104/servicesvoiceservicecodecprofile.h index b2dc6ce5..5db3b662 100644 --- a/dmtree/tr104/servicesvoiceservicecodecprofile.h +++ b/dmtree/tr104/servicesvoiceservicecodecprofile.h @@ -11,7 +11,7 @@ #ifndef __SERVICESVOICESERVICECODECPROFILE_H #define __SERVICESVOICESERVICECODECPROFILE_H -#include +#include "libbbf_api/dmcommon.h" extern DMLEAF tServicesVoiceServiceCodecProfileParams[]; diff --git a/dmtree/tr104/servicesvoiceservicedect.h b/dmtree/tr104/servicesvoiceservicedect.h index 48191d3f..fe3cfe06 100644 --- a/dmtree/tr104/servicesvoiceservicedect.h +++ b/dmtree/tr104/servicesvoiceservicedect.h @@ -11,7 +11,7 @@ #ifndef __SERVICESVOICESERVICEDECT_H #define __SERVICESVOICESERVICEDECT_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tServicesVoiceServiceDECTObj[]; extern DMLEAF tServicesVoiceServiceDECTParams[]; diff --git a/dmtree/tr104/servicesvoiceservicepots.h b/dmtree/tr104/servicesvoiceservicepots.h index e9f4f48f..4fc76111 100644 --- a/dmtree/tr104/servicesvoiceservicepots.h +++ b/dmtree/tr104/servicesvoiceservicepots.h @@ -11,7 +11,7 @@ #ifndef __SERVICESVOICESERVICEPOTS_H #define __SERVICESVOICESERVICEPOTS_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tServicesVoiceServicePOTSObj[]; extern DMLEAF tServicesVoiceServicePOTSParams[]; diff --git a/dmtree/tr104/servicesvoiceservicereservedports.h b/dmtree/tr104/servicesvoiceservicereservedports.h index d1879f06..4cb1ee26 100644 --- a/dmtree/tr104/servicesvoiceservicereservedports.h +++ b/dmtree/tr104/servicesvoiceservicereservedports.h @@ -11,7 +11,7 @@ #ifndef __SERVICESVOICESERVICERESERVEDPORTS_H #define __SERVICESVOICESERVICERESERVEDPORTS_H -#include +#include "libbbf_api/dmcommon.h" extern DMLEAF tServicesVoiceServiceReservedPortsParams[]; diff --git a/dmtree/tr104/servicesvoiceservicesip.h b/dmtree/tr104/servicesvoiceservicesip.h index 32f1c24f..62c72c81 100644 --- a/dmtree/tr104/servicesvoiceservicesip.h +++ b/dmtree/tr104/servicesvoiceservicesip.h @@ -11,7 +11,7 @@ #ifndef __SERVICESVOICESERVICESIP_H #define __SERVICESVOICESERVICESIP_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tServicesVoiceServiceSIPObj[]; extern DMOBJ tServicesVoiceServiceSIPClientObj[]; diff --git a/dmtree/tr104/servicesvoiceservicevoipprofile.h b/dmtree/tr104/servicesvoiceservicevoipprofile.h index 261a984f..892115f5 100644 --- a/dmtree/tr104/servicesvoiceservicevoipprofile.h +++ b/dmtree/tr104/servicesvoiceservicevoipprofile.h @@ -11,7 +11,7 @@ #ifndef __SERVICESVOICESERVICEVOIPPROFILE_H #define __SERVICESVOICESERVICEVOIPPROFILE_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tServicesVoiceServiceVoIPProfileObj[]; extern DMLEAF tServicesVoiceServiceVoIPProfileParams[]; diff --git a/dmtree/tr143/diagnostics.h b/dmtree/tr143/diagnostics.h index 8d5d4de9..c8a7ce54 100644 --- a/dmtree/tr143/diagnostics.h +++ b/dmtree/tr143/diagnostics.h @@ -12,7 +12,7 @@ #ifndef __DIAGNOSTICS_H #define __DIAGNOSTICS_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tIPDiagnosticsObj[]; extern DMLEAF tIPDiagnosticsParams[]; diff --git a/dmtree/tr181/atm.h b/dmtree/tr181/atm.h index 7cc5ba07..ed5e05a4 100644 --- a/dmtree/tr181/atm.h +++ b/dmtree/tr181/atm.h @@ -12,7 +12,7 @@ #ifndef __ATM_H #define __ATM_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tATMObj[]; extern DMOBJ tATMLinkObj[]; diff --git a/dmtree/tr181/bridging.h b/dmtree/tr181/bridging.h index b3bb885a..7e6e7d0c 100644 --- a/dmtree/tr181/bridging.h +++ b/dmtree/tr181/bridging.h @@ -13,7 +13,7 @@ #ifndef __BRIDGING_H #define __BRIDGING_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tBridgingObj[]; extern DMLEAF tBridgingParams[]; diff --git a/dmtree/tr181/device.h b/dmtree/tr181/device.h index 58f97b3a..8a5f3afe 100644 --- a/dmtree/tr181/device.h +++ b/dmtree/tr181/device.h @@ -13,7 +13,7 @@ #ifndef __DEVICE_H #define __DEVICE_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tEntry181Obj[]; extern DMOBJ tDeviceObj[]; diff --git a/dmtree/tr181/deviceinfo.h b/dmtree/tr181/deviceinfo.h index 2d35ec92..8adb7a9a 100644 --- a/dmtree/tr181/deviceinfo.h +++ b/dmtree/tr181/deviceinfo.h @@ -13,7 +13,7 @@ #ifndef __DEVICE_INFO_H #define __DEVICE_INFO_H -#include +#include "libbbf_api/dmcommon.h" extern DMLEAF tDeviceInfoParams[]; extern DMLEAF tDeviceInfoVendorConfigFileParams[]; diff --git a/dmtree/tr181/dhcpv4.h b/dmtree/tr181/dhcpv4.h index d1cc2263..1b395cc8 100644 --- a/dmtree/tr181/dhcpv4.h +++ b/dmtree/tr181/dhcpv4.h @@ -12,7 +12,7 @@ #ifndef __DHCP_H #define __DHCP_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tDHCPv4Obj[]; extern DMOBJ tDHCPv4ServerObj[]; diff --git a/dmtree/tr181/dhcpv6.h b/dmtree/tr181/dhcpv6.h index e90a94e9..53bbd285 100644 --- a/dmtree/tr181/dhcpv6.h +++ b/dmtree/tr181/dhcpv6.h @@ -11,7 +11,7 @@ #ifndef __DHCPV6_H #define __DHCPV6_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tDHCPv6Obj[]; extern DMLEAF tDHCPv6Params[]; diff --git a/dmtree/tr181/dns.h b/dmtree/tr181/dns.h index 254d4ea6..4c7df32b 100644 --- a/dmtree/tr181/dns.h +++ b/dmtree/tr181/dns.h @@ -11,7 +11,7 @@ #ifndef _DNS_H #define _DNS_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tDNSObj[]; extern DMLEAF tDNSParams[]; diff --git a/dmtree/tr181/dsl.h b/dmtree/tr181/dsl.h index 9a161383..1d027acd 100644 --- a/dmtree/tr181/dsl.h +++ b/dmtree/tr181/dsl.h @@ -11,7 +11,7 @@ #ifndef __DSL_H #define __DSL_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tDSLObj[]; extern DMLEAF tDSLParams[]; diff --git a/dmtree/tr181/dynamicdns.h b/dmtree/tr181/dynamicdns.h index f568be1f..09569d00 100644 --- a/dmtree/tr181/dynamicdns.h +++ b/dmtree/tr181/dynamicdns.h @@ -11,7 +11,7 @@ #ifndef __DYNAMICDNS_H #define __DYNAMICDNS_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tDynamicDNSObj[]; extern DMLEAF tDynamicDNSParams[]; diff --git a/dmtree/tr181/ethernet.h b/dmtree/tr181/ethernet.h index 21f65c48..bf3ce1d5 100644 --- a/dmtree/tr181/ethernet.h +++ b/dmtree/tr181/ethernet.h @@ -13,7 +13,7 @@ #ifndef __ETHERNET_H #define __ETHERNET_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tEthernetObj[]; extern DMLEAF tEthernetParams[]; diff --git a/dmtree/tr181/fast.h b/dmtree/tr181/fast.h index be6c0ed1..a4e998fe 100644 --- a/dmtree/tr181/fast.h +++ b/dmtree/tr181/fast.h @@ -11,7 +11,7 @@ #ifndef __FAST_H #define __FAST_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tFASTObj[]; extern DMLEAF tFASTParams[]; diff --git a/dmtree/tr181/firewall.h b/dmtree/tr181/firewall.h index c82cb539..80d47aca 100644 --- a/dmtree/tr181/firewall.h +++ b/dmtree/tr181/firewall.h @@ -11,7 +11,7 @@ #ifndef _FIREWALL_H #define _FIREWALL_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tFirewallObj[]; extern DMLEAF tFirewallParams[]; diff --git a/dmtree/tr181/gre.h b/dmtree/tr181/gre.h index 991867ee..ac8b21ea 100644 --- a/dmtree/tr181/gre.h +++ b/dmtree/tr181/gre.h @@ -11,7 +11,7 @@ #ifndef __GRE_H #define __GRE_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tGREObj[]; extern DMLEAF tGREParams[]; diff --git a/dmtree/tr181/hosts.h b/dmtree/tr181/hosts.h index ec5adb41..a029654b 100644 --- a/dmtree/tr181/hosts.h +++ b/dmtree/tr181/hosts.h @@ -11,7 +11,7 @@ #ifndef __HOSTS_H #define __HOSTS_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tHostsObj[]; extern DMLEAF tHostsParams[]; diff --git a/dmtree/tr181/ieee1905.h b/dmtree/tr181/ieee1905.h index e58a2911..6522bdd6 100644 --- a/dmtree/tr181/ieee1905.h +++ b/dmtree/tr181/ieee1905.h @@ -11,7 +11,7 @@ #ifndef __IEEE1905_H #define __IEEE1905_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tIEEE1905Obj[]; extern DMLEAF tIEEE1905Params[]; diff --git a/dmtree/tr181/interfacestack.h b/dmtree/tr181/interfacestack.h index ea26e428..3b4338e9 100644 --- a/dmtree/tr181/interfacestack.h +++ b/dmtree/tr181/interfacestack.h @@ -11,7 +11,7 @@ #ifndef __INTERFACESTACK_H #define __INTERFACESTACK_H -#include +#include "libbbf_api/dmcommon.h" extern DMLEAF tInterfaceStackParams[]; diff --git a/dmtree/tr181/ip.h b/dmtree/tr181/ip.h index 66b29a87..961e813e 100644 --- a/dmtree/tr181/ip.h +++ b/dmtree/tr181/ip.h @@ -13,7 +13,7 @@ #ifndef __IP_H #define __IP_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tIPObj[]; extern DMLEAF tIPParams[]; diff --git a/dmtree/tr181/lanconfigsecurity.h b/dmtree/tr181/lanconfigsecurity.h index 443dec14..b37b49d1 100644 --- a/dmtree/tr181/lanconfigsecurity.h +++ b/dmtree/tr181/lanconfigsecurity.h @@ -11,7 +11,7 @@ #ifndef __LANCONFIGSECURITY_H #define __LANCONFIGSECURITY_H -#include +#include "libbbf_api/dmcommon.h" extern DMLEAF tLANConfigSecurityParams[]; diff --git a/dmtree/tr181/managementserver.h b/dmtree/tr181/managementserver.h index f9df6822..4dc9c6fe 100644 --- a/dmtree/tr181/managementserver.h +++ b/dmtree/tr181/managementserver.h @@ -12,7 +12,7 @@ #ifndef __MANAGEMENT_SERVER_H #define __MANAGEMENT_SERVER_H -#include +#include "libbbf_api/dmcommon.h" extern DMLEAF tManagementServerParams[]; extern DMLEAF tHeartbeatPolicyParams[]; diff --git a/dmtree/tr181/nat.h b/dmtree/tr181/nat.h index 20bb4ba6..86a70bf5 100644 --- a/dmtree/tr181/nat.h +++ b/dmtree/tr181/nat.h @@ -13,7 +13,7 @@ #ifndef __NAT_H #define __NAT_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tNATObj[]; extern DMLEAF tNATParams[]; diff --git a/dmtree/tr181/ppp.h b/dmtree/tr181/ppp.h index 2ddc793a..c820ed4d 100644 --- a/dmtree/tr181/ppp.h +++ b/dmtree/tr181/ppp.h @@ -12,7 +12,7 @@ #ifndef __PPP_H #define __PPP_H -#include +#include "libbbf_api/dmcommon.h" #define IPCP 0 #define IPCPv6 1 diff --git a/dmtree/tr181/ptm.h b/dmtree/tr181/ptm.h index eb683ddf..91467f8a 100644 --- a/dmtree/tr181/ptm.h +++ b/dmtree/tr181/ptm.h @@ -12,7 +12,7 @@ #ifndef __PTM_H #define __PTM_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tPTMObj[]; extern DMOBJ tPTMLinkObj[]; diff --git a/dmtree/tr181/qos.h b/dmtree/tr181/qos.h index df1e65a8..79b55273 100644 --- a/dmtree/tr181/qos.h +++ b/dmtree/tr181/qos.h @@ -11,7 +11,7 @@ #ifndef __QOS_H #define __QOS_H -#include +#include "libbbf_api/dmcommon.h" #include "dmentry.h" extern DMOBJ tQoSObj[]; diff --git a/dmtree/tr181/routeradvertisement.h b/dmtree/tr181/routeradvertisement.h index 2fe2d677..e095b419 100644 --- a/dmtree/tr181/routeradvertisement.h +++ b/dmtree/tr181/routeradvertisement.h @@ -11,7 +11,7 @@ #ifndef __ROUTERADVERTISEMENT_H #define __ROUTERADVERTISEMENT_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tRouterAdvertisementObj[]; extern DMLEAF tRouterAdvertisementParams[]; diff --git a/dmtree/tr181/routing.h b/dmtree/tr181/routing.h index 366fca55..d515f6af 100644 --- a/dmtree/tr181/routing.h +++ b/dmtree/tr181/routing.h @@ -13,7 +13,7 @@ #ifndef __ROUTING_H #define __ROUTING_H -#include +#include "libbbf_api/dmcommon.h" extern struct dm_permession_s DMRouting; diff --git a/dmtree/tr181/security.h b/dmtree/tr181/security.h index ed19494f..8daedd34 100644 --- a/dmtree/tr181/security.h +++ b/dmtree/tr181/security.h @@ -12,7 +12,7 @@ #define __SECURITY_H #if defined(LOPENSSL) || defined(LWOLFSSL) || defined(LMBEDTLS) -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tSecurityObj[]; extern DMLEAF tSecurityParams[]; diff --git a/dmtree/tr181/times.h b/dmtree/tr181/times.h index 3d05d56a..d84fa3c6 100644 --- a/dmtree/tr181/times.h +++ b/dmtree/tr181/times.h @@ -12,7 +12,7 @@ #ifndef __TIMES_H #define __TIMES_H -#include +#include "libbbf_api/dmcommon.h" extern DMLEAF tTimeParams[]; diff --git a/dmtree/tr181/upnp.h b/dmtree/tr181/upnp.h index 6edb5f76..ce8626cd 100644 --- a/dmtree/tr181/upnp.h +++ b/dmtree/tr181/upnp.h @@ -12,7 +12,7 @@ #ifndef __UPNP_H #define __UPNP_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tUPnPObj[]; extern DMLEAF tUPnPDeviceParams[]; diff --git a/dmtree/tr181/usb.h b/dmtree/tr181/usb.h index e2d70eaa..8f005604 100644 --- a/dmtree/tr181/usb.h +++ b/dmtree/tr181/usb.h @@ -11,7 +11,7 @@ #ifndef __USB_H #define __USB_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tUSBObj[]; extern DMLEAF tUSBParams[]; diff --git a/dmtree/tr181/users.h b/dmtree/tr181/users.h index 0f01d6e1..50e29c11 100644 --- a/dmtree/tr181/users.h +++ b/dmtree/tr181/users.h @@ -11,7 +11,7 @@ #ifndef _USERS_H #define _USERS_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tUsersObj[]; extern DMLEAF tUsersParams[]; diff --git a/dmtree/tr181/wifi.h b/dmtree/tr181/wifi.h index fd761158..2afca990 100644 --- a/dmtree/tr181/wifi.h +++ b/dmtree/tr181/wifi.h @@ -13,7 +13,7 @@ #ifndef __WIFI_H #define __WIFI_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tWiFiObj[]; extern DMLEAF tWiFiParams[]; diff --git a/dmtree/vendor/iopsys/tr104/servicesvoiceservicecallcontrol.h b/dmtree/vendor/iopsys/tr104/servicesvoiceservicecallcontrol.h index ba887f6a..66e53032 100644 --- a/dmtree/vendor/iopsys/tr104/servicesvoiceservicecallcontrol.h +++ b/dmtree/vendor/iopsys/tr104/servicesvoiceservicecallcontrol.h @@ -11,7 +11,7 @@ #ifndef __IOPSYS_VOICESERVICECALLCONTROL_H #define __IOPSYS_VOICESERVICECALLCONTROL_H -#include +#include "libbbf_api/dmcommon.h" extern DMLEAF tIOPSYS_VoiceServiceCallControlExtensionParams[]; diff --git a/dmtree/vendor/iopsys/tr104/servicesvoiceservicecalllog.h b/dmtree/vendor/iopsys/tr104/servicesvoiceservicecalllog.h index 0db9c635..0c1466ae 100644 --- a/dmtree/vendor/iopsys/tr104/servicesvoiceservicecalllog.h +++ b/dmtree/vendor/iopsys/tr104/servicesvoiceservicecalllog.h @@ -12,7 +12,7 @@ #ifndef __IOPSYS_VOICESERVICECALLLOG_H #define __IOPSYS_VOICESERVICECALLLOG_H -#include +#include "libbbf_api/dmcommon.h" extern DMLEAF tIOPSYS_VoiceServiceCallLogParams[]; extern DMLEAF tIOPSYS_VoiceServiceCallLogSessionSourceRTPParams[]; diff --git a/dmtree/vendor/iopsys/tr104/servicesvoiceservicedect.h b/dmtree/vendor/iopsys/tr104/servicesvoiceservicedect.h index badf66be..4c074ba6 100644 --- a/dmtree/vendor/iopsys/tr104/servicesvoiceservicedect.h +++ b/dmtree/vendor/iopsys/tr104/servicesvoiceservicedect.h @@ -11,7 +11,7 @@ #ifndef __SERVICESVOICESERVICEDECT_H #define __SERVICESVOICESERVICEDECT_H -#include +#include "libbbf_api/dmcommon.h" extern DMLEAF tIOPSYS_VoiceServiceDECTPortableParams[]; diff --git a/dmtree/vendor/iopsys/tr181/bridging.h b/dmtree/vendor/iopsys/tr181/bridging.h index 505aeb54..cba27bf9 100644 --- a/dmtree/vendor/iopsys/tr181/bridging.h +++ b/dmtree/vendor/iopsys/tr181/bridging.h @@ -12,7 +12,7 @@ #ifndef __IOPSYS_BRIDGING_H #define __IOPSYS_BRIDGING_H -#include +#include "libbbf_api/dmcommon.h" extern DMLEAF tIOPSYS_BridgingBridgePortParams[]; extern DMLEAF tIOPSYS_BridgingBridgeVLANParams[]; diff --git a/dmtree/vendor/iopsys/tr181/device.h b/dmtree/vendor/iopsys/tr181/device.h index 14a3a8b7..2f965487 100644 --- a/dmtree/vendor/iopsys/tr181/device.h +++ b/dmtree/vendor/iopsys/tr181/device.h @@ -12,7 +12,7 @@ #ifndef __IOPSYS_DEVICE_H #define __IOPSYS_DEVICE_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tIOPSYS_DeviceObj[]; diff --git a/dmtree/vendor/iopsys/tr181/deviceinfo.h b/dmtree/vendor/iopsys/tr181/deviceinfo.h index dd77480f..3cb8a63c 100644 --- a/dmtree/vendor/iopsys/tr181/deviceinfo.h +++ b/dmtree/vendor/iopsys/tr181/deviceinfo.h @@ -12,7 +12,7 @@ #ifndef __IOPSYS_DEVICEINFO_H #define __IOPSYS_DEVICEINFO_H -#include +#include "libbbf_api/dmcommon.h" extern DMLEAF tIOPSYS_DeviceInfoParams[]; diff --git a/dmtree/vendor/iopsys/tr181/ethernet.h b/dmtree/vendor/iopsys/tr181/ethernet.h index 45572139..ff3f1c68 100644 --- a/dmtree/vendor/iopsys/tr181/ethernet.h +++ b/dmtree/vendor/iopsys/tr181/ethernet.h @@ -12,7 +12,7 @@ #ifndef __IOPSYS_ETHERNET_H #define __IOPSYS_ETHERNET_H -#include +#include "libbbf_api/dmcommon.h" extern DMLEAF tIOPSYS_EthernetVLANTerminationParams[]; diff --git a/dmtree/vendor/iopsys/tr181/times.h b/dmtree/vendor/iopsys/tr181/times.h index 10b471d7..ca65598c 100644 --- a/dmtree/vendor/iopsys/tr181/times.h +++ b/dmtree/vendor/iopsys/tr181/times.h @@ -12,7 +12,7 @@ #ifndef __IOPSYS_TIMES_H #define __IOPSYS_TIMES_H -#include +#include "libbbf_api/dmcommon.h" extern DMLEAF tIOPSYS_TimeParams[]; diff --git a/dmtree/vendor/iopsys/tr181/vendor.h b/dmtree/vendor/iopsys/tr181/vendor.h index bbfde365..219c5bf3 100644 --- a/dmtree/vendor/iopsys/tr181/vendor.h +++ b/dmtree/vendor/iopsys/tr181/vendor.h @@ -12,7 +12,7 @@ #ifndef __IOPSYS_VENDOR_H #define __IOPSYS_VENDOR_H -#include +#include "libbbf_api/dmcommon.h" extern DM_MAP_OBJ tVendorExtensionIOPSYS[]; diff --git a/dmtree/vendor/iopsys/tr181/x_iopsys_eu_igmp.h b/dmtree/vendor/iopsys/tr181/x_iopsys_eu_igmp.h index 39421779..66ca90ff 100644 --- a/dmtree/vendor/iopsys/tr181/x_iopsys_eu_igmp.h +++ b/dmtree/vendor/iopsys/tr181/x_iopsys_eu_igmp.h @@ -12,7 +12,7 @@ #ifndef __IOPSYS_IGMP_H #define __IOPSYS_IGMP_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ X_IOPSYS_EU_IGMPObj[]; extern DMLEAF X_IOPSYS_EU_IGMPParams[]; diff --git a/dmtree/vendor/iopsys/tr181/x_iopsys_eu_mld.h b/dmtree/vendor/iopsys/tr181/x_iopsys_eu_mld.h index 110b12f0..24c442b5 100644 --- a/dmtree/vendor/iopsys/tr181/x_iopsys_eu_mld.h +++ b/dmtree/vendor/iopsys/tr181/x_iopsys_eu_mld.h @@ -12,7 +12,7 @@ #ifndef __IOPSYS_MLD_H #define __IOPSYS_MLD_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ X_IOPSYS_EU_MLDObj[]; extern DMLEAF X_IOPSYS_EU_MLDParams[]; diff --git a/dmtree/vendor/openwrt/tr181/deviceinfo.h b/dmtree/vendor/openwrt/tr181/deviceinfo.h index ea90b408..d3525e69 100644 --- a/dmtree/vendor/openwrt/tr181/deviceinfo.h +++ b/dmtree/vendor/openwrt/tr181/deviceinfo.h @@ -1,7 +1,7 @@ #ifndef __OPENWRT_DEVICEINFO_H #define __OPENWRT_DEVICEINFO_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tOPENWRT_DeviceInfoObj[]; extern DMLEAF tOPENWRT_DeviceInfoParams[]; diff --git a/dmtree/vendor/openwrt/tr181/qos.h b/dmtree/vendor/openwrt/tr181/qos.h index 56346726..4731dc07 100644 --- a/dmtree/vendor/openwrt/tr181/qos.h +++ b/dmtree/vendor/openwrt/tr181/qos.h @@ -12,7 +12,7 @@ #ifndef __OPENWRT_QOS_H #define __OPENWRT_QOS_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tOPENWRT_QoSObj[]; extern DMLEAF tOPENWRT_QoSParams[]; diff --git a/dmtree/vendor/openwrt/tr181/vendor.h b/dmtree/vendor/openwrt/tr181/vendor.h index 7641a59e..9143985a 100644 --- a/dmtree/vendor/openwrt/tr181/vendor.h +++ b/dmtree/vendor/openwrt/tr181/vendor.h @@ -12,7 +12,7 @@ #ifndef __OPENWRT_VENDOR_H #define __OPENWRT_VENDOR_H -#include +#include "libbbf_api/dmcommon.h" extern DM_MAP_OBJ tVendorExtensionOverwriteOPENWRT[]; extern char *VendorExtensionExcludeOPENWRT[]; diff --git a/dmtree/vendor/test/tr181/device.h b/dmtree/vendor/test/tr181/device.h index 4ffc35c8..66e5a770 100644 --- a/dmtree/vendor/test/tr181/device.h +++ b/dmtree/vendor/test/tr181/device.h @@ -12,7 +12,7 @@ #ifndef __TEST_DEVICE_H #define __TEST_DEVICE_H -#include +#include "libbbf_api/dmcommon.h" extern DMOBJ tTEST_DeviceObj[]; diff --git a/dmtree/vendor/test/tr181/deviceinfo.h b/dmtree/vendor/test/tr181/deviceinfo.h index 33b4af4a..92684eb3 100644 --- a/dmtree/vendor/test/tr181/deviceinfo.h +++ b/dmtree/vendor/test/tr181/deviceinfo.h @@ -1,7 +1,7 @@ #ifndef __TEST_DEVICEINFO_H #define __TEST_DEVICEINFO_H -#include +#include "libbbf_api/dmcommon.h" extern DMLEAF tTEST_DeviceInfoParams[]; diff --git a/dmtree/vendor/test/tr181/firewall.h b/dmtree/vendor/test/tr181/firewall.h index 414cc6dc..6602d6ba 100644 --- a/dmtree/vendor/test/tr181/firewall.h +++ b/dmtree/vendor/test/tr181/firewall.h @@ -12,7 +12,7 @@ #ifndef __TEST_FIREWALL_H #define __TEST_FIREWALL_H -#include +#include "libbbf_api/dmcommon.h" extern DMLEAF tTEST_FirewallRuleParams[]; extern DMOBJ tTEST_FirewallChainRuleObj[]; diff --git a/dmtree/vendor/test/tr181/vendor.h b/dmtree/vendor/test/tr181/vendor.h index c2db0fbb..5e235ca4 100644 --- a/dmtree/vendor/test/tr181/vendor.h +++ b/dmtree/vendor/test/tr181/vendor.h @@ -12,7 +12,7 @@ #ifndef __TEST_VENDOR_H #define __TEST_VENDOR_H -#include +#include "libbbf_api/dmcommon.h" extern DM_MAP_OBJ tVendorExtensionOverwriteTEST[]; extern DM_MAP_OBJ tVendorExtensionTEST[]; diff --git a/dmtree/vendor/test/tr181/x_test_com_dropbear.h b/dmtree/vendor/test/tr181/x_test_com_dropbear.h index 44fdd855..1aa4f1a3 100644 --- a/dmtree/vendor/test/tr181/x_test_com_dropbear.h +++ b/dmtree/vendor/test/tr181/x_test_com_dropbear.h @@ -12,7 +12,7 @@ #ifndef __TEST_DROPBEAR_H #define __TEST_DROPBEAR_H -#include +#include "libbbf_api/dmcommon.h" extern DMLEAF X_TEST_COM_DropbearParams[]; diff --git a/dmtree/vendor/vendor.h b/dmtree/vendor/vendor.h index a13c5e0b..6db7b6ea 100644 --- a/dmtree/vendor/vendor.h +++ b/dmtree/vendor/vendor.h @@ -12,7 +12,7 @@ #ifndef __VENDOR_EXTENSION_H #define __VENDOR_EXTENSION_H -#include +#include "libbbf_api/dmcommon.h" extern DM_MAP_VENDOR tVendorExtension[]; extern DM_MAP_VENDOR tVendorExtensionOverwrite[]; diff --git a/gitlab-ci/memory-test.sh b/gitlab-ci/memory-test.sh index 08ca1282..cf970d2c 100755 --- a/gitlab-ci/memory-test.sh +++ b/gitlab-ci/memory-test.sh @@ -20,7 +20,7 @@ install_libbbf install_libbbf_test install_libbulkdata -#install_libperiodicstats +install_libperiodicstats supervisorctl status all supervisorctl update diff --git a/gitlab-ci/shared.sh b/gitlab-ci/shared.sh index a63dbc1b..1059f19f 100755 --- a/gitlab-ci/shared.sh +++ b/gitlab-ci/shared.sh @@ -66,28 +66,16 @@ function install_libbbf() echo "Compiling libbbf" if [ -f Makefile ]; then - exec_cmd make maintainer-clean - find -name '*.gcno' -exec rm {} -fv \; - find -name '*.gcov' -exec rm {} -fv \; - find -name '*.deps' -exec rm {} -rfv \; + make clean + rm -rf CMakeFiles CMakeCache.txt cmake_install.cmake rm -f *.log *.xml fi - exec_cmd autoreconf -i - exec_cmd ./configure --enable-tr181 --enable-tr104 --enable-tr143 --enable-libopenssl --enable-json-plugin --enable-shared-library --enable-vendor-extension BBF_VENDOR_LIST="$VENDOR_LIST" BBF_VENDOR_PREFIX="$VENDOR_PREFIX" - make CFLAGS="-D_GNU_SOURCE -Wall -Werror" CFLAGS+="$COV_CFLAGS" LDFLAGS="$COV_LDFLAGS" >/dev/null 2>&1 + cmake CMakeLists.txt -DCMAKE_C_FLAGS="$COV_CFLAGS " -DCMAKE_EXE_LINKER_FLAGS="$COV_LDFLAGS" -DBBF_TR181=ON -DBBF_TR104=ON -DBBF_TR143=ON -DWITH_OPENSSL=ON -DBBF_JSON_PLUGIN=ON -DBBF_DOTSO_PLUGIN=ON -DBBF_VENDOR_EXTENSION=ON -DBBF_VENDOR_LIST="$VENDOR_LIST" -DBBF_VENDOR_PREFIX="$VENDOR_PREFIX" + exec_cmd make echo "installing libbbf" exec_cmd make install - ldconfig - - echo "configuring libbbf" - mkdir -p /etc/bbfdm/ - mkdir -p /etc/bbfdm/dmmap - mkdir -p /etc/bbfdm/json - mkdir -p /usr/share/bbfdm - mkdir -p /usr/lib/bbfdm - cp -f scripts/* /usr/share/bbfdm } function install_libbbf_test() @@ -120,7 +108,7 @@ function install_libbulkdata() make CFLAGS="-D_GNU_SOURCE -DWC_NO_HARDEN" -C /opt/dev/bulkdata/ echo "installing libbulkdata" - cp -f /opt/dev/bulkdata/libbulkdata.so /usr/lib/bbfdm + cp -f /opt/dev/bulkdata/bbf_plugin/libbulkdata.so /usr/lib/bbfdm } function install_libperiodicstats() @@ -133,7 +121,7 @@ function install_libperiodicstats() make -C /opt/dev/periodicstats/ echo "installing libperiodicstats" - cp -f /opt/dev/periodicstats/libperiodicstats.so /usr/lib/bbfdm + cp -f /opt/dev/periodicstats/bbf_plugin/libperiodicstats.so /usr/lib/bbfdm } function error_on_zero() diff --git a/libbbf_ubus/Makefile.am b/libbbf_ubus/Makefile.am index c1256415..71d57e66 100644 --- a/libbbf_ubus/Makefile.am +++ b/libbbf_ubus/Makefile.am @@ -29,7 +29,7 @@ libbbf_ubus_la_LIBADD = \ $(LIBTRACE_LIBS) \ $(LBLOBMSG_LIBS) \ $(LIBCURL_LIBS) \ - -L../bin/ -lbbf_api + -L../bin/ libbbf_ubus_la_CFLAGS+=-I../ libbbf_ubus_la_CFLAGS+=-I../include