]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #1773 in SNORT/snort3 from ~MMATIRKO/snort3:lua_whitespace_fix...
authorMike Stepanek (mstepane) <mstepane@cisco.com>
Mon, 30 Sep 2019 19:40:49 +0000 (15:40 -0400)
committerMike Stepanek (mstepane) <mstepane@cisco.com>
Mon, 30 Sep 2019 19:40:49 +0000 (15:40 -0400)
Squashed commit of the following:

commit 5ac2c1b82fda46a734a1de9db83fad8576a4d1d2
Author: Michael Matirko <mmatirko@cisco.com>
Date:   Mon Sep 30 11:41:06 2019 -0400

    lua: fixed whitespace to match style guidelines

src/framework/data_bus.h
src/lua/lua.cc
src/lua/lua.h
src/network_inspectors/reputation/reputation_config.h
src/network_inspectors/reputation/reputation_inspect.cc
src/protocols/packet.h
src/stream/ip/ip_session.cc

index dbf5607c2b78f67687d17bf71e30968ccee1bef2..8f294703f35b69ed77c044dfaabac092ce2b22b0 100644 (file)
@@ -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"
index 99ad85cfb45be47c5529d8bd675ad22b16c4cc6c..cbc8739589b87207951930a178cae83910506d96 100644 (file)
@@ -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()
index f830fe466db79e33591ed78f78f512d58b6abf3f..a1d3d3eee084774fc8801101f715e8b1a7c1e08a 100644 (file)
@@ -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; }
index 29726fa9b30614ea660431a3e674a149eb61b246..e8323b6b114acc02f4f0edac55babcc73eb0ede4 100644 (file)
@@ -36,7 +36,7 @@ enum NestedIP
 {
     INNER,
     OUTER,
-    ALL 
+    ALL
 };
 
 enum WhiteAction
index cbc198f0504ec7e6f378d6094aff1ca86a934b68..d332976910de5c3cb9b426e75b98819e2134adc2 100644 (file)
@@ -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);
index 67d44926bf98c67435538d6db43c435219d433fc..54724d0dbce99075b3c942719f45d99ae648e305 100644 (file)
@@ -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; }
 
index 588afdd11b7aba95f0df4a910a229d6beda19d86..abe35a574d78ad37d94fed3284a72b28d4445ae0 100644 (file)
@@ -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);
             }