PcapPlusPlus
22.05
|
#include <IPv6Extensions.h>
Classes | |
struct | ipv6_routing_header |
Public Member Functions | |
IPv6RoutingHeader (uint8_t routingType, uint8_t segmentsLeft, const uint8_t *additionalRoutingData, size_t additionalRoutingDataLen) | |
ipv6_routing_header * | getRoutingHeader () const |
uint8_t * | getRoutingAdditionalData () const |
size_t | getRoutingAdditionalDataLength () const |
IPv6Address | getRoutingAdditionalDataAsIPv6Address (size_t offset=0) const |
Public Member Functions inherited from pcpp::IPv6Extension | |
virtual size_t | getExtensionLen () const |
IPv6ExtensionType | getExtensionType () const |
virtual | ~IPv6Extension () |
IPv6Extension * | getNextHeader () const |
Additional Inherited Members | |
Public Types inherited from pcpp::IPv6Extension | |
enum | IPv6ExtensionType { IPv6HopByHop = 0, IPv6Routing = 43, IPv6Fragmentation = 44, IPv6AuthenticationHdr = 51, IPv6Destination = 60, IPv6ExtensionUnknown = 255 } |
Represents IPv6 routing extension header and allows easy access to all of its data
pcpp::IPv6RoutingHeader::IPv6RoutingHeader | ( | uint8_t | routingType, |
uint8_t | segmentsLeft, | ||
const uint8_t * | additionalRoutingData, | ||
size_t | additionalRoutingDataLen | ||
) |
A c'tor for creating a new IPv6 routing extension object not bounded to a packet. Useful for adding new extensions to an IPv6 layer with IPv6Layer::addExtension()
[in] | routingType | Routing type value (will be written to ipv6_routing_header::routingType field) |
[in] | segmentsLeft | Segments left value (will be written to ipv6_routing_header::segmentsLeft field) |
[in] | additionalRoutingData | A pointer to a buffer containing the additional routing data for this extension. Notice this buffer is read-only and its content isn't modified |
[in] | additionalRoutingDataLen | The length of the additional routing data buffer |
uint8_t* pcpp::IPv6RoutingHeader::getRoutingAdditionalData | ( | ) | const |
IPv6Address pcpp::IPv6RoutingHeader::getRoutingAdditionalDataAsIPv6Address | ( | size_t | offset = 0 | ) | const |
In many cases the additional routing data is actually IPv6 address(es). This method converts the raw buffer data into an IPv6 address
[in] | offset | An offset in the additional routing buffer pointing to where the IPv6 address begins. In some cases there are multiple IPv6 addresses in the additional routing data buffer so this offset points to where the request IPv6 address begins. Also, even if there is only one IPv6 address in this buffer, sometimes it isn't written in the beginning of the buffer, so the offset points to where the IPv6 address begins. This is an optional parameter and the default offset is 0 |
size_t pcpp::IPv6RoutingHeader::getRoutingAdditionalDataLength | ( | ) | const |
|
inline |
Get a pointer to the fixed part of the routing header. Notice the return pointer points directly to the data, so every change will modify the actual packet data