PcapPlusPlus  Next
PacketUtils.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Packet.h"
4 #include "IpAddress.h"
5 
7 
12 namespace pcpp
13 {
17  template <typename T> struct ScalarBuffer
18  {
22  T* buffer;
23 
27  size_t len;
28  };
29 
36  uint16_t computeChecksum(ScalarBuffer<uint16_t> vec[], size_t vecSize);
37 
48  uint16_t computePseudoHdrChecksum(uint8_t* dataPtr, size_t dataLen, IPAddress::AddressType ipAddrType,
49  uint8_t protocolType, IPAddress srcIPAddress, IPAddress dstIPAddress);
50 
58  uint32_t fnvHash(ScalarBuffer<uint8_t> vec[], size_t vecSize);
59 
66  uint32_t fnvHash(uint8_t* buffer, size_t bufSize);
67 
76  uint32_t hash5Tuple(Packet* packet, bool const& directionUnique = false);
77 
84  uint32_t hash2Tuple(Packet* packet);
85 
86 } // namespace pcpp
Definition: IpAddress.h:358
AddressType
Definition: IpAddress.h:364
Definition: Packet.h:27
The main namespace for the PcapPlusPlus lib.
uint32_t hash2Tuple(Packet *packet)
uint32_t hash5Tuple(Packet *packet, bool const &directionUnique=false)
uint16_t computePseudoHdrChecksum(uint8_t *dataPtr, size_t dataLen, IPAddress::AddressType ipAddrType, uint8_t protocolType, IPAddress srcIPAddress, IPAddress dstIPAddress)
uint16_t computeChecksum(ScalarBuffer< uint16_t > vec[], size_t vecSize)
uint32_t fnvHash(ScalarBuffer< uint8_t > vec[], size_t vecSize)
Definition: PacketUtils.h:18
T * buffer
Definition: PacketUtils.h:22
size_t len
Definition: PacketUtils.h:27