PcapPlusPlus
21.05
|
#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 () const |
IPAddress | getSrcIPAddress () const |
IPv6Address | getSrcIpAddress () const |
IPv6Address | getSrcIPv6Address () const |
IPAddress | getDstIPAddress () const |
IPv6Address | getDstIpAddress () const |
IPv6Address | getDstIPv6Address () const |
size_t | getExtensionCount () const |
template<class TIPv6Extension > | |
TIPv6Extension * | getExtensionOfType () const |
template<class TIPv6Extension > | |
TIPv6Extension * | addExtension (const TIPv6Extension &extensionHeader) |
void | removeAllExtensions () |
bool | isFragment () const |
void | parseNextLayer () |
size_t | getHeaderLen () const |
void | computeCalculateFields () |
std::string | toString () const |
OsiModelLayer | getOsiModelLayer () const |
Public Member Functions inherited from pcpp::Layer | |
virtual | ~Layer () |
Layer * | getNextLayer () const |
Layer * | getPrevLayer () const |
ProtocolType | getProtocol () const |
uint8_t * | getData () const |
size_t | getDataLen () const |
uint8_t * | getLayerPayload () const |
size_t | getLayerPayloadSize () const |
bool | isAllocatedToPacket () const |
void | copyData (uint8_t *toArr) const |
uint8_t * | getDataPtr (size_t offset=0) const |
Static Public Member Functions | |
static bool | isDataValid (const uint8_t *data, size_t dataLen) |
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.
|
inlinevirtual |
Get the destination IP address in the form of IPAddress. This method is very similar to getDstIPv6Address(), but adds a level of abstraction because IPAddress can be used for both IPv4 and IPv6 addresses
Implements pcpp::IPLayer.
|
inline |
|
inline |
Get the destination IP address in the form of IPv6Address
size_t pcpp::IPv6Layer::getExtensionCount | ( | ) | const |
TIPv6Extension * pcpp::IPv6Layer::getExtensionOfType | ( | ) | const |
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.
|
inlinevirtual |
Get the source IP address in the form of IPAddress. This method is very similar to getSrcIPv6Address(), but adds a level of abstraction because IPAddress can be used for both IPv4 and IPv6 addresses
Implements pcpp::IPLayer.
|
inline |
|
inline |
Get the source IP address in the form of IPv6Address
|
inlinestatic |
The static method makes validation of input data
[in] | data | The pointer to the beginning of byte stream of IP packet |
[in] | dataLen | The length of byte stream |
bool pcpp::IPv6Layer::isFragment | ( | ) | const |
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:
Otherwise sets PayloadLayer
Implements pcpp::Layer.
void pcpp::IPv6Layer::removeAllExtensions | ( | ) |
Remove all IPv6 extensions in this layer
|
virtual |
Implements pcpp::Layer.