From: Mike Stepanek (mstepane) Date: Mon, 30 Sep 2019 19:40:49 +0000 (-0400) Subject: Merge pull request #1773 in SNORT/snort3 from ~MMATIRKO/snort3:lua_whitespace_fix... X-Git-Tag: 3.0.0-262~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=963577eacbe96e54c2e90fdc9ef1f7f1bb55fdec;p=thirdparty%2Fsnort3.git Merge pull request #1773 in SNORT/snort3 from ~MMATIRKO/snort3:lua_whitespace_fix to master Squashed commit of the following: commit 5ac2c1b82fda46a734a1de9db83fad8576a4d1d2 Author: Michael Matirko Date: Mon Sep 30 11:41:06 2019 -0400 lua: fixed whitespace to match style guidelines --- diff --git a/src/framework/data_bus.h b/src/framework/data_bus.h index dbf5607c2..8f294703f 100644 --- a/src/framework/data_bus.h +++ b/src/framework/data_bus.h @@ -139,8 +139,8 @@ private: // A flow has been determined to be bidirectional #define STREAM_ICMP_BIDIRECTIONAL_EVENT "stream.icmp_bidirectional" -#define STREAM_IP_BIDIRECTIONAL_EVENT "stream.ip.bidirectional" -#define STREAM_UDP_BIDIRECTIONAL_EVENT "stream.udp.bidirectional" +#define STREAM_IP_BIDIRECTIONAL_EVENT "stream.ip.bidirectional" +#define STREAM_UDP_BIDIRECTIONAL_EVENT "stream.udp.bidirectional" // A TCP flow has the flag; a midstream flow may not publish other events #define STREAM_TCP_SYN_EVENT "stream.tcp_syn" diff --git a/src/lua/lua.cc b/src/lua/lua.cc index 99ad85cfb..cbc873958 100644 --- a/src/lua/lua.cc +++ b/src/lua/lua.cc @@ -41,22 +41,22 @@ State::State(bool openlibs) luaL_openlibs(state); } -State& State::operator=(State&& o) +State& State::operator=(State&& o) { if (this != &o) { if (state) - lua_close(state); - state = o.state; + lua_close(state); + state = o.state; o.state = nullptr; } - return *this; + return *this; } -State::State(State&& o) noexcept +State::State(State&& o) noexcept { - state = o.state; - o.state = nullptr; + state = o.state; + o.state = nullptr; } State::~State() diff --git a/src/lua/lua.h b/src/lua/lua.h index f830fe466..a1d3d3eee 100644 --- a/src/lua/lua.h +++ b/src/lua/lua.h @@ -36,12 +36,12 @@ public: State(bool openlibs = true); ~State(); - State(State&) = delete; - State& operator=(State&) = delete; + State(State&) = delete; + State& operator=(State&) = delete; // Enable move constructor State(State&&) noexcept; - State& operator=(State&&); + State& operator=(State&&); lua_State* get_ptr() { return state; } diff --git a/src/network_inspectors/reputation/reputation_config.h b/src/network_inspectors/reputation/reputation_config.h index 29726fa9b..e8323b6b1 100644 --- a/src/network_inspectors/reputation/reputation_config.h +++ b/src/network_inspectors/reputation/reputation_config.h @@ -36,7 +36,7 @@ enum NestedIP { INNER, OUTER, - ALL + ALL }; enum WhiteAction diff --git a/src/network_inspectors/reputation/reputation_inspect.cc b/src/network_inspectors/reputation/reputation_inspect.cc index cbc198f05..d33297691 100644 --- a/src/network_inspectors/reputation/reputation_inspect.cc +++ b/src/network_inspectors/reputation/reputation_inspect.cc @@ -190,12 +190,12 @@ static bool decision_per_layer(ReputationConfig* config, Packet* p, decision = get_reputation(config, result, &p->iplist_id, ingressZone, egressZone); if (decision == BLACKLISTED) - *decision_final = BLACKLISTED_SRC; + *decision_final = BLACKLISTED_SRC; else if (decision == MONITORED) *decision_final = MONITORED_SRC; else if (decision == WHITELISTED_TRUST) - *decision_final = WHITELISTED_TRUST_SRC; - else + *decision_final = WHITELISTED_TRUST_SRC; + else *decision_final = decision; if ( config->priority == decision) @@ -209,13 +209,13 @@ static bool decision_per_layer(ReputationConfig* config, Packet* p, decision = get_reputation(config, result, &p->iplist_id, ingressZone, egressZone); if (decision == BLACKLISTED) - *decision_final = BLACKLISTED_DST; + *decision_final = BLACKLISTED_DST; else if (decision == MONITORED) *decision_final = MONITORED_DST; else if (decision == WHITELISTED_TRUST) - *decision_final = WHITELISTED_TRUST_DST; + *decision_final = WHITELISTED_TRUST_DST; else - *decision_final = decision; + *decision_final = decision; if ( config->priority == decision) return true; @@ -302,7 +302,7 @@ static void snort_reputation(ReputationConfig* config, Packet* p) else if (BLACKLISTED_SRC == decision or BLACKLISTED_DST == decision) { - unsigned blacklist_event = (BLACKLISTED_SRC == decision) ? + unsigned blacklist_event = (BLACKLISTED_SRC == decision) ? REPUTATION_EVENT_BLACKLIST_SRC : REPUTATION_EVENT_BLACKLIST_DST; DetectionEngine::queue_event(GID_REPUTATION, blacklist_event); @@ -321,7 +321,7 @@ static void snort_reputation(ReputationConfig* config, Packet* p) else if (MONITORED_SRC == decision or MONITORED_DST == decision) { - unsigned monitor_event = (MONITORED_SRC == decision) ? + unsigned monitor_event = (MONITORED_SRC == decision) ? REPUTATION_EVENT_MONITOR_SRC : REPUTATION_EVENT_MONITOR_DST; p->packet_flags |= PKT_REP_MONITORED; @@ -331,7 +331,7 @@ static void snort_reputation(ReputationConfig* config, Packet* p) else if (WHITELISTED_TRUST_SRC == decision or WHITELISTED_TRUST_DST == decision) { - unsigned whitelist_event = (WHITELISTED_TRUST_SRC == decision) ? + unsigned whitelist_event = (WHITELISTED_TRUST_SRC == decision) ? REPUTATION_EVENT_WHITELIST_SRC : REPUTATION_EVENT_WHITELIST_DST; DetectionEngine::queue_event(GID_REPUTATION, whitelist_event); diff --git a/src/protocols/packet.h b/src/protocols/packet.h index 67d44926b..54724d0db 100644 --- a/src/protocols/packet.h +++ b/src/protocols/packet.h @@ -79,7 +79,7 @@ class SFDAQInstance; #define PKT_IGNORE 0x00800000 /* this packet should be ignored, based on port */ #define PKT_RETRANSMIT 0x01000000 // packet is a re-transmitted pkt. #define PKT_RETRY 0x02000000 /* this packet is being re-evaluated from the internal retry queue */ -#define PKT_REP_MONITORED 0x04000000 /* this packet is monitored by reputation */ +#define PKT_REP_MONITORED 0x04000000 /* this packet is monitored by reputation */ #define PKT_UNUSED_FLAGS 0xf8000000 #define PKT_TS_OFFLOADED 0x01 @@ -284,7 +284,7 @@ struct SO_PUBLIC Packet bool is_offloaded() const { return (ts_packet_flags & PKT_TS_OFFLOADED) != 0; } - + void set_offloaded() { ts_packet_flags |= PKT_TS_OFFLOADED; } diff --git a/src/stream/ip/ip_session.cc b/src/stream/ip/ip_session.cc index 588afdd11..abe35a574 100644 --- a/src/stream/ip/ip_session.cc +++ b/src/stream/ip/ip_session.cc @@ -106,11 +106,11 @@ static inline void update_session(Packet* p, Flow* lws) lws->ssn_state.session_flags |= SSNFLAG_ESTABLISHED; lws->set_ttl(p, false); - if ( p->type() == PktType::ICMP and p->ptrs.icmph) + if ( p->type() == PktType::ICMP and p->ptrs.icmph) { DataBus::publish(STREAM_ICMP_BIDIRECTIONAL_EVENT, p); - } - else + } + else { DataBus::publish(STREAM_IP_BIDIRECTIONAL_EVENT, p); }