]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #2142 in SNORT/snort3 from ~ANTOROZC/snort3:expose_packet_gettimeo...
authorMichael Altizer (mialtize) <mialtize@cisco.com>
Thu, 9 Apr 2020 14:35:52 +0000 (14:35 +0000)
committerMichael Altizer (mialtize) <mialtize@cisco.com>
Thu, 9 Apr 2020 14:35:52 +0000 (14:35 +0000)
Squashed commit of the following:

commit 72ab3f58822fcf6c56fdb46fa9a121cf4dfc6e94
Author: Brian Morris <bmorris2@cisco.com>
Date:   Wed Apr 8 14:43:39 2020 -0500

    time: make packet_gettimeofday public

src/flow/test/ha_test.cc
src/time/packet_time.cc
src/time/packet_time.h

index f49e971ae7fc0a3de18f35c31eed9a9454b20a02..da76fc1bdc9cb6f8064e745519c506560ac7a602 100644 (file)
@@ -205,15 +205,15 @@ namespace snort
 {
 void ErrorMessage(const char*,...) { }
 void LogMessage(const char*,...) { }
+
+void packet_gettimeofday(struct timeval* tv)
+{ *tv = s_packet_time; }
 }
 
 bool FlowKey::is_equal(const void*, const void*, size_t) { return false; }
 
 int SFDAQInstance::ioctl(DAQ_IoctlCmd, void*, size_t) { return DAQ_SUCCESS; }
 
-void packet_gettimeofday(struct timeval* tv)
-{ *tv = s_packet_time; }
-
 Flow::Flow() { ha_state = new FlowHAState; key = new FlowKey; }
 Flow::~Flow() { delete key; delete ha_state; }
 
index 7b54439781145932ed50933606155aa40cacf058..579b7d9b2655042ad8a70e5701661bb079779251 100644 (file)
@@ -43,6 +43,11 @@ static THREAD_LOCAL uint32_t s_first_packet = 0;
 
 namespace snort
 {
+void packet_gettimeofday(struct timeval* tv)
+{
+    *tv = s_recent_packet;
+}
+
 time_t packet_time()
 {
     return s_recent_packet.tv_sec;
@@ -78,8 +83,3 @@ uint32_t packet_first_time()
     return s_first_packet;
 }
 
-void packet_gettimeofday(struct timeval* tv)
-{
-    *tv = s_recent_packet;
-}
-
index 50e28dbb09d09981f6dbd8c6a5b78720f187e033..81aada6bff3258d67d0c459d5a02bb086214f281 100644 (file)
 
 namespace snort
 {
+SO_PUBLIC void packet_gettimeofday(struct timeval* tv);
 SO_PUBLIC time_t packet_time();
 SO_PUBLIC int64_t timersub_ms(const struct timeval* end, const struct timeval* start);
 }
 
 void packet_time_update(const struct timeval* cur_tv);
 uint32_t packet_first_time();
-void packet_gettimeofday(struct timeval* tv);
 
 #endif