Use raw pointer for packet analyzer history

This commit is contained in:
Jan Grashoefer 2024-08-12 16:08:18 +02:00
parent b4e83aca8c
commit c73fcdec3d
2 changed files with 4 additions and 4 deletions

View file

@ -114,7 +114,7 @@ bool Analyzer::ForwardPacket(size_t len, const uint8_t* data, Packet* packet, ui
DBG_LOG(DBG_PACKET_ANALYSIS, "Analysis in %s succeeded, next layer identifier is %#x.", GetAnalyzerName(), DBG_LOG(DBG_PACKET_ANALYSIS, "Analysis in %s succeeded, next layer identifier is %#x.", GetAnalyzerName(),
identifier); identifier);
packet_mgr->TrackAnalyzer(inner_analyzer); packet_mgr->TrackAnalyzer(inner_analyzer.get());
return inner_analyzer->AnalyzePacket(len, data, packet); return inner_analyzer->AnalyzePacket(len, data, packet);
} }
@ -130,7 +130,7 @@ bool Analyzer::ForwardPacket(size_t len, const uint8_t* data, Packet* packet) co
return false; return false;
} }
packet_mgr->TrackAnalyzer(inner_analyzer); packet_mgr->TrackAnalyzer(inner_analyzer.get());
return inner_analyzer->AnalyzePacket(len, data, packet); return inner_analyzer->AnalyzePacket(len, data, packet);
} }

View file

@ -181,7 +181,7 @@ public:
* The packet analyzer history is implemented in form of a stack, which is reset on a * The packet analyzer history is implemented in form of a stack, which is reset on a
* call to ProcessPacket() but maintained throughout calls to ProcessInnerPacket(). * call to ProcessPacket() but maintained throughout calls to ProcessInnerPacket().
*/ */
void TrackAnalyzer(AnalyzerPtr analyzer) { analyzer_stack.push_back(std::move(analyzer)); } void TrackAnalyzer(Analyzer* analyzer) { analyzer_stack.push_back(analyzer); }
private: private:
/** /**
@ -232,7 +232,7 @@ private:
uint64_t total_not_processed = 0; uint64_t total_not_processed = 0;
iosource::PktDumper* unprocessed_dumper = nullptr; iosource::PktDumper* unprocessed_dumper = nullptr;
std::vector<AnalyzerPtr> analyzer_stack; std::vector<Analyzer*> analyzer_stack;
}; };
} // namespace packet_analysis } // namespace packet_analysis