-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
139 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
|
||
set(PLUGIN_LIBRARY_NAME "srplg-ietf-system-augeas") | ||
set(PLUGIN_EXECUTABLE_NAME "ietf-system-augeas-plugin") | ||
|
||
set( | ||
PLUGIN_SOURCES | ||
|
||
plugin.c | ||
) | ||
|
||
# add plugin as a sysrepo-plugind library | ||
add_library( | ||
${PLUGIN_LIBRARY_NAME} | ||
MODULE | ||
${PLUGIN_SOURCES} | ||
) | ||
|
||
add_executable( | ||
${PLUGIN_EXECUTABLE_NAME} | ||
|
||
${PLUGIN_SOURCES} | ||
${CMAKE_SOURCE_DIR}/src/main.c | ||
) | ||
|
||
target_link_libraries( | ||
${PLUGIN_EXECUTABLE_NAME} | ||
|
||
# link against the core plugin library | ||
${PLUGIN_CORE_LIBRARY_NAME} | ||
|
||
# link other external libraries | ||
${SYSREPO_LIBRARIES} | ||
${LIBYANG_LIBRARIES} | ||
${SRPC_LIBRARIES} | ||
${UMGMT_LIBRARIES} | ||
) | ||
|
||
install(TARGETS ${PLUGIN_LIBRARY_NAME} DESTINATION lib) | ||
install(TARGETS ${PLUGIN_EXECUTABLE_NAME} DESTINATION bin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "plugin.h" | ||
|
||
int sr_plugin_init_cb(sr_session_ctx_t *session, void **private_data) | ||
{ | ||
int error = SR_ERR_OK; | ||
return error; | ||
} | ||
|
||
void sr_plugin_cleanup_cb(sr_session_ctx_t *session, void *private_data) | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* telekom / sysrepo-plugin-system | ||
* | ||
* This program is made available under the terms of the | ||
* BSD 3-Clause license which is available at | ||
* https://opensource.org/licenses/BSD-3-Clause | ||
* | ||
* SPDX-FileCopyrightText: 2022 Deutsche Telekom AG | ||
* SPDX-FileContributor: Sartura Ltd. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
#ifndef SYSTEM_AUGEAS_PLUGIN_H | ||
#define SYSTEM_AUGEAS_PLUGIN_H | ||
|
||
#include <sysrepo_types.h> | ||
|
||
int sr_plugin_init_cb(sr_session_ctx_t *session, void **private_data); | ||
void sr_plugin_cleanup_cb(sr_session_ctx_t *session, void *private_data); | ||
|
||
#endif // SYSTEM_AUGEAS_PLUGIN_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
|
||
set(PLUGIN_LIBRARY_NAME "srplg-ietf-system") | ||
set(PLUGIN_EXECUTABLE_NAME "ietf-system-plugin") | ||
|
||
set( | ||
PLUGIN_SOURCES | ||
|
||
plugin.c | ||
) | ||
|
||
# check for systemd flag | ||
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 plugin as a sysrepo-plugind library | ||
add_library( | ||
${PLUGIN_LIBRARY_NAME} | ||
MODULE | ||
${PLUGIN_SOURCES} | ||
) | ||
|
||
add_executable( | ||
${PLUGIN_EXECUTABLE_NAME} | ||
|
||
${PLUGIN_SOURCES} | ||
${CMAKE_SOURCE_DIR}/src/main.c | ||
) | ||
|
||
target_link_libraries( | ||
${PLUGIN_EXECUTABLE_NAME} | ||
|
||
# link against the core plugin library | ||
${PLUGIN_CORE_LIBRARY_NAME} | ||
|
||
# link other external libraries | ||
${SYSREPO_LIBRARIES} | ||
${LIBYANG_LIBRARIES} | ||
${SRPC_LIBRARIES} | ||
${UMGMT_LIBRARIES} | ||
${SYSTEMD_LIBRARIES} | ||
) | ||
|
||
install(TARGETS ${PLUGIN_LIBRARY_NAME} DESTINATION lib) | ||
install(TARGETS ${PLUGIN_EXECUTABLE_NAME} DESTINATION bin) |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters