Skip to content

Commit 8fc61c7

Browse files
author
Damir Zainullin
committed
++
1 parent 4ad590b commit 8fc61c7

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

include/ipfixprobe/ipfix-elements.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,7 @@ namespace ipxp {
463463
F(MQTT_PUBLISH_FLAGS) \
464464
F(MQTT_TOPICS)
465465

466-
#define IPFIX_TCP_RTT_TEMPLATE(F) \
467-
F(TCP_RTT) \
466+
#define IPFIX_TCP_RTT_TEMPLATE(F) F(TCP_RTT)
468467

469468
#define IPFIX_PSTATS_TEMPLATE(F) \
470469
F(STATS_PCKT_SIZES) \

src/plugins/process/tcpRtt/src/tcpRtt.cpp

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@ RecordExtTCPRTT* TCPRTTPlugin::get_ext() const
4848
return new RecordExtTCPRTT(m_pluginID);
4949
}
5050

51-
void TCPRTTPlugin::init([[maybe_unused]]const char* params)
52-
{
53-
}
51+
void TCPRTTPlugin::init([[maybe_unused]] const char* params) {}
5452

5553
TCPRTTPlugin::TCPRTTPlugin(const TCPRTTPlugin& other) noexcept
56-
: ProcessPlugin(other.m_pluginID)
54+
: ProcessPlugin(other.m_pluginID)
5755
{
5856
}
5957

@@ -64,45 +62,46 @@ ProcessPlugin* TCPRTTPlugin::copy()
6462

6563
int TCPRTTPlugin::post_create(Flow& rec, const Packet& pkt)
6664
{
67-
if (m_prealloced_extension == nullptr) {
65+
if (m_prealloced_extension == nullptr) {
6866
m_prealloced_extension.reset(get_ext());
6967
}
7068

71-
if (pkt.ip_proto == IPPROTO_TCP) {
69+
if (pkt.ip_proto == IPPROTO_TCP) {
7270
rec.add_extension(m_prealloced_extension.release());
73-
}
71+
}
7472

75-
update_tcp_rtt_record(rec, pkt);
73+
update_tcp_rtt_record(rec, pkt);
7674
return 0;
7775
}
7876

7977
int TCPRTTPlugin::pre_update(Flow& rec, Packet& pkt)
8078
{
81-
update_tcp_rtt_record(rec, pkt);
79+
update_tcp_rtt_record(rec, pkt);
8280
return 0;
8381
}
8482

8583
constexpr static inline bool is_tcp_syn(uint8_t tcp_flags) noexcept
8684
{
87-
return tcp_flags & 0b10;
85+
return tcp_flags & 0b10;
8886
}
8987

9088
constexpr static inline bool is_tcp_syn_ack(uint8_t tcp_flags) noexcept
9189
{
92-
return (tcp_flags & 0b10) && (tcp_flags & 0b10000);
90+
return (tcp_flags & 0b10) && (tcp_flags & 0b10000);
9391
}
9492

9593
void TCPRTTPlugin::update_tcp_rtt_record(Flow& rec, const Packet& pkt) noexcept
9694
{
9795
auto* extension = static_cast<RecordExtTCPRTT*>(rec.get_extension(m_pluginID));
9896

9997
if (extension != nullptr && is_tcp_syn_ack(pkt.tcp_flags)) {
100-
extension->tcp_synack_timestamp = pkt.ts;
98+
extension->tcp_synack_timestamp = pkt.ts;
10199
} else if (extension != nullptr && is_tcp_syn(pkt.tcp_flags)) {
102-
extension->tcp_syn_timestamp = pkt.ts;
103-
}
100+
extension->tcp_syn_timestamp = pkt.ts;
101+
}
104102
}
105103

106-
static const PluginRegistrar<TCPRTTPlugin, ProcessPluginFactory> tcpRttRegistrar(tcpRttPluginManifest);
104+
static const PluginRegistrar<TCPRTTPlugin, ProcessPluginFactory>
105+
tcpRttRegistrar(tcpRttPluginManifest);
107106

108-
}
107+
} // namespace ipxp

0 commit comments

Comments
 (0)