refactor(userspace): remove libs relative imports

Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
This commit is contained in:
Roberto Scolaro 2023-11-14 15:06:59 +00:00 committed by poiana
parent 41ee64e006
commit ce87f2a014
38 changed files with 51 additions and 54 deletions

View File

@ -67,12 +67,10 @@ set(SCAP_HOST_ROOT_ENV_VAR_NAME "HOST_ROOT")
set(SCAP_HOSTNAME_ENV_VAR "FALCO_HOSTNAME") set(SCAP_HOSTNAME_ENV_VAR "FALCO_HOSTNAME")
set(SINSP_AGENT_CGROUP_MEM_PATH_ENV_VAR "FALCO_CGROUP_MEM_PATH") set(SINSP_AGENT_CGROUP_MEM_PATH_ENV_VAR "FALCO_CGROUP_MEM_PATH")
if(NOT LIBSCAP_DIR) if(NOT LIBS_DIR)
set(LIBSCAP_DIR "${FALCOSECURITY_LIBS_SOURCE_DIR}") set(LIBS_DIR "${FALCOSECURITY_LIBS_SOURCE_DIR}")
endif() endif()
set(LIBSINSP_DIR "${FALCOSECURITY_LIBS_SOURCE_DIR}")
# configure gVisor support # configure gVisor support
set(BUILD_LIBSCAP_GVISOR ${BUILD_FALCO_GVISOR} CACHE BOOL "") set(BUILD_LIBSCAP_GVISOR ${BUILD_FALCO_GVISOR} CACHE BOOL "")

View File

@ -37,8 +37,7 @@ add_dependencies(falco_engine yamlcpp njson)
target_include_directories(falco_engine target_include_directories(falco_engine
PUBLIC PUBLIC
${LIBSCAP_INCLUDE_DIRS} ${LIBS_DIR}/userspace
${LIBSINSP_INCLUDE_DIRS}
${PROJECT_BINARY_DIR}/userspace/engine ${PROJECT_BINARY_DIR}/userspace/engine
${nlohmann_json_INCLUDE_DIRS} ${nlohmann_json_INCLUDE_DIRS}
${TBB_INCLUDE_DIR} ${TBB_INCLUDE_DIR}

View File

@ -24,11 +24,10 @@ limitations under the License.
#include <map> #include <map>
#include "filter_ruleset.h" #include "filter_ruleset.h"
#include "sinsp.h" #include <libsinsp/sinsp.h>
#include "filter.h" #include <libsinsp/filter.h>
#include "event.h" #include <libsinsp/event.h>
#include <libsinsp/gen_filter.h>
#include "gen_filter.h"
/*! /*!
\brief A filter_ruleset that indexes enabled rules by event type, \brief A filter_ruleset that indexes enabled rules by event type,

View File

@ -20,7 +20,7 @@ limitations under the License.
#include <string> #include <string>
#include <exception> #include <exception>
#include <mutex> #include <mutex>
#include <sinsp.h> #include <libsinsp/sinsp.h>
// //
// equivalent to an "unbounded queue" in TBB terms or largest long value // equivalent to an "unbounded queue" in TBB terms or largest long value

View File

@ -33,8 +33,9 @@ limitations under the License.
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
#include <sinsp.h> #include <libsinsp/sinsp.h>
#include <plugin.h> #include <libsinsp/plugin.h>
#include <libsinsp/utils.h>
#include "falco_engine.h" #include "falco_engine.h"
#include "falco_utils.h" #include "falco_utils.h"
@ -42,7 +43,6 @@ limitations under the License.
#include "formats.h" #include "formats.h"
#include "utils.h"
#include "evttype_index_ruleset.h" #include "evttype_index_ruleset.h"
const std::string falco_engine::s_default_ruleset = "falco-default-ruleset"; const std::string falco_engine::s_default_ruleset = "falco-default-ruleset";

View File

@ -30,7 +30,7 @@ limitations under the License.
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
#include "gen_filter.h" #include <libsinsp/gen_filter.h>
#include "filter_ruleset.h" #include "filter_ruleset.h"
#include "rule_loader.h" #include "rule_loader.h"
#include "rule_loader_reader.h" #include "rule_loader_reader.h"

View File

@ -21,7 +21,7 @@ limitations under the License.
#include <string> #include <string>
#include "falco_common.h" #include "falco_common.h"
#include <filter/ast.h> #include <libsinsp/filter/ast.h>
/*! /*!
\brief Represents a list in the Falco Engine. \brief Represents a list in the Falco Engine.

View File

@ -21,7 +21,7 @@ limitations under the License.
#include <iomanip> #include <iomanip>
#include "falco_utils.h" #include "falco_utils.h"
#include "utils.h" #include <libsinsp/utils.h>
#include <re2/re2.h> #include <re2/re2.h>

View File

@ -17,7 +17,7 @@ limitations under the License.
#pragma once #pragma once
#include <filter/parser.h> #include <libsinsp/filter/parser.h>
#include <string> #include <string>
#include <unordered_set> #include <unordered_set>
#include <unordered_map> #include <unordered_map>

View File

@ -17,7 +17,7 @@ limitations under the License.
#pragma once #pragma once
#include <filter/parser.h> #include <libsinsp/filter/parser.h>
#include <string> #include <string>
#include <unordered_set> #include <unordered_set>
#include <unordered_map> #include <unordered_map>

View File

@ -19,12 +19,11 @@ limitations under the License.
#include "falco_rule.h" #include "falco_rule.h"
#include "rule_loader_compile_output.h" #include "rule_loader_compile_output.h"
#include <filter/ast.h> #include <libsinsp/filter/ast.h>
#include <filter.h> #include <libsinsp/filter.h>
#include <functional> #include <libsinsp/event.h>
#include <event.h> #include <libsinsp/gen_filter.h>
#include <gen_filter.h> #include <libsinsp/events/sinsp_events.h>
#include <events/sinsp_events.h>
/*! /*!
\brief Manages a set of rulesets. A ruleset is a set of \brief Manages a set of rulesets. A ruleset is a set of

View File

@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
#include <sinsp.h> #include <libsinsp/sinsp.h>
#include "filter_warning_resolver.h" #include "filter_warning_resolver.h"
using namespace falco; using namespace falco;

View File

@ -17,7 +17,7 @@ limitations under the License.
#pragma once #pragma once
#include <filter/parser.h> #include <libsinsp/filter/parser.h>
#include <string> #include <string>
#include <set> #include <set>
#include <memory> #include <memory>

View File

@ -19,7 +19,7 @@ limitations under the License.
#include <string> #include <string>
#include <map> #include <map>
#include <gen_filter.h> #include <libsinsp/gen_filter.h>
#include "falco_engine.h" #include "falco_engine.h"
class falco_formats class falco_formats

View File

@ -25,7 +25,7 @@ limitations under the License.
#include "falco_source.h" #include "falco_source.h"
#include "falco_load_result.h" #include "falco_load_result.h"
#include "indexed_vector.h" #include "indexed_vector.h"
#include "version.h" #include <libsinsp/version.h>
namespace rule_loader namespace rule_loader
{ {

View File

@ -16,7 +16,7 @@ limitations under the License.
*/ */
#include <string> #include <string>
#include <version.h> #include <libsinsp/version.h>
#include "falco_engine.h" #include "falco_engine.h"
#include "rule_loader_collector.h" #include "rule_loader_collector.h"

View File

@ -23,6 +23,7 @@ limitations under the License.
#include "rule_loader_reader.h" #include "rule_loader_reader.h"
#include "falco_engine_version.h" #include "falco_engine_version.h"
#include "rule_loading_messages.h" #include "rule_loading_messages.h"
#include <libsinsp/logger.h>
#define THROW(cond, err, ctx) { if ((cond)) { throw rule_loader::rule_load_exception(falco::load_result::LOAD_ERR_YAML_VALIDATE, (err), (ctx)); } } #define THROW(cond, err, ctx) { if ((cond)) { throw rule_loader::rule_load_exception(falco::load_result::LOAD_ERR_YAML_VALIDATE, (err), (ctx)); } }

View File

@ -19,8 +19,8 @@ limitations under the License.
#include "rule_loader.h" #include "rule_loader.h"
#include "rule_loader_collector.h" #include "rule_loader_collector.h"
#include "logger.h" #include <libsinsp/logger.h>
#include "version.h" #include <libsinsp/version.h>
#include "falco_engine_version.h" #include "falco_engine_version.h"
namespace rule_loader namespace rule_loader

View File

@ -17,7 +17,7 @@ limitations under the License.
#include "helpers.h" #include "helpers.h"
#include "falco_utils.h" #include "falco_utils.h"
#include <plugin_manager.h> #include <libsinsp/plugin_manager.h>
#include <unordered_set> #include <unordered_set>

View File

@ -19,7 +19,7 @@ limitations under the License.
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <plugin_manager.h> #include <libsinsp/plugin_manager.h>
#include <configuration.h> #include <configuration.h>
#include "helpers.h" #include "helpers.h"

View File

@ -16,7 +16,7 @@ limitations under the License.
*/ */
#include "actions.h" #include "actions.h"
#include <plugin_manager.h> #include <libsinsp/plugin_manager.h>
using namespace falco::app; using namespace falco::app;
using namespace falco::app::actions; using namespace falco::app::actions;

View File

@ -20,7 +20,7 @@ limitations under the License.
#include <unordered_set> #include <unordered_set>
#include <plugin_manager.h> #include <libsinsp/plugin_manager.h>
using namespace falco::app; using namespace falco::app;
using namespace falco::app::actions; using namespace falco::app::actions;

View File

@ -18,7 +18,7 @@ limitations under the License.
#include "actions.h" #include "actions.h"
#include "helpers.h" #include "helpers.h"
#include <plugin_manager.h> #include <libsinsp/plugin_manager.h>
using namespace falco::app; using namespace falco::app;
using namespace falco::app::actions; using namespace falco::app::actions;

View File

@ -16,7 +16,7 @@ limitations under the License.
*/ */
#include "actions.h" #include "actions.h"
#include <plugin_manager.h> #include <libsinsp/plugin_manager.h>
using namespace falco::app; using namespace falco::app;
using namespace falco::app::actions; using namespace falco::app::actions;

View File

@ -18,7 +18,7 @@ limitations under the License.
#include "actions.h" #include "actions.h"
#include "helpers.h" #include "helpers.h"
#include <plugin_manager.h> #include <libsinsp/plugin_manager.h>
#include <unordered_set> #include <unordered_set>

View File

@ -18,7 +18,7 @@ limitations under the License.
#include "actions.h" #include "actions.h"
#include "helpers.h" #include "helpers.h"
#include <plugin_manager.h> #include <libsinsp/plugin_manager.h>
using namespace falco::app; using namespace falco::app;
using namespace falco::app::actions; using namespace falco::app::actions;

View File

@ -35,7 +35,7 @@ limitations under the License.
#include "../../falco_outputs.h" #include "../../falco_outputs.h"
#include "../../event_drops.h" #include "../../event_drops.h"
#include <plugin_manager.h> #include <libsinsp/plugin_manager.h>
using namespace falco::app; using namespace falco::app;
using namespace falco::app::actions; using namespace falco::app::actions;

View File

@ -17,7 +17,7 @@ limitations under the License.
#pragma once #pragma once
#include <event.h> #include <libsinsp/event.h>
#include <string> #include <string>
#include <vector> #include <vector>

View File

@ -28,7 +28,7 @@ limitations under the License.
#include "../webserver.h" #include "../webserver.h"
#endif #endif
#include <sinsp.h> #include <libsinsp/sinsp.h>
#include <string> #include <string>
#include <memory> #include <memory>

View File

@ -19,8 +19,8 @@ limitations under the License.
#include <memory> #include <memory>
#include <unordered_set> #include <unordered_set>
#include <sinsp.h> #include <libsinsp/sinsp.h>
#include <token_bucket.h> #include <libsinsp/token_bucket.h>
#include "logger.h" #include "logger.h"
#include "falco_outputs.h" #include "falco_outputs.h"

View File

@ -20,7 +20,7 @@ limitations under the License.
#include <memory> #include <memory>
#include <map> #include <map>
#include "gen_filter.h" #include <libsinsp/gen_filter.h>
#include "falco_common.h" #include "falco_common.h"
#include "falco_engine.h" #include "falco_engine.h"
#include "outputs.h" #include "outputs.h"

View File

@ -17,7 +17,7 @@ limitations under the License.
#pragma once #pragma once
#include "sinsp.h" #include <libsinsp/sinsp.h>
#ifndef _WIN32 #ifndef _WIN32
#include <syslog.h> #include <syslog.h>
#endif #endif

View File

@ -21,7 +21,7 @@ limitations under the License.
#include <map> #include <map>
#include "falco_common.h" #include "falco_common.h"
#include "gen_filter.h" #include <libsinsp/gen_filter.h>
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace falco namespace falco

View File

@ -28,7 +28,8 @@ limitations under the License.
#include "stats_writer.h" #include "stats_writer.h"
#include "logger.h" #include "logger.h"
#include "config_falco.h" #include "config_falco.h"
#include "strl.h" #include <libscap/strl.h>
#include <libscap/scap_vtable.h>
// note: ticker_t is an uint16_t, which is enough because we don't care about // note: ticker_t is an uint16_t, which is enough because we don't care about
// overflows here. Threads calling stats_writer::handle() will just // overflows here. Threads calling stats_writer::handle() will just

View File

@ -21,7 +21,7 @@ limitations under the License.
#include <string> #include <string>
#include <unordered_map> #include <unordered_map>
#include <sinsp.h> #include <libsinsp/sinsp.h>
#ifndef __EMSCRIPTEN__ #ifndef __EMSCRIPTEN__
#include "tbb/concurrent_queue.h" #include "tbb/concurrent_queue.h"

View File

@ -20,7 +20,7 @@ limitations under the License.
#include "config_falco.h" #include "config_falco.h"
#include "falco_engine_version.h" #include "falco_engine_version.h"
#include <plugin_manager.h> #include <libsinsp/plugin_manager.h>
// todo: move string conversion to scap // todo: move string conversion to scap
static std::string get_driver_api_version(const std::shared_ptr<sinsp>& s) static std::string get_driver_api_version(const std::shared_ptr<sinsp>& s)

View File

@ -20,7 +20,7 @@ limitations under the License.
#include <memory> #include <memory>
#include <string> #include <string>
#include <unordered_map> #include <unordered_map>
#include <sinsp.h> #include <libsinsp/sinsp.h>
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace falco namespace falco

View File

@ -21,7 +21,7 @@ limitations under the License.
#include <httplib.h> #include <httplib.h>
#include <thread> #include <thread>
#include <memory> #include <memory>
#include <sinsp.h> #include <libsinsp/sinsp.h>
#include "configuration.h" #include "configuration.h"
class falco_webserver class falco_webserver