PcapPlusPlus
pcpp::IPv6Layer Class Reference

#include <IPv6Layer.h>

Inheritance diagram for pcpp::IPv6Layer:
pcpp::Layer

Public Member Functions

 IPv6Layer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
 IPv6Layer ()
 
 IPv6Layer (const IPv6Address &srcIP, const IPv6Address &dstIP)
 
ip6_hdrgetIPv6Header ()
 
IPv6Address getSrcIpAddress ()
 
IPv6Address getDstIpAddress ()
 
void parseNextLayer ()
 
size_t getHeaderLen ()
 
void computeCalculateFields ()
 
std::string toString ()
 
OsiModelLayer getOsiModelLayer ()
 
- Public Member Functions inherited from pcpp::Layer
virtual ~Layer ()
 
LayergetNextLayer ()
 
LayergetPrevLayer ()
 
ProtocolType getProtocol ()
 
uint8_t * getData ()
 
size_t getDataLen ()
 
uint8_t * getLayerPayload ()
 
size_t getLayerPayloadSize ()
 
bool isAllocatedToPacket ()
 
void copyData (uint8_t *toArr)
 

Detailed Description

Represents an IPv6 protocol layer

Constructor & Destructor Documentation

pcpp::IPv6Layer::IPv6Layer ( uint8_t *  data,
size_t  dataLen,
Layer prevLayer,
Packet packet 
)
inline

A constructor that creates the layer from an existing packet raw data

Parameters
[in]dataA pointer to the raw data (will be casted to ip6_hdr)
[in]dataLenSize of the data in bytes
[in]prevLayerA pointer to the previous layer
[in]packetA pointer to the Packet instance where layer will be stored in
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

Parameters
[in]srcIPSource IPv6 address
[in]dstIPDestination IPv6 address

Member Function Documentation

void pcpp::IPv6Layer::computeCalculateFields ( )
virtual

Calculate the following fields:

Implements pcpp::Layer.

IPv6Address pcpp::IPv6Layer::getDstIpAddress ( )
inline

Get the destination IP address in the form of IPv6Address

Returns
An IPv6Address containing the destination address
size_t pcpp::IPv6Layer::getHeaderLen ( )
inlinevirtual
Returns
Size of ip6_hdr

Implements pcpp::Layer.

ip6_hdr* pcpp::IPv6Layer::getIPv6Header ( )
inline

Get a pointer to the IPv6 header. Notice this points directly to the data, so every change will change the actual packet data

Returns
A pointer to the ip6_hdr
OsiModelLayer pcpp::IPv6Layer::getOsiModelLayer ( )
inlinevirtual
Returns
The OSI Model layer this protocol belongs to

Implements pcpp::Layer.

IPv6Address pcpp::IPv6Layer::getSrcIpAddress ( )
inline

Get the source IP address in the form of IPv6Address

Returns
An IPv6Address containing the source address
void pcpp::IPv6Layer::parseNextLayer ( )
virtual

Currently identifies the following next layers: UdpLayer, TcpLayer. Otherwise sets PayloadLayer

Implements pcpp::Layer.

std::string pcpp::IPv6Layer::toString ( )
virtual
Returns
A string representation of the layer most important data (should look like the layer description in Wireshark)

Implements pcpp::Layer.