PcapPlusPlus
|
#include <IPv6Layer.h>
Public Member Functions | |
IPv6Layer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
IPv6Layer () | |
IPv6Layer (const IPv6Address &srcIP, const IPv6Address &dstIP) | |
IPv6Layer (const IPv6Layer &other) | |
~IPv6Layer () | |
IPv6Layer & | operator= (const IPv6Layer &other) |
ip6_hdr * | getIPv6Header () |
IPv6Address | getSrcIpAddress () |
IPv6Address | getDstIpAddress () |
size_t | getExtensionCount () |
template<class TIPv6Extension > | |
TIPv6Extension * | getExtensionOfType () |
template<class TIPv6Extension > | |
TIPv6Extension * | addExtension (const TIPv6Extension &extensionHeader) |
void | removeAllExtensions () |
bool | isFragment () |
void | parseNextLayer () |
size_t | getHeaderLen () |
void | computeCalculateFields () |
std::string | toString () |
OsiModelLayer | getOsiModelLayer () |
Public Member Functions inherited from pcpp::Layer | |
virtual | ~Layer () |
Layer * | getNextLayer () |
Layer * | getPrevLayer () |
ProtocolType | getProtocol () |
uint8_t * | getData () |
size_t | getDataLen () |
uint8_t * | getLayerPayload () |
size_t | getLayerPayloadSize () |
bool | isAllocatedToPacket () |
void | copyData (uint8_t *toArr) |
uint8_t * | getDataPtr (size_t offset=0) |
Represents an IPv6 protocol layer
pcpp::IPv6Layer::IPv6Layer | ( | ) |
A constructor that allocates a new IPv6 header with empty fields
pcpp::IPv6Layer::IPv6Layer | ( | const IPv6Address & | srcIP, |
const IPv6Address & | dstIP | ||
) |
A constructor that allocates a new IPv6 header with source and destination IPv6 addresses
[in] | srcIP | Source IPv6 address |
[in] | dstIP | Destination IPv6 address |
pcpp::IPv6Layer::IPv6Layer | ( | const IPv6Layer & | other | ) |
A copy constructor that copies the entire header from the other IPv6Layer (including IPv6 extensions)
pcpp::IPv6Layer::~IPv6Layer | ( | ) |
A destrcutor for this layer
TIPv6Extension * pcpp::IPv6Layer::addExtension | ( | const TIPv6Extension & | extensionHeader | ) |
Add a new extension of type TIPv6Extension to the layer. This is a templated method and TIPv6Extension has to be one of the supported IPv6 extensions, meaning a class that inherits IPv6Extension. If the extension is added successfully a pointer to the newly added extension object is returned, otherwise NULL is returned
[in] | extensionHeader | The extension object to add. Notice the object passed here is read-only, meaning its data is copied but the object itself isn't modified |
|
virtual |
Calculate the following fields:
Implements pcpp::Layer.
|
inline |
Get the destination IP address in the form of IPv6Address
size_t pcpp::IPv6Layer::getExtensionCount | ( | ) |
TIPv6Extension * pcpp::IPv6Layer::getExtensionOfType | ( | ) |
A templated getter for an IPv6 extension of a type TIPv6Extension. TIPv6Extension has to be one of the supported IPv6 extensions, meaning a class that inherits IPv6Extension. If the requested extension type isn't found NULL is returned
|
inlinevirtual |
Implements pcpp::Layer.
|
inline |
Get a pointer to the IPv6 header. Notice this points directly to the data, so every change will change the actual packet data
|
inlinevirtual |
Implements pcpp::Layer.
|
inline |
Get the source IP address in the form of IPv6Address
bool pcpp::IPv6Layer::isFragment | ( | ) |
An assignment operator that first delete all data from current layer and then copy the entire header from the other IPv6Layer (including IPv6 extensions)
|
virtual |
Currently identifies the following next layers: UdpLayer, TcpLayer. Otherwise sets PayloadLayer
Implements pcpp::Layer.
void pcpp::IPv6Layer::removeAllExtensions | ( | ) |
Remove all IPv6 extensions in this layer
|
virtual |
Implements pcpp::Layer.