From a33d2d13bfa2788593d1ba2fa2988b4496c17193 Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Mon, 25 Jun 2018 16:34:54 -0500 Subject: [PATCH] Reorganize private broker/Manager members --- CHANGES | 6 ++++++ VERSION | 2 +- src/broker/Manager.cc | 12 ++++++------ src/broker/Manager.h | 27 ++++++++++++--------------- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/CHANGES b/CHANGES index 4a603200ce..585dd3e21b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,10 @@ +2.5-687 | 2018-06-25 16:35:25 -0500 + + * Reorganize internal + private broker/Manager.h bits (Corelight) + + * Reduce proliferation of including broker header files (Corelight) + 2.5-684 | 2018-06-25 11:26:55 -0500 * Use docker containers to run Bro tests on Travis CI (Daniel Thayer) diff --git a/VERSION b/VERSION index 29acf569de..3b74ad46cd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.5-684 +2.5-687 diff --git a/src/broker/Manager.cc b/src/broker/Manager.cc index eb1ef5de05..f31537f3b7 100644 --- a/src/broker/Manager.cc +++ b/src/broker/Manager.cc @@ -73,9 +73,6 @@ public: const broker::endpoint_info Manager::NoPeer{{}, {}}; -VectorType* Manager::vector_of_data_type; -EnumType* Manager::log_id_type; -EnumType* Manager::writer_id_type; int Manager::script_scope = 0; struct unref_guard { @@ -140,14 +137,17 @@ static std::string RenderMessage(const broker::error& e) #endif -Manager::Manager(bool reading_pcaps) +Manager::Manager(bool arg_reading_pcaps) { bound_port = 0; + reading_pcaps = arg_reading_pcaps; peer_count = 0; + log_topic_func = nullptr; + vector_of_data_type = nullptr; + log_id_type = nullptr; + writer_id_type = nullptr; - next_timestamp = 1; SetIdle(false); - this->reading_pcaps = reading_pcaps; } Manager::~Manager() diff --git a/src/broker/Manager.h b/src/broker/Manager.h index b5b05adab1..b5faaee345 100644 --- a/src/broker/Manager.h +++ b/src/broker/Manager.h @@ -371,12 +371,6 @@ private: const char* Tag() override { return "Broker::Manager"; } - Func* log_topic_func; - std::string default_log_topic_prefix; - uint16_t bound_port; - - std::shared_ptr bstate; - struct LogBuffer { // Indexed by topic string. std::unordered_map msgs; @@ -386,9 +380,6 @@ private: size_t Flush(broker::endpoint& endpoint); }; - // Indexed by stream ID enum. - std::vector log_buffers; - // Data stores using query_id = std::pair; @@ -402,19 +393,25 @@ private: } }; + std::vector log_buffers; // Indexed by stream ID enum. + std::string default_log_topic_prefix; + std::shared_ptr bstate; std::unordered_map data_stores; - std::unordered_map pending_queries; + std::unordered_map pending_queries; Stats statistics; - double next_timestamp; + + uint16_t bound_port; bool reading_pcaps; int peer_count; - static int script_scope; + Func* log_topic_func; + VectorType* vector_of_data_type; + EnumType* log_id_type; + EnumType* writer_id_type; - static VectorType* vector_of_data_type; - static EnumType* log_id_type; - static EnumType* writer_id_type; + static int script_scope; }; } // namespace bro_broker