EHS
NetUtils.h
Go to the documentation of this file.
1#pragma once
2
3#include "ehs/Serializer.h"
4
5namespace ehs
6{
7 enum class NetStatus : UInt_8
8 {
10 ACTIVE,
11 PENDING,
12 QUEUED
13 };
14
16 {
17 SERVER,
18 CLIENT
19 };
20
21 struct Header
22 {
24 UInt_64 encId = 0;
26 UInt_64 channelId = 0;
29 UInt_64 id = 0;
30 UInt_64 fragmentCount = 0;
31 UInt_64 fragment = 0;
32 bool ensure = false;
33 Char_8 token[64] = {};
34 UInt_64 systemId = 0;
35 UInt_64 opId = 0;
36 };
37
38 void WriteHeader(const Header &header, Serializer<UInt_64> &data);
39
41
42 struct Packet
43 {
46 };
47
48 struct Insurance
49 {
53 };
54}
55
56#ifndef EHC_IPV4_PAYLOAD
57 #define EHC_IPV4_PAYLOAD (EHS_IPV4_UDP_PAYLOAD - (UInt_16)sizeof(Header))
58#endif
59
60#ifndef EHC_IPV6_PAYLOAD
61 #define EHC_IPV6_PAYLOAD (EHS_IPV6_UDP_PAYLOAD - (UInt_16)sizeof(Header))
62#endif
A helper class for storing version major, minor and patch.
Definition: Version.h:9
Definition: Anchor.h:6
Header ReadHeader(Serializer< UInt_64 > &data)
Definition: NetUtils.cpp:22
NetStatus
Definition: NetUtils.h:8
void WriteHeader(const Header &header, Serializer< UInt_64 > &data)
Definition: NetUtils.cpp:5
char Char_8
Definition: Types.h:40
unsigned char UInt_8
Definition: Types.h:43
NetChannelType
Definition: NetUtils.h:16
Definition: NetUtils.h:22
UInt_64 channelId
Definition: NetUtils.h:26
UInt_64 fragmentCount
Definition: NetUtils.h:30
NetChannelType channelType
Definition: NetUtils.h:27
Version channelVer
Definition: NetUtils.h:28
bool ensure
Definition: NetUtils.h:32
UInt_64 fragment
Definition: NetUtils.h:31
UInt_64 opId
Definition: NetUtils.h:35
Char_8 token[64]
Definition: NetUtils.h:33
UInt_64 encId
Definition: NetUtils.h:24
UInt_64 systemId
Definition: NetUtils.h:34
Version version
Definition: NetUtils.h:23
Version encVer
Definition: NetUtils.h:25
Definition: NetUtils.h:49
float lastResend
Definition: NetUtils.h:52
Serializer< UInt_64 > payload
Definition: NetUtils.h:51
Header header
Definition: NetUtils.h:50
Definition: NetUtils.h:43
Serializer< UInt_64 > payload
Definition: NetUtils.h:45
Header header
Definition: NetUtils.h:44