File tree Expand file tree Collapse file tree 4 files changed +13
-4
lines changed
include/ipfixprobe/processPlugin
src/plugins/storage/cache/src Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 33#include < cstdint>
44
55#include " ipAddress.hpp"
6+ #include " xxhash.h"
67
78namespace ipxp {
89
@@ -29,7 +30,7 @@ struct FlowKey {
2930 constexpr inline
3031 std::size_t hash () const noexcept
3132 {
32- return 0 ; // XXH3_64bits(this, sizeof(*this), 0 );
33+ return XXH3_64bits (this , sizeof (*this ));
3334 }
3435};
3536
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ namespace ipxp {
2525 */
2626class FlowRecord ;
2727class Packet ;
28- class PacketFeatures ;
28+ class PacketFeatures {} ;
2929
3030/* *
3131 * @brief Context passed to plugin methods, containing references to flow and packet.
Original file line number Diff line number Diff line change 55#include " processPlugin.hpp"
66#include " processPluginEntry.hpp"
77#include " flowRecordBuilder.hpp"
8+ #include " flowKey.hpp"
89#include " ../pluginFactory/pluginFactory.hpp"
910#include " ../api.hpp"
1011
@@ -192,7 +193,7 @@ class IPXP_API ProcessPluginManager {
192193
193194 std::shared_ptr<FlowRecordBuilder> rebuild ()
194195 {
195- auto builder = std::make_shared<FlowRecordBuilder>(m_processPlugins, FlowKey::DEFAULT_LAYOUT );
196+ auto builder = std::make_shared<FlowRecordBuilder>(m_processPlugins, FlowKey::getLayout () );
196197 return builder;
197198 }
198199
Original file line number Diff line number Diff line change @@ -171,8 +171,8 @@ void NHTFlowCache::export_flow(size_t index)
171171 m_flow_table[index]->directionalData [Direction::Forward].packets + m_flow_table[index]->directionalData [Direction::Reverse].packets );
172172 m_flows_in_cache--;
173173
174- ipx_ring_push (m_export_queue, m_flow_table[index].get ());
175174 std::swap (m_flow_table[index], m_flow_table[m_cache_size + m_qidx]);
175+ ipx_ring_push (m_export_queue, &m_flow_table[m_cache_size + m_qidx]);
176176 m_flow_table[index]->erase ();
177177 m_qidx = (m_qidx + 1 ) % m_qsize;
178178}
@@ -338,9 +338,16 @@ int NHTFlowCache::put_pkt(Packet& pkt)
338338 return 0 ;
339339 }
340340
341+ auto features = PacketFeatures{};
342+ auto context = FlowContext {
343+ .flowRecord = *flow,
344+ .packet = pkt,
345+ .features = features
346+ };
341347 if (flow->isEmpty ()) {
342348 m_flows_in_cache++;
343349 flow->createFrom (pkt, hashval);
350+ m_manager.processFlowRecord (context);
344351 ret = 0 ; // plugins_post_create(flow->m_flow, pkt);
345352
346353 // if (ret & FLOW_FLUSH) {
You can’t perform that action at this time.
0 commit comments