From f41ab13525a45b46324c31d1066aa73647230663 Mon Sep 17 00:00:00 2001 From: Mateo Cindric Date: Tue, 3 Jan 2023 15:01:33 +0000 Subject: [PATCH] system-plugin: switch to building the core ietf-system sysrepo plugin library --- CMakeLists.txt | 153 +++++++----------- .../api/system/authentication/change.c | 14 +- .../api/system/authentication/change.h | 2 +- .../api/system/authentication/check.c | 6 +- .../api/system/authentication/check.h | 4 +- .../api/system/authentication/load.c | 12 +- .../api/system/authentication/load.h | 4 +- .../api/system/authentication/store.c | 2 +- .../api/system/authentication/store.h | 2 +- src/{plugin => core}/api/system/change.c | 0 src/{plugin => core}/api/system/change.h | 2 +- src/{plugin => core}/api/system/check.c | 0 src/{plugin => core}/api/system/check.h | 4 +- .../api/system/dns_resolver/change.c | 14 +- .../api/system/dns_resolver/change.h | 2 +- .../api/system/dns_resolver/check.c | 8 +- .../api/system/dns_resolver/check.h | 4 +- .../api/system/dns_resolver/load.c | 10 +- .../api/system/dns_resolver/load.h | 4 +- .../api/system/dns_resolver/store.c | 2 +- .../api/system/dns_resolver/store.h | 4 +- src/{plugin => core}/api/system/load.c | 0 src/{plugin => core}/api/system/load.h | 4 +- src/{plugin => core}/api/system/ntp/change.c | 6 +- src/{plugin => core}/api/system/ntp/change.h | 4 +- src/{plugin => core}/api/system/ntp/check.c | 4 +- src/{plugin => core}/api/system/ntp/check.h | 4 +- src/{plugin => core}/api/system/ntp/load.c | 6 +- src/{plugin => core}/api/system/ntp/load.h | 4 +- src/{plugin => core}/api/system/ntp/store.c | 6 +- src/{plugin => core}/api/system/ntp/store.h | 4 +- src/{plugin => core}/api/system/store.c | 2 +- src/{plugin => core}/api/system/store.h | 2 +- src/{plugin => core}/common.c | 0 src/{plugin => core}/common.h | 0 src/{plugin => core}/context.h | 2 +- .../system/authentication/authorized_key.c | 0 .../system/authentication/authorized_key.h | 2 +- .../authentication/authorized_key/list.c | 2 +- .../authentication/authorized_key/list.h | 2 +- .../data/system/authentication/local_user.c | 2 +- .../data/system/authentication/local_user.h | 2 +- .../system/authentication/local_user/list.c | 2 +- .../system/authentication/local_user/list.h | 2 +- .../data/system/dns_resolver/search.c | 0 .../data/system/dns_resolver/search.h | 2 +- .../data/system/dns_resolver/search/list.c | 2 +- .../data/system/dns_resolver/search/list.h | 2 +- .../data/system/dns_resolver/server.c | 0 .../data/system/dns_resolver/server.h | 2 +- .../data/system/dns_resolver/server/list.c | 4 +- .../data/system/dns_resolver/server/list.h | 2 +- src/{plugin => core}/data/system/ip_address.c | 0 src/{plugin => core}/data/system/ip_address.h | 2 +- src/{plugin => core}/data/system/ntp/server.c | 0 src/{plugin => core}/data/system/ntp/server.h | 2 +- .../data/system/ntp/server/list.c | 4 +- .../data/system/ntp/server/list.h | 2 +- src/{plugin => core}/ly_tree.c | 4 +- src/{plugin => core}/ly_tree.h | 0 src/{plugin => core}/startup/load.c | 26 +-- src/{plugin => core}/startup/load.h | 2 +- src/{plugin => core}/startup/store.c | 46 +++--- src/{plugin => core}/startup/store.h | 2 +- src/{plugin => core}/subscription/change.c | 38 ++--- src/{plugin => core}/subscription/change.h | 0 .../subscription/operational.c | 4 +- .../subscription/operational.h | 0 src/{plugin => core}/subscription/rpc.c | 2 +- src/{plugin => core}/subscription/rpc.h | 0 src/{plugin => core}/types.h | 0 src/plugin.c | 14 +- tests/system_utest.c | 10 +- 73 files changed, 226 insertions(+), 261 deletions(-) rename src/{plugin => core}/api/system/authentication/change.c (98%) rename src/{plugin => core}/api/system/authentication/change.h (97%) rename src/{plugin => core}/api/system/authentication/check.c (94%) rename src/{plugin => core}/api/system/authentication/check.h (93%) rename src/{plugin => core}/api/system/authentication/load.c (94%) rename src/{plugin => core}/api/system/authentication/load.h (92%) rename src/{plugin => core}/api/system/authentication/store.c (99%) rename src/{plugin => core}/api/system/authentication/store.h (96%) rename src/{plugin => core}/api/system/change.c (100%) rename src/{plugin => core}/api/system/change.h (96%) rename src/{plugin => core}/api/system/check.c (100%) rename src/{plugin => core}/api/system/check.h (93%) rename src/{plugin => core}/api/system/dns_resolver/change.c (95%) rename src/{plugin => core}/api/system/dns_resolver/change.h (97%) rename src/{plugin => core}/api/system/dns_resolver/check.c (94%) rename src/{plugin => core}/api/system/dns_resolver/check.h (92%) rename src/{plugin => core}/api/system/dns_resolver/load.c (95%) rename src/{plugin => core}/api/system/dns_resolver/load.h (92%) rename src/{plugin => core}/api/system/dns_resolver/store.c (99%) rename src/{plugin => core}/api/system/dns_resolver/store.h (92%) rename src/{plugin => core}/api/system/load.c (100%) rename src/{plugin => core}/api/system/load.h (93%) rename src/{plugin => core}/api/system/ntp/change.c (99%) rename src/{plugin => core}/api/system/ntp/change.h (95%) rename src/{plugin => core}/api/system/ntp/check.c (95%) rename src/{plugin => core}/api/system/ntp/check.h (91%) rename src/{plugin => core}/api/system/ntp/load.c (97%) rename src/{plugin => core}/api/system/ntp/load.h (90%) rename src/{plugin => core}/api/system/ntp/store.c (98%) rename src/{plugin => core}/api/system/ntp/store.h (90%) rename src/{plugin => core}/api/system/store.c (98%) rename src/{plugin => core}/api/system/store.h (96%) rename src/{plugin => core}/common.c (100%) rename src/{plugin => core}/common.h (100%) rename src/{plugin => core}/context.h (98%) rename src/{plugin => core}/data/system/authentication/authorized_key.c (100%) rename src/{plugin => core}/data/system/authentication/authorized_key.h (97%) rename src/{plugin => core}/data/system/authentication/authorized_key/list.c (97%) rename src/{plugin => core}/data/system/authentication/authorized_key/list.h (97%) rename src/{plugin => core}/data/system/authentication/local_user.c (95%) rename src/{plugin => core}/data/system/authentication/local_user.h (96%) rename src/{plugin => core}/data/system/authentication/local_user/list.c (97%) rename src/{plugin => core}/data/system/authentication/local_user/list.h (97%) rename src/{plugin => core}/data/system/dns_resolver/search.c (100%) rename src/{plugin => core}/data/system/dns_resolver/search.h (96%) rename src/{plugin => core}/data/system/dns_resolver/search/list.c (97%) rename src/{plugin => core}/data/system/dns_resolver/search/list.h (97%) rename src/{plugin => core}/data/system/dns_resolver/server.c (100%) rename src/{plugin => core}/data/system/dns_resolver/server.h (97%) rename src/{plugin => core}/data/system/dns_resolver/server/list.c (96%) rename src/{plugin => core}/data/system/dns_resolver/server/list.h (97%) rename src/{plugin => core}/data/system/ip_address.c (100%) rename src/{plugin => core}/data/system/ip_address.h (96%) rename src/{plugin => core}/data/system/ntp/server.c (100%) rename src/{plugin => core}/data/system/ntp/server.h (97%) rename src/{plugin => core}/data/system/ntp/server/list.c (97%) rename src/{plugin => core}/data/system/ntp/server/list.h (97%) rename src/{plugin => core}/ly_tree.c (99%) rename src/{plugin => core}/ly_tree.h (100%) rename src/{plugin => core}/startup/load.c (96%) rename src/{plugin => core}/startup/load.h (94%) rename src/{plugin => core}/startup/store.c (96%) rename src/{plugin => core}/startup/store.h (94%) rename src/{plugin => core}/subscription/change.c (96%) rename src/{plugin => core}/subscription/change.h (100%) rename src/{plugin => core}/subscription/operational.c (99%) rename src/{plugin => core}/subscription/operational.h (100%) rename src/{plugin => core}/subscription/rpc.c (98%) rename src/{plugin => core}/subscription/rpc.h (100%) rename src/{plugin => core}/types.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 17d2596..daf4efa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ project(sysrepo-plugin-system C) include(CompileOptions.cmake) -set(PLUGIN_LIRBARY_NAME srplg-ietf-system) +set(PLUGIN_LIRBARY_NAME srplg-ietf-system-core) set(PLUGIN 0 CACHE BOOL "Build a plugin") option(ENABLE_BUILD_TESTS, "Build tests" OFF) @@ -35,112 +35,77 @@ include_directories( set( SOURCES - src/plugin.c - src/plugin/common.c - src/plugin/ly_tree.c + src/core/common.c + src/core/ly_tree.c # startup - src/plugin/startup/load.c - src/plugin/startup/store.c + src/core/startup/load.c + src/core/startup/store.c # subs - src/plugin/subscription/change.c - src/plugin/subscription/operational.c - src/plugin/subscription/rpc.c + src/core/subscription/change.c + src/core/subscription/operational.c + src/core/subscription/rpc.c # data - src/plugin/data/system/ip_address.c - src/plugin/data/system/dns_resolver/search.c - src/plugin/data/system/dns_resolver/search/list.c - src/plugin/data/system/dns_resolver/server.c - src/plugin/data/system/dns_resolver/server/list.c - src/plugin/data/system/ntp/server.c - src/plugin/data/system/ntp/server/list.c - src/plugin/data/system/authentication/authorized_key.c - src/plugin/data/system/authentication/authorized_key/list.c - src/plugin/data/system/authentication/local_user.c - src/plugin/data/system/authentication/local_user/list.c + src/core/data/system/ip_address.c + src/core/data/system/dns_resolver/search.c + src/core/data/system/dns_resolver/search/list.c + src/core/data/system/dns_resolver/server.c + src/core/data/system/dns_resolver/server/list.c + src/core/data/system/ntp/server.c + src/core/data/system/ntp/server/list.c + src/core/data/system/authentication/authorized_key.c + src/core/data/system/authentication/authorized_key/list.c + src/core/data/system/authentication/local_user.c + src/core/data/system/authentication/local_user/list.c # system API - src/plugin/api/system/load.c - src/plugin/api/system/check.c - src/plugin/api/system/store.c - src/plugin/api/system/change.c - src/plugin/api/system/ntp/load.c - src/plugin/api/system/ntp/check.c - src/plugin/api/system/ntp/store.c - src/plugin/api/system/ntp/change.c - src/plugin/api/system/dns_resolver/load.c - src/plugin/api/system/dns_resolver/check.c - src/plugin/api/system/dns_resolver/store.c - src/plugin/api/system/dns_resolver/change.c - src/plugin/api/system/authentication/load.c - src/plugin/api/system/authentication/check.c - src/plugin/api/system/authentication/store.c - src/plugin/api/system/authentication/change.c + src/core/api/system/load.c + src/core/api/system/check.c + src/core/api/system/store.c + src/core/api/system/change.c + src/core/api/system/ntp/load.c + src/core/api/system/ntp/check.c + src/core/api/system/ntp/store.c + src/core/api/system/ntp/change.c + src/core/api/system/dns_resolver/load.c + src/core/api/system/dns_resolver/check.c + src/core/api/system/dns_resolver/store.c + src/core/api/system/dns_resolver/change.c + src/core/api/system/authentication/load.c + src/core/api/system/authentication/check.c + src/core/api/system/authentication/store.c + src/core/api/system/authentication/change.c ) -# build plugin static library +# build plugin core library add_library(${PLUGIN_LIRBARY_NAME} STATIC ${SOURCES}) install(TARGETS ${PLUGIN_LIRBARY_NAME} DESTINATION lib) -if(NOT PLUGIN) - add_executable( - ${CMAKE_PROJECT_NAME} - src/main.c - ) - # link executable - target_link_libraries( - ${CMAKE_PROJECT_NAME} - ${PLUGIN_LIRBARY_NAME} - ${SYSREPO_LIBRARIES} - ${LIBYANG_LIBRARIES} - ${SRPC_LIBRARIES} - ${UMGMT_LIBRARIES} - ) - install(TARGETS ${CMAKE_PROJECT_NAME} DESTINATION bin) -else() - # build plugin as a module for sysrepo-plugind - add_library( - ${CMAKE_PROJECT_NAME} - MODULE - ${SOURCES} - ) - # remove lib prefix from plugin library - set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES PREFIX "") - # link executable - target_link_libraries( - ${CMAKE_PROJECT_NAME} - ${SYSREPO_LIBRARIES} - ${LIBYANG_LIBRARIES} - ${SRPC_LIBRARIES} - ${UMGMT_LIBRARIES} - ) -endif() - -if(SYSTEMD_FOUND) - if(DEFINED SYSTEMD_IFINDEX) - add_compile_definitions(SYSTEMD_IFINDEX=${SYSTEMD_IFINDEX}) - else() - message(SEND_ERROR "No SYSTEMD_IFINDEX value set for default interface index to use with systemd... Unable to build without it") - endif() - - add_compile_definitions(SYSTEMD) - target_link_libraries( - ${CMAKE_PROJECT_NAME} - ${SYSTEMD_LIBRARIES} - ) - include_directories( - ${SYSTEMD_INCLUDE_DIRS} - ) -endif() - -# augyang support -if(AUGYANG_FOUND) - add_compile_definitions(AUGYANG) -else(AUGYANG_FOUND) - message(WARNING "AUGYANG not found - augeas support will be disabled") -endif() +# if(SYSTEMD_FOUND) +# if(DEFINED SYSTEMD_IFINDEX) +# add_compile_definitions(SYSTEMD_IFINDEX=${SYSTEMD_IFINDEX}) +# else() +# message(SEND_ERROR "No SYSTEMD_IFINDEX value set for default interface index to use with systemd... Unable to build without it") +# endif() + +# add_compile_definitions(SYSTEMD) +# target_link_libraries( +# ${CMAKE_PROJECT_NAME} +# ${SYSTEMD_LIBRARIES} +# ) +# include_directories( +# ${SYSTEMD_INCLUDE_DIRS} +# ) +# endif() + +# # augyang support +# if(AUGYANG_FOUND) +# add_compile_definitions(AUGYANG) +# else(AUGYANG_FOUND) +# message(WARNING "AUGYANG not found - augeas support will be disabled") +# endif() if(ENABLE_BUILD_TESTS) find_package(CMOCKA REQUIRED) diff --git a/src/plugin/api/system/authentication/change.c b/src/core/api/system/authentication/change.c similarity index 98% rename from src/plugin/api/system/authentication/change.c rename to src/core/api/system/authentication/change.c index 36325bd..b8da770 100644 --- a/src/plugin/api/system/authentication/change.c +++ b/src/core/api/system/authentication/change.c @@ -11,14 +11,14 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include "change.h" -#include "plugin/common.h" +#include "core/common.h" #include "libyang/tree_data.h" -#include "plugin/api/system/authentication/store.h" -#include "plugin/data/system/authentication/authorized_key.h" -#include "plugin/data/system/authentication/authorized_key/list.h" -#include "plugin/data/system/authentication/local_user.h" -#include "plugin/data/system/authentication/local_user/list.h" -#include "plugin/types.h" +#include "core/api/system/authentication/store.h" +#include "core/data/system/authentication/authorized_key.h" +#include "core/data/system/authentication/authorized_key/list.h" +#include "core/data/system/authentication/local_user.h" +#include "core/data/system/authentication/local_user/list.h" +#include "core/types.h" #include "umgmt/db.h" #include "umgmt/types.h" #include "umgmt/user.h" diff --git a/src/plugin/api/system/authentication/change.h b/src/core/api/system/authentication/change.h similarity index 97% rename from src/plugin/api/system/authentication/change.h rename to src/core/api/system/authentication/change.h index 6f8ceb6..dd5620a 100644 --- a/src/plugin/api/system/authentication/change.h +++ b/src/core/api/system/authentication/change.h @@ -13,7 +13,7 @@ #ifndef SYSTEM_PLUGIN_API_AUTHENTICATION_CHANGE_H #define SYSTEM_PLUGIN_API_AUTHENTICATION_CHANGE_H -#include "plugin/context.h" +#include "core/context.h" #include diff --git a/src/plugin/api/system/authentication/check.c b/src/core/api/system/authentication/check.c similarity index 94% rename from src/plugin/api/system/authentication/check.c rename to src/core/api/system/authentication/check.c index 57df2d2..3a51323 100644 --- a/src/plugin/api/system/authentication/check.c +++ b/src/core/api/system/authentication/check.c @@ -12,9 +12,9 @@ */ #include "check.h" #include "load.h" -#include "plugin/common.h" -#include "plugin/data/system/authentication/local_user/list.h" -#include "plugin/data/system/authentication/authorized_key/list.h" +#include "core/common.h" +#include "core/data/system/authentication/local_user/list.h" +#include "core/data/system/authentication/authorized_key/list.h" #include #include diff --git a/src/plugin/api/system/authentication/check.h b/src/core/api/system/authentication/check.h similarity index 93% rename from src/plugin/api/system/authentication/check.h rename to src/core/api/system/authentication/check.h index 41f28c4..71fbd31 100644 --- a/src/plugin/api/system/authentication/check.h +++ b/src/core/api/system/authentication/check.h @@ -13,8 +13,8 @@ #ifndef SYSTEM_PLUGIN_API_AUTHENTICATION_CHECK_H #define SYSTEM_PLUGIN_API_AUTHENTICATION_CHECK_H -#include "plugin/context.h" -#include "plugin/types.h" +#include "core/context.h" +#include "core/types.h" #include srpc_check_status_t system_authentication_check_user(system_ctx_t *ctx, system_local_user_element_t *head, system_local_user_element_t **system_head); diff --git a/src/plugin/api/system/authentication/load.c b/src/core/api/system/authentication/load.c similarity index 94% rename from src/plugin/api/system/authentication/load.c rename to src/core/api/system/authentication/load.c index e1db4a5..9425980 100644 --- a/src/plugin/api/system/authentication/load.c +++ b/src/core/api/system/authentication/load.c @@ -12,13 +12,13 @@ */ #include "load.h" #include "sysrepo.h" -#include "plugin/types.h" -#include "plugin/common.h" +#include "core/types.h" +#include "core/common.h" -#include "plugin/data/system/authentication/authorized_key/list.h" -#include "plugin/data/system/authentication/authorized_key.h" -#include "plugin/data/system/authentication/local_user/list.h" -#include "plugin/data/system/authentication/local_user.h" +#include "core/data/system/authentication/authorized_key/list.h" +#include "core/data/system/authentication/authorized_key.h" +#include "core/data/system/authentication/local_user/list.h" +#include "core/data/system/authentication/local_user.h" #include "umgmt/user.h" #include diff --git a/src/plugin/api/system/authentication/load.h b/src/core/api/system/authentication/load.h similarity index 92% rename from src/plugin/api/system/authentication/load.h rename to src/core/api/system/authentication/load.h index 3e5538f..6be9804 100644 --- a/src/plugin/api/system/authentication/load.h +++ b/src/core/api/system/authentication/load.h @@ -13,8 +13,8 @@ #ifndef SYSTEM_PLUGIN_API_AUTHENTICATION_LOAD_H #define SYSTEM_PLUGIN_API_AUTHENTICATION_LOAD_H -#include "plugin/context.h" -#include "plugin/types.h" +#include "core/context.h" +#include "core/types.h" int system_authentication_load_user(system_ctx_t *ctx, system_local_user_element_t **head); int system_authentication_load_user_authorized_key(system_ctx_t *ctx, const char *user, system_authorized_key_element_t **head); diff --git a/src/plugin/api/system/authentication/store.c b/src/core/api/system/authentication/store.c similarity index 99% rename from src/plugin/api/system/authentication/store.c rename to src/core/api/system/authentication/store.c index 217fdd6..419a964 100644 --- a/src/plugin/api/system/authentication/store.c +++ b/src/core/api/system/authentication/store.c @@ -11,7 +11,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include "store.h" -#include "plugin/common.h" +#include "core/common.h" #include "umgmt/group.h" #include diff --git a/src/plugin/api/system/authentication/store.h b/src/core/api/system/authentication/store.h similarity index 96% rename from src/plugin/api/system/authentication/store.h rename to src/core/api/system/authentication/store.h index 71d34ee..6096261 100644 --- a/src/plugin/api/system/authentication/store.h +++ b/src/core/api/system/authentication/store.h @@ -13,7 +13,7 @@ #ifndef SYSTEM_PLUGIN_API_AUTHENTICATION_STORE_H #define SYSTEM_PLUGIN_API_AUTHENTICATION_STORE_H -#include "plugin/context.h" +#include "core/context.h" int system_authentication_store_user(system_ctx_t *ctx, system_local_user_element_t *head); int system_authentication_store_user_authorized_key(system_ctx_t *ctx, const char *user, system_authorized_key_element_t *head); diff --git a/src/plugin/api/system/change.c b/src/core/api/system/change.c similarity index 100% rename from src/plugin/api/system/change.c rename to src/core/api/system/change.c diff --git a/src/plugin/api/system/change.h b/src/core/api/system/change.h similarity index 96% rename from src/plugin/api/system/change.h rename to src/core/api/system/change.h index 01e003c..709be47 100644 --- a/src/plugin/api/system/change.h +++ b/src/core/api/system/change.h @@ -13,7 +13,7 @@ #ifndef SYSTEM_PLUGIN_API_CHANGE_H #define SYSTEM_PLUGIN_API_CHANGE_H -#include "plugin/context.h" +#include "core/context.h" #include diff --git a/src/plugin/api/system/check.c b/src/core/api/system/check.c similarity index 100% rename from src/plugin/api/system/check.c rename to src/core/api/system/check.c diff --git a/src/plugin/api/system/check.h b/src/core/api/system/check.h similarity index 93% rename from src/plugin/api/system/check.h rename to src/core/api/system/check.h index 4b2d5df..2b81dac 100644 --- a/src/plugin/api/system/check.h +++ b/src/core/api/system/check.h @@ -13,8 +13,8 @@ #ifndef SYSTEM_PLUGIN_API_CHECK_H #define SYSTEM_PLUGIN_API_CHECK_H -#include "plugin/common.h" -#include "plugin/context.h" +#include "core/common.h" +#include "core/context.h" #include diff --git a/src/plugin/api/system/dns_resolver/change.c b/src/core/api/system/dns_resolver/change.c similarity index 95% rename from src/plugin/api/system/dns_resolver/change.c rename to src/core/api/system/dns_resolver/change.c index 3c28834..429b1bb 100644 --- a/src/plugin/api/system/dns_resolver/change.c +++ b/src/core/api/system/dns_resolver/change.c @@ -16,15 +16,15 @@ #include "srpc/types.h" #include "store.h" #include "sysrepo_types.h" -#include "plugin/types.h" -#include "plugin/common.h" +#include "core/types.h" +#include "core/common.h" // data -#include "plugin/data/system/dns_resolver/server/list.h" -#include "plugin/data/system/dns_resolver/search/list.h" -#include "plugin/data/system/dns_resolver/search.h" -#include "plugin/data/system/dns_resolver/server.h" -#include "plugin/data/system/ip_address.h" +#include "core/data/system/dns_resolver/server/list.h" +#include "core/data/system/dns_resolver/search/list.h" +#include "core/data/system/dns_resolver/search.h" +#include "core/data/system/dns_resolver/server.h" +#include "core/data/system/ip_address.h" #include diff --git a/src/plugin/api/system/dns_resolver/change.h b/src/core/api/system/dns_resolver/change.h similarity index 97% rename from src/plugin/api/system/dns_resolver/change.h rename to src/core/api/system/dns_resolver/change.h index c6b0798..a111f1f 100644 --- a/src/plugin/api/system/dns_resolver/change.h +++ b/src/core/api/system/dns_resolver/change.h @@ -13,7 +13,7 @@ #ifndef SYSTEM_PLUGIN_API_DNS_RESOLVER_CHANGE_H #define SYSTEM_PLUGIN_API_DNS_RESOLVER_CHANGE_H -#include "plugin/context.h" +#include "core/context.h" #include diff --git a/src/plugin/api/system/dns_resolver/check.c b/src/core/api/system/dns_resolver/check.c similarity index 94% rename from src/plugin/api/system/dns_resolver/check.c rename to src/core/api/system/dns_resolver/check.c index a76db06..3086b74 100644 --- a/src/plugin/api/system/dns_resolver/check.c +++ b/src/core/api/system/dns_resolver/check.c @@ -13,10 +13,10 @@ #include "check.h" #include "load.h" #include "srpc/types.h" -#include "plugin/types.h" -#include "plugin/common.h" -#include "plugin/data/system/dns_resolver/search/list.h" -#include "plugin/data/system/dns_resolver/server/list.h" +#include "core/types.h" +#include "core/common.h" +#include "core/data/system/dns_resolver/search/list.h" +#include "core/data/system/dns_resolver/server/list.h" #include diff --git a/src/plugin/api/system/dns_resolver/check.h b/src/core/api/system/dns_resolver/check.h similarity index 92% rename from src/plugin/api/system/dns_resolver/check.h rename to src/core/api/system/dns_resolver/check.h index 2e7b422..182b309 100644 --- a/src/plugin/api/system/dns_resolver/check.h +++ b/src/core/api/system/dns_resolver/check.h @@ -13,8 +13,8 @@ #ifndef SYSTEM_PLUGIN_API_DNS_RESOLVER_CHECK_H #define SYSTEM_PLUGIN_API_DNS_RESOLVER_CHECK_H -#include "plugin/context.h" -#include "plugin/types.h" +#include "core/context.h" +#include "core/types.h" #include diff --git a/src/plugin/api/system/dns_resolver/load.c b/src/core/api/system/dns_resolver/load.c similarity index 95% rename from src/plugin/api/system/dns_resolver/load.c rename to src/core/api/system/dns_resolver/load.c index 6ec1500..30c9f90 100644 --- a/src/plugin/api/system/dns_resolver/load.c +++ b/src/core/api/system/dns_resolver/load.c @@ -11,13 +11,13 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include "load.h" -#include "plugin/common.h" +#include "core/common.h" // data -#include "plugin/data/system/dns_resolver/server.h" -#include "plugin/data/system/dns_resolver/server/list.h" -#include "plugin/data/system/dns_resolver/search/list.h" -#include "plugin/data/system/ip_address.h" +#include "core/data/system/dns_resolver/server.h" +#include "core/data/system/dns_resolver/server/list.h" +#include "core/data/system/dns_resolver/search/list.h" +#include "core/data/system/ip_address.h" #include diff --git a/src/plugin/api/system/dns_resolver/load.h b/src/core/api/system/dns_resolver/load.h similarity index 92% rename from src/plugin/api/system/dns_resolver/load.h rename to src/core/api/system/dns_resolver/load.h index bd5b048..1e0f68c 100644 --- a/src/plugin/api/system/dns_resolver/load.h +++ b/src/core/api/system/dns_resolver/load.h @@ -13,8 +13,8 @@ #ifndef SYSTEM_PLUGIN_API_DNS_RESOLVER_LOAD_H #define SYSTEM_PLUGIN_API_DNS_RESOLVER_LOAD_H -#include "plugin/types.h" -#include "plugin/context.h" +#include "core/types.h" +#include "core/context.h" int system_dns_resolver_load_search(system_ctx_t *ctx, system_dns_search_element_t **head); int system_dns_resolver_load_server(system_ctx_t *ctx, system_dns_server_element_t **head); diff --git a/src/plugin/api/system/dns_resolver/store.c b/src/core/api/system/dns_resolver/store.c similarity index 99% rename from src/plugin/api/system/dns_resolver/store.c rename to src/core/api/system/dns_resolver/store.c index 790be71..72dcf63 100644 --- a/src/plugin/api/system/dns_resolver/store.c +++ b/src/core/api/system/dns_resolver/store.c @@ -11,7 +11,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include "store.h" -#include "plugin/common.h" +#include "core/common.h" #include diff --git a/src/plugin/api/system/dns_resolver/store.h b/src/core/api/system/dns_resolver/store.h similarity index 92% rename from src/plugin/api/system/dns_resolver/store.h rename to src/core/api/system/dns_resolver/store.h index 8043809..6fd486d 100644 --- a/src/plugin/api/system/dns_resolver/store.h +++ b/src/core/api/system/dns_resolver/store.h @@ -13,8 +13,8 @@ #ifndef SYSTEM_PLUGIN_API_DNS_RESOLVER_STORE_H #define SYSTEM_PLUGIN_API_DNS_RESOLVER_STORE_H -#include "plugin/types.h" -#include "plugin/context.h" +#include "core/types.h" +#include "core/context.h" int system_dns_resolver_store_search(system_ctx_t *ctx, system_dns_search_element_t *head); int system_dns_resolver_store_server(system_ctx_t *ctx, system_dns_server_element_t *head); diff --git a/src/plugin/api/system/load.c b/src/core/api/system/load.c similarity index 100% rename from src/plugin/api/system/load.c rename to src/core/api/system/load.c diff --git a/src/plugin/api/system/load.h b/src/core/api/system/load.h similarity index 93% rename from src/plugin/api/system/load.h rename to src/core/api/system/load.h index 4f3a9a5..f2fb751 100644 --- a/src/plugin/api/system/load.h +++ b/src/core/api/system/load.h @@ -13,8 +13,8 @@ #ifndef SYSTEM_PLUGIN_API_LOAD_H #define SYSTEM_PLUGIN_API_LOAD_H -#include "plugin/common.h" -#include "plugin/context.h" +#include "core/common.h" +#include "core/context.h" int system_load_hostname(system_ctx_t *ctx, char buffer[SYSTEM_HOSTNAME_LENGTH_MAX]); int system_load_contact(system_ctx_t *ctx, char buffer[256]); diff --git a/src/plugin/api/system/ntp/change.c b/src/core/api/system/ntp/change.c similarity index 99% rename from src/plugin/api/system/ntp/change.c rename to src/core/api/system/ntp/change.c index ab24569..847cf84 100644 --- a/src/plugin/api/system/ntp/change.c +++ b/src/core/api/system/ntp/change.c @@ -11,13 +11,13 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include "change.h" -#include "plugin/common.h" +#include "core/common.h" #include "libyang/tree_data.h" #include "sysrepo/xpath.h" #include "sysrepo_types.h" -#include "plugin/data/system/ntp/server.h" -#include "plugin/data/system/ntp/server/list.h" +#include "core/data/system/ntp/server.h" +#include "core/data/system/ntp/server/list.h" #include #include diff --git a/src/plugin/api/system/ntp/change.h b/src/core/api/system/ntp/change.h similarity index 95% rename from src/plugin/api/system/ntp/change.h rename to src/core/api/system/ntp/change.h index a43a714..3ad0f8f 100644 --- a/src/plugin/api/system/ntp/change.h +++ b/src/core/api/system/ntp/change.h @@ -13,8 +13,8 @@ #ifndef SYSTEM_PLUGIN_API_NTP_CHANGE_H #define SYSTEM_PLUGIN_API_NTP_CHANGE_H -#include "plugin/types.h" -#include "plugin/context.h" +#include "core/types.h" +#include "core/context.h" #include diff --git a/src/plugin/api/system/ntp/check.c b/src/core/api/system/ntp/check.c similarity index 95% rename from src/plugin/api/system/ntp/check.c rename to src/core/api/system/ntp/check.c index 00b729f..3475884 100644 --- a/src/plugin/api/system/ntp/check.c +++ b/src/core/api/system/ntp/check.c @@ -12,8 +12,8 @@ */ #include "check.h" #include "load.h" -#include "plugin/common.h" -#include "plugin/data/system/ntp/server/list.h" +#include "core/common.h" +#include "core/data/system/ntp/server/list.h" #include #include diff --git a/src/plugin/api/system/ntp/check.h b/src/core/api/system/ntp/check.h similarity index 91% rename from src/plugin/api/system/ntp/check.h rename to src/core/api/system/ntp/check.h index c88f42a..ea8b7c1 100644 --- a/src/plugin/api/system/ntp/check.h +++ b/src/core/api/system/ntp/check.h @@ -13,8 +13,8 @@ #ifndef SYSTEM_PLUGIN_API_NTP_CHECK_H #define SYSTEM_PLUGIN_API_NTP_CHECK_H -#include "plugin/types.h" -#include "plugin/context.h" +#include "core/types.h" +#include "core/context.h" #include diff --git a/src/plugin/api/system/ntp/load.c b/src/core/api/system/ntp/load.c similarity index 97% rename from src/plugin/api/system/ntp/load.c rename to src/core/api/system/ntp/load.c index 4d1e172..6991461 100644 --- a/src/plugin/api/system/ntp/load.c +++ b/src/core/api/system/ntp/load.c @@ -11,11 +11,11 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include "load.h" -#include "plugin/common.h" +#include "core/common.h" // data -#include "plugin/data/system/ntp/server.h" -#include "plugin/data/system/ntp/server/list.h" +#include "core/data/system/ntp/server.h" +#include "core/data/system/ntp/server/list.h" #include #include diff --git a/src/plugin/api/system/ntp/load.h b/src/core/api/system/ntp/load.h similarity index 90% rename from src/plugin/api/system/ntp/load.h rename to src/core/api/system/ntp/load.h index 483fe3b..5339089 100644 --- a/src/plugin/api/system/ntp/load.h +++ b/src/core/api/system/ntp/load.h @@ -13,8 +13,8 @@ #ifndef SYSTEM_PLUGIN_API_NTP_LOAD_H #define SYSTEM_PLUGIN_API_NTP_LOAD_H -#include "plugin/types.h" -#include "plugin/context.h" +#include "core/types.h" +#include "core/context.h" int system_ntp_load_server(system_ctx_t *ctx, system_ntp_server_element_t **head); diff --git a/src/plugin/api/system/ntp/store.c b/src/core/api/system/ntp/store.c similarity index 98% rename from src/plugin/api/system/ntp/store.c rename to src/core/api/system/ntp/store.c index 8650a37..85c54f5 100644 --- a/src/plugin/api/system/ntp/store.c +++ b/src/core/api/system/ntp/store.c @@ -11,11 +11,11 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include "store.h" -#include "plugin/common.h" -#include "plugin/context.h" +#include "core/common.h" +#include "core/context.h" #include "libyang/printer_data.h" #include "srpc/ly_tree.h" -#include "plugin/types.h" +#include "core/types.h" #include #include diff --git a/src/plugin/api/system/ntp/store.h b/src/core/api/system/ntp/store.h similarity index 90% rename from src/plugin/api/system/ntp/store.h rename to src/core/api/system/ntp/store.h index a5a6bf5..22b82b1 100644 --- a/src/plugin/api/system/ntp/store.h +++ b/src/core/api/system/ntp/store.h @@ -13,8 +13,8 @@ #ifndef SYSTEM_PLUGIN_API_NTP_STORE_H #define SYSTEM_PLUGIN_API_NTP_STORE_H -#include "plugin/types.h" -#include "plugin/context.h" +#include "core/types.h" +#include "core/context.h" int system_ntp_store_server(system_ctx_t *ctx, system_ntp_server_element_t *head); diff --git a/src/plugin/api/system/store.c b/src/core/api/system/store.c similarity index 98% rename from src/plugin/api/system/store.c rename to src/core/api/system/store.c index ea91cc8..0c51f37 100644 --- a/src/plugin/api/system/store.c +++ b/src/core/api/system/store.c @@ -11,7 +11,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include "store.h" -#include "plugin/common.h" +#include "core/common.h" #include #include diff --git a/src/plugin/api/system/store.h b/src/core/api/system/store.h similarity index 96% rename from src/plugin/api/system/store.h rename to src/core/api/system/store.h index 2108809..570b2ce 100644 --- a/src/plugin/api/system/store.h +++ b/src/core/api/system/store.h @@ -13,7 +13,7 @@ #ifndef SYSTEM_PLUGIN_API_STORE_H #define SYSTEM_PLUGIN_API_STORE_H -#include "plugin/context.h" +#include "core/context.h" int system_store_hostname(system_ctx_t *ctx, const char *hostname); int system_store_contact(system_ctx_t *ctx, const char *contact); diff --git a/src/plugin/common.c b/src/core/common.c similarity index 100% rename from src/plugin/common.c rename to src/core/common.c diff --git a/src/plugin/common.h b/src/core/common.h similarity index 100% rename from src/plugin/common.h rename to src/core/common.h diff --git a/src/plugin/context.h b/src/core/context.h similarity index 98% rename from src/plugin/context.h rename to src/core/context.h index 1c8fc53..ae955ad 100644 --- a/src/plugin/context.h +++ b/src/core/context.h @@ -13,7 +13,7 @@ #ifndef SYSTEM_PLUGIN_CONTEXT_H #define SYSTEM_PLUGIN_CONTEXT_H -#include "plugin/types.h" +#include "core/types.h" #include "srpc/types.h" #include "umgmt/types.h" #include diff --git a/src/plugin/data/system/authentication/authorized_key.c b/src/core/data/system/authentication/authorized_key.c similarity index 100% rename from src/plugin/data/system/authentication/authorized_key.c rename to src/core/data/system/authentication/authorized_key.c diff --git a/src/plugin/data/system/authentication/authorized_key.h b/src/core/data/system/authentication/authorized_key.h similarity index 97% rename from src/plugin/data/system/authentication/authorized_key.h rename to src/core/data/system/authentication/authorized_key.h index 067a8bb..67955e9 100644 --- a/src/plugin/data/system/authentication/authorized_key.h +++ b/src/core/data/system/authentication/authorized_key.h @@ -13,7 +13,7 @@ #ifndef SYSTEM_PLUGIN_DATA_AUTHENTICATION_AUTHORIZED_KEY_H #define SYSTEM_PLUGIN_DATA_AUTHENTICATION_AUTHORIZED_KEY_H -#include "plugin/types.h" +#include "core/types.h" void system_authorized_key_init(system_authorized_key_t *key); int system_authorized_key_set_name(system_authorized_key_t *key, const char *name); diff --git a/src/plugin/data/system/authentication/authorized_key/list.c b/src/core/data/system/authentication/authorized_key/list.c similarity index 97% rename from src/plugin/data/system/authentication/authorized_key/list.c rename to src/core/data/system/authentication/authorized_key/list.c index 2b388f2..d7fe070 100644 --- a/src/plugin/data/system/authentication/authorized_key/list.c +++ b/src/core/data/system/authentication/authorized_key/list.c @@ -11,7 +11,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include "list.h" -#include "plugin/data/system/authentication/authorized_key.h" +#include "core/data/system/authentication/authorized_key.h" #include #include diff --git a/src/plugin/data/system/authentication/authorized_key/list.h b/src/core/data/system/authentication/authorized_key/list.h similarity index 97% rename from src/plugin/data/system/authentication/authorized_key/list.h rename to src/core/data/system/authentication/authorized_key/list.h index 3eda85c..6a1f29d 100644 --- a/src/plugin/data/system/authentication/authorized_key/list.h +++ b/src/core/data/system/authentication/authorized_key/list.h @@ -13,7 +13,7 @@ #ifndef SYSTEM_PLUGIN_DATA_AUTHENTICATION_AUTHORIZED_KEY_LIST_H #define SYSTEM_PLUGIN_DATA_AUTHENTICATION_AUTHORIZED_KEY_LIST_H -#include "plugin/types.h" +#include "core/types.h" void system_authorized_key_list_init(system_authorized_key_element_t **head); int system_authorized_key_list_add(system_authorized_key_element_t **head, system_authorized_key_t key); diff --git a/src/plugin/data/system/authentication/local_user.c b/src/core/data/system/authentication/local_user.c similarity index 95% rename from src/plugin/data/system/authentication/local_user.c rename to src/core/data/system/authentication/local_user.c index e43b3a8..a695f49 100644 --- a/src/plugin/data/system/authentication/local_user.c +++ b/src/core/data/system/authentication/local_user.c @@ -11,7 +11,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include "local_user.h" -#include "plugin/data/system/authentication/authorized_key/list.h" +#include "core/data/system/authentication/authorized_key/list.h" #include #include diff --git a/src/plugin/data/system/authentication/local_user.h b/src/core/data/system/authentication/local_user.h similarity index 96% rename from src/plugin/data/system/authentication/local_user.h rename to src/core/data/system/authentication/local_user.h index 556bd67..c4075b5 100644 --- a/src/plugin/data/system/authentication/local_user.h +++ b/src/core/data/system/authentication/local_user.h @@ -13,7 +13,7 @@ #ifndef SYSTEM_PLUGIN_DATA_AUTHENTICATION_LOCAL_USER_H #define SYSTEM_PLUGIN_DATA_AUTHENTICATION_LOCAL_USER_H -#include "plugin/types.h" +#include "core/types.h" void system_local_user_init(system_local_user_t *user); int system_local_user_set_name(system_local_user_t *user, const char *name); diff --git a/src/plugin/data/system/authentication/local_user/list.c b/src/core/data/system/authentication/local_user/list.c similarity index 97% rename from src/plugin/data/system/authentication/local_user/list.c rename to src/core/data/system/authentication/local_user/list.c index 6ee7b60..72d2c90 100644 --- a/src/plugin/data/system/authentication/local_user/list.c +++ b/src/core/data/system/authentication/local_user/list.c @@ -11,7 +11,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include "list.h" -#include "plugin/data/system/authentication/local_user.h" +#include "core/data/system/authentication/local_user.h" #include #include diff --git a/src/plugin/data/system/authentication/local_user/list.h b/src/core/data/system/authentication/local_user/list.h similarity index 97% rename from src/plugin/data/system/authentication/local_user/list.h rename to src/core/data/system/authentication/local_user/list.h index b42f305..777cbf2 100644 --- a/src/plugin/data/system/authentication/local_user/list.h +++ b/src/core/data/system/authentication/local_user/list.h @@ -13,7 +13,7 @@ #ifndef SYSTEM_PLUGIN_DATA_AUTHENTICATION_LOCAL_USER_LIST_H #define SYSTEM_PLUGIN_DATA_AUTHENTICATION_LOCAL_USER_LIST_H -#include "plugin/types.h" +#include "core/types.h" void system_local_user_list_init(system_local_user_element_t **head); int system_local_user_list_add(system_local_user_element_t **head, system_local_user_t user); diff --git a/src/plugin/data/system/dns_resolver/search.c b/src/core/data/system/dns_resolver/search.c similarity index 100% rename from src/plugin/data/system/dns_resolver/search.c rename to src/core/data/system/dns_resolver/search.c diff --git a/src/plugin/data/system/dns_resolver/search.h b/src/core/data/system/dns_resolver/search.h similarity index 96% rename from src/plugin/data/system/dns_resolver/search.h rename to src/core/data/system/dns_resolver/search.h index d4a0e4a..76376b0 100644 --- a/src/plugin/data/system/dns_resolver/search.h +++ b/src/core/data/system/dns_resolver/search.h @@ -13,7 +13,7 @@ #ifndef SYSTEM_PLUGIN_DATA_DNS_RESOLVER_SEARCH_H #define SYSTEM_PLUGIN_DATA_DNS_RESOLVER_SEARCH_H -#include "plugin/types.h" +#include "core/types.h" void system_dns_search_init(system_dns_search_t *search); int system_dns_search_set_domain(system_dns_search_t *search, const char *domain); diff --git a/src/plugin/data/system/dns_resolver/search/list.c b/src/core/data/system/dns_resolver/search/list.c similarity index 97% rename from src/plugin/data/system/dns_resolver/search/list.c rename to src/core/data/system/dns_resolver/search/list.c index e358233..a2c15dc 100644 --- a/src/plugin/data/system/dns_resolver/search/list.c +++ b/src/core/data/system/dns_resolver/search/list.c @@ -11,7 +11,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include "list.h" -#include "plugin/data/system/dns_resolver/search.h" +#include "core/data/system/dns_resolver/search.h" #include #include diff --git a/src/plugin/data/system/dns_resolver/search/list.h b/src/core/data/system/dns_resolver/search/list.h similarity index 97% rename from src/plugin/data/system/dns_resolver/search/list.h rename to src/core/data/system/dns_resolver/search/list.h index c815db9..5e276b0 100644 --- a/src/plugin/data/system/dns_resolver/search/list.h +++ b/src/core/data/system/dns_resolver/search/list.h @@ -13,7 +13,7 @@ #ifndef SYSTEM_PLUGIN_DATA_DNS_RESOLVER_SEARCH_LIST_H #define SYSTEM_PLUGIN_DATA_DNS_RESOLVER_SEARCH_LIST_H -#include "plugin/types.h" +#include "core/types.h" void system_dns_search_list_init(system_dns_search_element_t **head); int system_dns_search_list_add(system_dns_search_element_t **head, system_dns_search_t search); diff --git a/src/plugin/data/system/dns_resolver/server.c b/src/core/data/system/dns_resolver/server.c similarity index 100% rename from src/plugin/data/system/dns_resolver/server.c rename to src/core/data/system/dns_resolver/server.c diff --git a/src/plugin/data/system/dns_resolver/server.h b/src/core/data/system/dns_resolver/server.h similarity index 97% rename from src/plugin/data/system/dns_resolver/server.h rename to src/core/data/system/dns_resolver/server.h index b39d640..69f6da0 100644 --- a/src/plugin/data/system/dns_resolver/server.h +++ b/src/core/data/system/dns_resolver/server.h @@ -13,7 +13,7 @@ #ifndef SYSTEM_PLUGIN_DATA_DNS_RESOLVER_SERVER_H #define SYSTEM_PLUGIN_DATA_DNS_RESOLVER_SERVER_H -#include "plugin/types.h" +#include "core/types.h" void system_dns_server_init(system_dns_server_t *server); int system_dns_server_set_name(system_dns_server_t *server, const char *name); diff --git a/src/plugin/data/system/dns_resolver/server/list.c b/src/core/data/system/dns_resolver/server/list.c similarity index 96% rename from src/plugin/data/system/dns_resolver/server/list.c rename to src/core/data/system/dns_resolver/server/list.c index 1935e1f..8111085 100644 --- a/src/plugin/data/system/dns_resolver/server/list.c +++ b/src/core/data/system/dns_resolver/server/list.c @@ -11,8 +11,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include "list.h" -#include "plugin/data/system/dns_resolver/server.h" -#include "plugin/types.h" +#include "core/data/system/dns_resolver/server.h" +#include "core/types.h" #include #include diff --git a/src/plugin/data/system/dns_resolver/server/list.h b/src/core/data/system/dns_resolver/server/list.h similarity index 97% rename from src/plugin/data/system/dns_resolver/server/list.h rename to src/core/data/system/dns_resolver/server/list.h index 0a8e29f..7d6fb0e 100644 --- a/src/plugin/data/system/dns_resolver/server/list.h +++ b/src/core/data/system/dns_resolver/server/list.h @@ -13,7 +13,7 @@ #ifndef SYSTEM_PLUGIN_DATA_DNS_RESOLVER_SERVER_LIST_H #define SYSTEM_PLUGIN_DATA_DNS_RESOLVER_SERVER_LIST_H -#include "plugin/types.h" +#include "core/types.h" void system_dns_server_list_init(system_dns_server_element_t **head); int system_dns_server_list_add(system_dns_server_element_t **head, system_dns_server_t server); diff --git a/src/plugin/data/system/ip_address.c b/src/core/data/system/ip_address.c similarity index 100% rename from src/plugin/data/system/ip_address.c rename to src/core/data/system/ip_address.c diff --git a/src/plugin/data/system/ip_address.h b/src/core/data/system/ip_address.h similarity index 96% rename from src/plugin/data/system/ip_address.h rename to src/core/data/system/ip_address.h index 5c35cc1..edc670b 100644 --- a/src/plugin/data/system/ip_address.h +++ b/src/core/data/system/ip_address.h @@ -13,7 +13,7 @@ #ifndef SYSTEM_PLUGIN_DATA_IP_ADDRESS_H #define SYSTEM_PLUGIN_DATA_IP_ADDRESS_H -#include "plugin/types.h" +#include "core/types.h" void system_ip_address_init(system_ip_address_t *address); int system_ip_address_to_str(system_ip_address_t *address, char *buffer, const unsigned int buffer_size); diff --git a/src/plugin/data/system/ntp/server.c b/src/core/data/system/ntp/server.c similarity index 100% rename from src/plugin/data/system/ntp/server.c rename to src/core/data/system/ntp/server.c diff --git a/src/plugin/data/system/ntp/server.h b/src/core/data/system/ntp/server.h similarity index 97% rename from src/plugin/data/system/ntp/server.h rename to src/core/data/system/ntp/server.h index 182aec4..e07adf3 100644 --- a/src/plugin/data/system/ntp/server.h +++ b/src/core/data/system/ntp/server.h @@ -13,7 +13,7 @@ #ifndef SYSTEM_PLUGIN_DATA_NTP_SERVER_H #define SYSTEM_PLUGIN_DATA_NTP_SERVER_H -#include "plugin/types.h" +#include "core/types.h" void system_ntp_server_init(system_ntp_server_t *server); int system_ntp_server_set_name(system_ntp_server_t *server, const char *name); diff --git a/src/plugin/data/system/ntp/server/list.c b/src/core/data/system/ntp/server/list.c similarity index 97% rename from src/plugin/data/system/ntp/server/list.c rename to src/core/data/system/ntp/server/list.c index 9cfb29a..c8d8f22 100644 --- a/src/plugin/data/system/ntp/server/list.c +++ b/src/core/data/system/ntp/server/list.c @@ -11,8 +11,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include "list.h" -#include "plugin/data/system/ntp/server.h" -#include "plugin/types.h" +#include "core/data/system/ntp/server.h" +#include "core/types.h" #include #include diff --git a/src/plugin/data/system/ntp/server/list.h b/src/core/data/system/ntp/server/list.h similarity index 97% rename from src/plugin/data/system/ntp/server/list.h rename to src/core/data/system/ntp/server/list.h index 28303e8..7e4f293 100644 --- a/src/plugin/data/system/ntp/server/list.h +++ b/src/core/data/system/ntp/server/list.h @@ -13,7 +13,7 @@ #ifndef SYSTEM_PLUGIN_DATA_NTP_SERVER_LIST_H #define SYSTEM_PLUGIN_DATA_NTP_SERVER_LIST_H -#include "plugin/types.h" +#include "core/types.h" void system_ntp_server_list_init(system_ntp_server_element_t **head); int system_ntp_server_list_add(system_ntp_server_element_t **head, system_ntp_server_t server); diff --git a/src/plugin/ly_tree.c b/src/core/ly_tree.c similarity index 99% rename from src/plugin/ly_tree.c rename to src/core/ly_tree.c index 6cb3ac1..3f9f375 100644 --- a/src/plugin/ly_tree.c +++ b/src/core/ly_tree.c @@ -10,8 +10,8 @@ * * SPDX-License-Identifier: BSD-3-Clause */ -#include "plugin/ly_tree.h" -#include "plugin/common.h" +#include "core/ly_tree.h" +#include "core/common.h" #include #include diff --git a/src/plugin/ly_tree.h b/src/core/ly_tree.h similarity index 100% rename from src/plugin/ly_tree.h rename to src/core/ly_tree.h diff --git a/src/plugin/startup/load.c b/src/core/startup/load.c similarity index 96% rename from src/plugin/startup/load.c rename to src/core/startup/load.c index 045d110..e045835 100644 --- a/src/plugin/startup/load.c +++ b/src/core/startup/load.c @@ -11,26 +11,26 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include "load.h" -#include "plugin/common.h" -#include "plugin/context.h" -#include "plugin/ly_tree.h" +#include "core/common.h" +#include "core/context.h" +#include "core/ly_tree.h" // API for getting system data #include "srpc/common.h" #include "srpc/feature_status.h" #include "srpc/ly_tree.h" -#include "plugin/api/system/load.h" -#include "plugin/api/system/authentication/load.h" -#include "plugin/api/system/dns_resolver/load.h" +#include "core/api/system/load.h" +#include "core/api/system/authentication/load.h" +#include "core/api/system/dns_resolver/load.h" // data manipulation -#include "plugin/api/system/ntp/load.h" -#include "plugin/data/system/authentication/authorized_key/list.h" -#include "plugin/data/system/authentication/local_user/list.h" -#include "plugin/data/system/ip_address.h" -#include "plugin/data/system/dns_resolver/search/list.h" -#include "plugin/data/system/dns_resolver/server/list.h" -#include "plugin/data/system/ntp/server/list.h" +#include "core/api/system/ntp/load.h" +#include "core/data/system/authentication/authorized_key/list.h" +#include "core/data/system/authentication/local_user/list.h" +#include "core/data/system/ip_address.h" +#include "core/data/system/dns_resolver/search/list.h" +#include "core/data/system/dns_resolver/server/list.h" +#include "core/data/system/ntp/server/list.h" #include #include diff --git a/src/plugin/startup/load.h b/src/core/startup/load.h similarity index 94% rename from src/plugin/startup/load.h rename to src/core/startup/load.h index e4da4c6..ba68016 100644 --- a/src/plugin/startup/load.h +++ b/src/core/startup/load.h @@ -13,7 +13,7 @@ #ifndef SYSTEM_PLUGIN_STARTUP_LOAD_H #define SYSTEM_PLUGIN_STARTUP_LOAD_H -#include "plugin/context.h" +#include "core/context.h" int system_startup_load_data(system_ctx_t *ctx, sr_session_ctx_t *session); diff --git a/src/plugin/startup/store.c b/src/core/startup/store.c similarity index 96% rename from src/plugin/startup/store.c rename to src/core/startup/store.c index d0d863e..c3edeac 100644 --- a/src/plugin/startup/store.c +++ b/src/core/startup/store.c @@ -11,38 +11,38 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include "store.h" -#include "plugin/common.h" +#include "core/common.h" #include "libyang/printer_data.h" -#include "plugin/ly_tree.h" +#include "core/ly_tree.h" // API for getting system data #include "srpc/common.h" #include "srpc/feature_status.h" #include "srpc/ly_tree.h" #include "srpc/types.h" -#include "plugin/api/system/authentication/check.h" -#include "plugin/api/system/authentication/load.h" -#include "plugin/api/system/check.h" -#include "plugin/api/system/ntp/check.h" -#include "plugin/api/system/ntp/store.h" -#include "plugin/api/system/store.h" -#include "plugin/api/system/dns_resolver/store.h" -#include "plugin/api/system/dns_resolver/check.h" -#include "plugin/api/system/authentication/store.h" +#include "core/api/system/authentication/check.h" +#include "core/api/system/authentication/load.h" +#include "core/api/system/check.h" +#include "core/api/system/ntp/check.h" +#include "core/api/system/ntp/store.h" +#include "core/api/system/store.h" +#include "core/api/system/dns_resolver/store.h" +#include "core/api/system/dns_resolver/check.h" +#include "core/api/system/authentication/store.h" // data manipulation -#include "plugin/data/system/authentication/authorized_key.h" -#include "plugin/data/system/authentication/authorized_key/list.h" -#include "plugin/data/system/authentication/local_user.h" -#include "plugin/data/system/authentication/local_user/list.h" -#include "plugin/data/system/ip_address.h" -#include "plugin/data/system/dns_resolver/search.h" -#include "plugin/data/system/dns_resolver/search/list.h" -#include "plugin/data/system/dns_resolver/server.h" -#include "plugin/data/system/dns_resolver/server/list.h" -#include "plugin/data/system/ntp/server.h" -#include "plugin/data/system/ntp/server/list.h" -#include "plugin/types.h" +#include "core/data/system/authentication/authorized_key.h" +#include "core/data/system/authentication/authorized_key/list.h" +#include "core/data/system/authentication/local_user.h" +#include "core/data/system/authentication/local_user/list.h" +#include "core/data/system/ip_address.h" +#include "core/data/system/dns_resolver/search.h" +#include "core/data/system/dns_resolver/search/list.h" +#include "core/data/system/dns_resolver/server.h" +#include "core/data/system/dns_resolver/server/list.h" +#include "core/data/system/ntp/server.h" +#include "core/data/system/ntp/server/list.h" +#include "core/types.h" #include #include diff --git a/src/plugin/startup/store.h b/src/core/startup/store.h similarity index 94% rename from src/plugin/startup/store.h rename to src/core/startup/store.h index ab9aed1..954e287 100644 --- a/src/plugin/startup/store.h +++ b/src/core/startup/store.h @@ -13,7 +13,7 @@ #ifndef SYSTEM_PLUGIN_STARTUP_STORE_H #define SYSTEM_PLUGIN_STARTUP_STORE_H -#include "plugin/context.h" +#include "core/context.h" int system_startup_store_data(system_ctx_t *ctx, sr_session_ctx_t *session); diff --git a/src/plugin/subscription/change.c b/src/core/subscription/change.c similarity index 96% rename from src/plugin/subscription/change.c rename to src/core/subscription/change.c index 2014b21..6ab77cb 100644 --- a/src/plugin/subscription/change.c +++ b/src/core/subscription/change.c @@ -11,37 +11,37 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include "change.h" -#include "plugin/common.h" -#include "plugin/context.h" +#include "core/common.h" +#include "core/context.h" #include "libyang/printer_data.h" -#include "plugin/ly_tree.h" +#include "core/ly_tree.h" #include "srpc/common.h" #include "srpc/feature_status.h" #include "srpc/ly_tree.h" #include "sysrepo_types.h" -#include "plugin/api/system/authentication/load.h" -#include "plugin/data/system/authentication/local_user/list.h" -#include "plugin/data/system/dns_resolver/search/list.h" -#include "plugin/data/system/dns_resolver/server/list.h" -#include "plugin/data/system/ntp/server/list.h" -#include "plugin/types.h" +#include "core/api/system/authentication/load.h" +#include "core/data/system/authentication/local_user/list.h" +#include "core/data/system/dns_resolver/search/list.h" +#include "core/data/system/dns_resolver/server/list.h" +#include "core/data/system/ntp/server/list.h" +#include "core/types.h" #include "umgmt/db.h" // Load API -#include "plugin/api/system/load.h" -#include "plugin/api/system/dns_resolver/load.h" -#include "plugin/api/system/ntp/load.h" +#include "core/api/system/load.h" +#include "core/api/system/dns_resolver/load.h" +#include "core/api/system/ntp/load.h" // Change API -#include "plugin/api/system/change.h" -#include "plugin/api/system/dns_resolver/change.h" -#include "plugin/api/system/ntp/change.h" -#include "plugin/api/system/authentication/change.h" +#include "core/api/system/change.h" +#include "core/api/system/dns_resolver/change.h" +#include "core/api/system/ntp/change.h" +#include "core/api/system/authentication/change.h" // Store API -#include "plugin/api/system/store.h" -#include "plugin/api/system/dns_resolver/store.h" -#include "plugin/api/system/ntp/store.h" +#include "core/api/system/store.h" +#include "core/api/system/dns_resolver/store.h" +#include "core/api/system/ntp/store.h" #include #include diff --git a/src/plugin/subscription/change.h b/src/core/subscription/change.h similarity index 100% rename from src/plugin/subscription/change.h rename to src/core/subscription/change.h diff --git a/src/plugin/subscription/operational.c b/src/core/subscription/operational.c similarity index 99% rename from src/plugin/subscription/operational.c rename to src/core/subscription/operational.c index 9785677..b85bcd3 100644 --- a/src/plugin/subscription/operational.c +++ b/src/core/subscription/operational.c @@ -11,8 +11,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include "operational.h" -#include "plugin/common.h" -#include "plugin/ly_tree.h" +#include "core/common.h" +#include "core/ly_tree.h" #include #include diff --git a/src/plugin/subscription/operational.h b/src/core/subscription/operational.h similarity index 100% rename from src/plugin/subscription/operational.h rename to src/core/subscription/operational.h diff --git a/src/plugin/subscription/rpc.c b/src/core/subscription/rpc.c similarity index 98% rename from src/plugin/subscription/rpc.c rename to src/core/subscription/rpc.c index 9f33c58..60f6d24 100644 --- a/src/plugin/subscription/rpc.c +++ b/src/core/subscription/rpc.c @@ -11,7 +11,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include "rpc.h" -#include "plugin/common.h" +#include "core/common.h" #include #include diff --git a/src/plugin/subscription/rpc.h b/src/core/subscription/rpc.h similarity index 100% rename from src/plugin/subscription/rpc.h rename to src/core/subscription/rpc.h diff --git a/src/plugin/types.h b/src/core/types.h similarity index 100% rename from src/plugin/types.h rename to src/core/types.h diff --git a/src/plugin.c b/src/plugin.c index de65254..5d435ba 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -11,8 +11,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include "plugin.h" -#include "plugin/common.h" -#include "plugin/context.h" +#include "core/common.h" +#include "core/context.h" // stdlib #include @@ -28,13 +28,13 @@ #include "srpc/types.h" // startup -#include "plugin/startup/load.h" -#include "plugin/startup/store.h" +#include "core/startup/load.h" +#include "core/startup/store.h" // subs -#include "plugin/subscription/change.h" -#include "plugin/subscription/operational.h" -#include "plugin/subscription/rpc.h" +#include "core/subscription/change.h" +#include "core/subscription/operational.h" +#include "core/subscription/rpc.h" #include diff --git a/tests/system_utest.c b/tests/system_utest.c index 8e506cc..e3c9b97 100644 --- a/tests/system_utest.c +++ b/tests/system_utest.c @@ -12,19 +12,19 @@ #include // plugin code -#include "plugin/context.h" +#include "core/context.h" // store API -#include "plugin/api/system/store.h" +#include "core/api/system/store.h" // load API -#include "plugin/api/system/load.h" +#include "core/api/system/load.h" // check API -#include "plugin/api/system/check.h" +#include "core/api/system/check.h" // ntp load API -#include "plugin/api/system/dns_resolver/load.h" +#include "core/api/system/dns_resolver/load.h" // init functionality static int setup(void **state);