EHS
Loading...
Searching...
No Matches
ICMP_LNX.h
Go to the documentation of this file.
1#pragma once
2
3#include "BaseICMP.h"
4
5#include <netinet/in.h>
6
7namespace ehs
8{
10 {
11 sockaddr_in6 src;
12 sockaddr_in6 dst;
14 };
15
16 class ICMP final : public BaseICMP
17 {
18 private:
19 Int_32 hdl;
20 sockaddr_in6 src;
21
22 public:
23 ~ICMP() override;
24
25 ICMP();
26
27 ICMP(IP version);
28
29 ICMP(ICMP &&icmp) noexcept;
30
31 ICMP(const ICMP &icmp);
32
33 ICMP &operator=(ICMP &&icmp) noexcept;
34
35 ICMP &operator=(const ICMP &icmp);
36
37 void Release() override;
38
39 void SetReceiveTimeout(UInt_64 timeout) override;
40
41 bool IsValid() const override;
42
43 private:
44 static bool IsLinkLocal(const in6_addr &addr);
45
46 static sockaddr_in6 RetrieveSrcAddress();
47
48 static UInt_32 CalculatePseudoHeaderChecksum(const PseudoICMPv6_Header &header);
49
50 UInt_16 ComputeChecksumV6(UInt_16* buffer, Size length, const sockaddr_in6& dst);
51
52 UInt_64 SendV6(const Str_8 &address, ICMP_Header header, const Byte *data, UInt_64 size) override;
53
54 UInt_64 SendV4(const Str_8 &address, ICMP_Header header, const Byte *data, UInt_64 size) override;
55
56 UInt_64 ReceiveV6(Str_8 &address, ICMP_Header &header, Serializer<UInt_64> &data) const override;
57
58 UInt_64 ReceiveV4(Str_8 &address, ICMP_Header &header, Serializer<UInt_64> &data) const override;
59 };
60}
BaseICMP()
Definition BaseICMP.cpp:8
ICMP()
Definition ICMP_LNX.cpp:19
ICMP & operator=(ICMP &&icmp) noexcept
Definition ICMP_LNX.cpp:53
void Release() override
Definition ICMP_LNX.cpp:82
void SetReceiveTimeout(UInt_64 timeout) override
Definition ICMP_LNX.cpp:96
~ICMP() override
Definition ICMP_LNX.cpp:13
bool IsValid() const override
Definition ICMP_LNX.cpp:112
Definition Serializer.h:25
Definition Anchor.h:6
unsigned int UInt_32
Definition Types.h:49
int Int_32
Definition Types.h:51
IP
Definition Socket.h:29
Str< Char_8, UInt_64 > Str_8
Definition Str.h:1902
unsigned char Byte
Definition Types.h:39
unsigned short UInt_16
Definition Types.h:46
Definition BaseICMP.h:10
Definition ICMP_LNX.h:10
sockaddr_in6 src
Definition ICMP_LNX.h:11
UInt_32 length
Definition ICMP_LNX.h:13
sockaddr_in6 dst
Definition ICMP_LNX.h:12