Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Packet++/header/Packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ namespace pcpp
explicit Packet(RawPacket* rawPacket, bool freeRawPacket = false, ProtocolType parseUntil = UnknownProtocol,
OsiModelLayer parseUntilLayer = OsiModelLayerUnknown);

/// @copydoc Packet(RawPacket*, bool, ProtocolType, OsiModelLayer)
explicit Packet(RawPacket* rawPacket, bool freeRawPacket, ProtocolTypeFamily parseUntil,
OsiModelLayer parseUntilLayer = OsiModelLayerUnknown);

/// A constructor for creating a packet out of already allocated RawPacket. Very useful when parsing packets
/// that came from the network. When using this constructor a pointer to the RawPacket is saved (data isn't
/// copied) and the RawPacket is parsed, meaning all layers are created and linked to each other in the right
Expand Down
5 changes: 5 additions & 0 deletions Packet++/src/Packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ namespace pcpp
}

Packet::Packet(RawPacket* rawPacket, bool freeRawPacket, ProtocolType parseUntil, OsiModelLayer parseUntilLayer)
: Packet(rawPacket, freeRawPacket, static_cast<ProtocolTypeFamily>(parseUntil), parseUntilLayer)
{}

Packet::Packet(RawPacket* rawPacket, bool freeRawPacket, ProtocolTypeFamily parseUntil,
OsiModelLayer parseUntilLayer)
{
m_FreeRawPacket = false;
m_RawPacket = nullptr;
Expand Down
Loading