EHS
Loading...
Searching...
No Matches
BaseICMP.h
Go to the documentation of this file.
1#pragma once
2
3#include "ehs/Serializer.h"
4#include "ehs/Types.h"
6
7namespace ehs
8{
15
21
23 {
24 private:
25 IP version;
26
27 public:
28 BaseICMP();
29
30 BaseICMP(IP version);
31
32 BaseICMP(BaseICMP &&icmp) noexcept;
33
34 BaseICMP(const BaseICMP &icmp);
35
36 BaseICMP &operator=(BaseICMP &&icmp) noexcept;
37
38 BaseICMP &operator=(const BaseICMP &icmp);
39
40 virtual UInt_64 Send(const Str_8 &address, ICMP_Header header, const Byte *data, UInt_64 size);
41
42 virtual UInt_64 Receive(Str_8 &address, ICMP_Header header, Serializer<UInt_64> &data);
43
44 void SendEchoRequest(const Str_8 &address, ICMP_EchoRequest er, const Byte *data, UInt_64 size);
45
46 virtual void SetReceiveTimeout(UInt_64 timeout);
47
48 virtual bool IsValid() const;
49
50 protected:
51 static UInt_16 ComputeChecksum(UInt_16 *buffer, Size length);
52 };
53}
virtual void SetReceiveTimeout(UInt_64 timeout)
Definition BaseICMP.cpp:84
BaseICMP()
Definition BaseICMP.cpp:8
virtual bool IsValid() const
Definition BaseICMP.cpp:88
BaseICMP & operator=(BaseICMP &&icmp) noexcept
Definition BaseICMP.cpp:28
virtual UInt_64 Send(const Str_8 &address, ICMP_Header header, const Byte *data, UInt_64 size)
Definition BaseICMP.cpp:48
static UInt_16 ComputeChecksum(UInt_16 *buffer, Size length)
Definition BaseICMP.cpp:93
virtual UInt_64 Receive(Str_8 &address, ICMP_Header header, Serializer< UInt_64 > &data)
Definition BaseICMP.cpp:53
void SendEchoRequest(const Str_8 &address, ICMP_EchoRequest er, const Byte *data, UInt_64 size)
Definition BaseICMP.cpp:58
Definition Serializer.h:25
Definition Anchor.h:6
IP
Definition Socket.h:29
unsigned char UInt_8
Definition Types.h:43
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:17
UInt_16 id
Definition BaseICMP.h:18
UInt_16 sequence
Definition BaseICMP.h:19
Definition BaseICMP.h:10
UInt_16 checksum
Definition BaseICMP.h:13
UInt_8 code
Definition BaseICMP.h:12
UInt_8 type
Definition BaseICMP.h:11