PcapPlusPlus  Next
IPLayer.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "IpAddress.h"
4 #include "Layer.h"
5 
7 
10 namespace pcpp
11 {
17  class IPLayer
18  {
19  protected:
20  IPLayer() = default;
21 
22  public:
25  virtual IPAddress getSrcIPAddress() const = 0;
26 
29  virtual IPAddress getDstIPAddress() const = 0;
30 
32  virtual ~IPLayer() = default;
33 
43  static ProtocolType getIPVersion(uint8_t const* data, size_t dataLen);
44  };
45 } // namespace pcpp
Definition: IpAddress.h:276
Definition: IPLayer.h:18
virtual ~IPLayer()=default
An empty destructor.
virtual IPAddress getDstIPAddress() const =0
virtual IPAddress getSrcIPAddress() const =0
static ProtocolType getIPVersion(uint8_t const *data, size_t dataLen)
Get the IP version of a given packet data.
The main namespace for the PcapPlusPlus lib.
uint8_t ProtocolType
Definition: ProtocolType.h:13