-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathipv4packet.h
44 lines (40 loc) · 1.16 KB
/
ipv4packet.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef IPV4PACKET_H
#define IPV4PACKET_H
#include "pktf.h"
#include "packet.h"
class IPv4Packet : public Packet {
public:
IPv4Packet(Packet *, quint16);
quint8 getVersion();
quint8 getHeaderLen();
quint8 getDiffServices();
quint16 getTotalLen();
quint16 getIden();
quint16 getFlags();
quint16 getFragmentOffset();
quint8 getTtl();
quint8 getProtocol();
quint16 getChecksum();
QString getSrc();
QString getDst();
quint32 * getOptions();
bool hasOptions();
quint32 getPktLen() override;
private:
const quint8 defaultLen = 20; // fixed bytes
quint8 version;
quint8 hdrlen;
quint8 diffServices;
quint16 totalLen;
quint16 iden;
quint16 flags;
quint16 fragmentOffset;
quint8 ttl;
quint8 protocol;
quint16 checksum;
quint8 *src;
quint8 *dst;
quint32 *options = nullptr;
quint32 pktlen;
};
#endif // IPV4PACKET_H