]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #2649 in SNORT/snort3 from ~SATHIRKA/snort3:dump_userappid_conf...
authorShravan Rangarajuvenkata (shrarang) <shrarang@cisco.com>
Tue, 1 Dec 2020 20:24:48 +0000 (20:24 +0000)
committerShravan Rangarajuvenkata (shrarang) <shrarang@cisco.com>
Tue, 1 Dec 2020 20:24:48 +0000 (20:24 +0000)
Squashed commit of the following:

commit b95f65c4330ecf0758c267356413fced7b29d781
Author: Sreeja Athirkandathil Narayanan <sathirka@cisco.com>
Date:   Mon Nov 30 15:43:53 2020 -0500

    cppcheck

commit 51eb4856a7f9ef6e9654e6d4b7a1c6b6126f3af7
Author: Sreeja Athirkandathil Narayanan <sathirka@cisco.com>
Date:   Wed Nov 25 17:03:22 2020 -0500

    appid: Dump userappid configurations upon reloading third-party

src/network_inspectors/appid/appid_module.cc
src/network_inspectors/appid/test/tp_mock.cc
src/network_inspectors/appid/tp_appid_module_api.h

index fa52e059259a425290c919124358133079fcb69a..83bbe2747b86f368d1fd584166a1442e1bde40a5 100644 (file)
@@ -154,6 +154,9 @@ bool ACThirdPartyAppIdContextSwap::execute(Analyzer&, void**)
 
 ACThirdPartyAppIdContextSwap::~ACThirdPartyAppIdContextSwap()
 {
+    const AppIdContext& ctxt = inspector.get_ctxt();
+    std::string file_path = ctxt.get_tp_appid_ctxt()->get_user_config();
+    ctxt.get_odp_ctxt().get_app_info_mgr().dump_appid_configurations(file_path);
     LogMessage("== third-party configuration swap complete\n");
 }
 
index 4ac4057c5275c2c4426e830380449ce9b3e1af0c..d3c7830177d5dd404bda4c7708d44528b7b4a408 100644 (file)
@@ -57,6 +57,10 @@ public:
 
     int tinit() override { return 0; }
     bool tfini(bool, bool) override { return false; }
+    const string& get_user_config() const override { return user_config; }
+
+private:
+    const string user_config = "";
 };
 
 class ThirdPartyAppIdSessionImpl : public ThirdPartyAppIdSession
index d9cd46bc74218c8b68e06bcb5ef09c625b8e1297..4cab3143af227759f55afd85a5f06eee7696d30f 100644 (file)
@@ -67,6 +67,8 @@ public:
     static void set_tp_reload_in_progress(bool value) { tp_reload_in_progress = value; }
     static bool get_tp_reload_in_progress() { return tp_reload_in_progress; }
 
+    virtual const std::string& get_user_config() const = 0;
+
 protected:
     const uint32_t api_version;
     const std::string name;