#include <packet_visitor.hpp>
Public Member Functions | |
std::shared_ptr< const T > | operator() (const ChunkPacket &packet) |
std::shared_ptr< const T > | operator() (const CohesivePacket &packet) |
std::shared_ptr< const T > | get_shared_wrapper () const |
void | allow_chunk_deserialization (bool flag) |
void | start_deserialization_at (OsiLayer start) |
Private Member Functions | |
void | deserialize (const byte_view_range &range) |
Private Attributes | |
std::shared_ptr< const T > | m_wrapper |
bool | m_deserialize_chunk = true |
OsiLayer | m_start_layer = OsiLayer::Session |
PacketVisitor is a helper to extract the ASN.1 wrapper object from a packet's application layer. This is a generalised version of the implementation found in Artery before.
ChunkPacket's application layer is simply casted for the sake of speed whenever possible. When casting fails, this helper can fall back to deserialization, see allow_chunk_deserialization. Deserialization is the only option for CohesivePacket's application layer.
Definition at line 29 of file packet_visitor.hpp.
|
inline |
Allow deserialization attempt of ChunkPacket when casting failed.
flag | true allows deserialization |
Definition at line 58 of file packet_visitor.hpp.
|
inlineprivate |
Definition at line 74 of file packet_visitor.hpp.
|
inline |
Definition at line 52 of file packet_visitor.hpp.
|
inline |
Definition at line 32 of file packet_visitor.hpp.
|
inline |
Definition at line 46 of file packet_visitor.hpp.
|
inline |
Set OSI layer where deserialization shall start, it always stops at end of OsiLayer::Application. By default, PacketVisitors starts at OsiLayer::Session for compatibility with BTP parser functions.
start | OSI layer |
Definition at line 68 of file packet_visitor.hpp.
|
private |
Definition at line 82 of file packet_visitor.hpp.
|
private |
Definition at line 83 of file packet_visitor.hpp.
|
private |
Definition at line 81 of file packet_visitor.hpp.