-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add: openvasd library Function and structure for talking with openvasd via Openvasd API Add: function for parsing string containing the feed in json format Replace libjson-glib with libcjson Use json pull for parsing the feed metadata Adjust CMakeLists.txt file * Remove gvm_json_pull_event_reset() because duplicates gvm_json_pull_event_cleanup()
- Loading branch information
Showing
13 changed files
with
3,108 additions
and
22 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
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
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,68 @@ | ||
# SPDX-FileCopyrightText: 2015-2023 Greenbone AG | ||
# | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
## Library | ||
|
||
include (FindPkgConfig) | ||
|
||
if (NOT PKG_CONFIG_FOUND) | ||
message(FATAL_ERROR "pkg-config executable not found. Aborting.") | ||
endif (NOT PKG_CONFIG_FOUND) | ||
|
||
## Dependency checks | ||
|
||
pkg_check_modules (GLIB REQUIRED glib-2.0>=2.42) | ||
pkg_check_modules (CURL REQUIRED libcurl>=7.74.0) | ||
|
||
# for json parsing we need cJSON | ||
pkg_check_modules (CJSON REQUIRED libcjson>=1.7.14) | ||
pkg_check_modules (GLIB_JSON REQUIRED json-glib-1.0>=1.4.4) | ||
|
||
|
||
include_directories (${GLIB_INCLUDE_DIRS} ${GLIB_JSON_INCLUDE_DIRS} | ||
${CURL_INCLUDE_DIRS}) | ||
|
||
set (FILES openvasd.c vtparser.c) | ||
set (HEADERS openvasd.h) | ||
|
||
if (BUILD_STATIC) | ||
add_library (gvm_openvasd_static STATIC ${FILES}) | ||
set_target_properties (gvm_openvasd_static PROPERTIES OUTPUT_NAME "gvm_openvasd") | ||
set_target_properties (gvm_openvasd_static PROPERTIES CLEAN_DIRECT_OUTPUT 1) | ||
set_target_properties (gvm_openvasd_static PROPERTIES PUBLIC_HEADER "${HEADERS}") | ||
endif (BUILD_STATIC) | ||
|
||
if (BUILD_SHARED) | ||
add_library (gvm_openvasd_shared SHARED ${FILES}) | ||
set_target_properties (gvm_openvasd_shared PROPERTIES OUTPUT_NAME "gvm_openvasd") | ||
set_target_properties (gvm_openvasd_shared PROPERTIES CLEAN_DIRECT_OUTPUT 1) | ||
set_target_properties (gvm_openvasd_shared PROPERTIES SOVERSION "${PROJECT_VERSION_MAJOR}") | ||
set_target_properties (gvm_openvasd_shared PROPERTIES VERSION "${CPACK_PACKAGE_VERSION}") | ||
set_target_properties (gvm_openvasd_shared PROPERTIES PUBLIC_HEADER "${HEADERS}") | ||
|
||
target_link_libraries (gvm_openvasd_shared LINK_PRIVATE ${GLIB_LDFLAGS} ${GLIB_JSON_LDFLAGS} | ||
${CURL_LDFLAGS} ${LINKER_HARDENING_FLAGS}) | ||
endif (BUILD_SHARED) | ||
|
||
## Install | ||
configure_file (libgvm_openvasd.pc.in ${CMAKE_BINARY_DIR}/libgvm_openvasd.pc @ONLY) | ||
|
||
install (FILES ${CMAKE_BINARY_DIR}/libgvm_openvasd.pc | ||
DESTINATION ${LIBDIR}/pkgconfig) | ||
|
||
if (BUILD_STATIC) | ||
install (TARGETS gvm_openvasd_static | ||
RUNTIME DESTINATION ${BINDIR} | ||
ARCHIVE DESTINATION ${LIBDIR} | ||
PUBLIC_HEADER DESTINATION "${INCLUDEDIR}/gvm/openvasd") | ||
endif (BUILD_STATIC) | ||
if (BUILD_SHARED) | ||
install (TARGETS gvm_openvasd_shared | ||
RUNTIME DESTINATION ${BINDIR} | ||
LIBRARY DESTINATION ${LIBDIR} | ||
ARCHIVE DESTINATION ${LIBDIR} | ||
PUBLIC_HEADER DESTINATION "${INCLUDEDIR}/gvm/openvasd") | ||
endif (BUILD_SHARED) | ||
|
||
## End |
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 @@ | ||
prefix=@CMAKE_INSTALL_PREFIX@ | ||
exec_prefix=@EXEC_PREFIX@ | ||
libdir=@LIBDIR@ | ||
includedir=@INCLUDEDIR@ | ||
|
||
Name: gvmlibs-openvasd | ||
Description: Greenbone Vulnerability Management Library openvasd | ||
Version: @LIBGVMCONFIG_VERSION@ | ||
Requires.private: glib-2.0 >= 2.42.0 | ||
Cflags: -I${includedir} -I${includedir}/gvm | ||
Libs: -L${libdir} -lgvm_openvasd |
Oops, something went wrong.