PcapPlusPlus  21.11
PacketUtils.h
Go to the documentation of this file.
1 #ifndef PACKETPP_PACKET_UTILS
2 #define PACKETPP_PACKET_UTILS
3 
4 #include "Packet.h"
5 
7 
12 namespace pcpp
13 {
17  template<typename T>
18  struct ScalarBuffer
19  {
23  T* buffer;
24 
28  size_t len;
29  };
30 
37  uint16_t computeChecksum(ScalarBuffer<uint16_t> vec[], size_t vecSize);
38 
46  uint32_t fnvHash(ScalarBuffer<uint8_t> vec[], size_t vecSize);
47 
54  uint32_t fnvHash(uint8_t* buffer, size_t bufSize);
55 
64  uint32_t hash5Tuple(Packet* packet, bool const& directionUnique = false);
65 
72  uint32_t hash2Tuple(Packet* packet);
73 
74 } // namespace pcpp
75 
76 #endif /* PACKETPP_PACKET_UTILS */
The main namespace for the PcapPlusPlus lib.
Definition: Packet.h:26
size_t len
Definition: PacketUtils.h:28
uint32_t fnvHash(ScalarBuffer< uint8_t > vec[], size_t vecSize)
Definition: PacketUtils.h:18
T * buffer
Definition: PacketUtils.h:23
uint32_t hash2Tuple(Packet *packet)
uint16_t computeChecksum(ScalarBuffer< uint16_t > vec[], size_t vecSize)
uint32_t hash5Tuple(Packet *packet, bool const &directionUnique=false)