libdoip
0.1.0
DoIP (Diagnostics over Internet Protocol) ISO 13400 C++17 Library
DoIPCloseReason.h
Go to the documentation of this file.
1
#ifndef DOIPCLOSEREASON_H
2
#define DOIPCLOSEREASON_H
3
4
#include <cstdint>
5
#include <iostream>
6
7
namespace
doip
{
8
9
/**
10
* @brief Reason for connection closure
11
*/
12
enum class
DoIPCloseReason
: uint8_t {
13
None
,
14
InitialInactivityTimeout
,
15
GeneralInactivityTimeout
,
16
AliveCheckTimeout
,
17
SocketError
,
18
InvalidMessage
,
19
ApplicationRequest
,
20
RoutingActivationDenied
21
};
22
23
inline
std::ostream &
operator<<
(std::ostream &os,
DoIPCloseReason
event) {
24
switch
(event) {
25
case
DoIPCloseReason::None
:
26
return
os <<
"None"
;
27
28
case
DoIPCloseReason::InitialInactivityTimeout
:
29
return
os <<
"Initial Inactivity Timeout"
;
30
case
DoIPCloseReason::GeneralInactivityTimeout
:
31
return
os <<
"General Inactivity Timeout"
;
32
case
DoIPCloseReason::AliveCheckTimeout
:
33
return
os <<
"AliveCheck Timeout"
;
34
case
DoIPCloseReason::SocketError
:
35
return
os <<
"Socket Error"
;
36
case
DoIPCloseReason::InvalidMessage
:
37
return
os <<
"Invalid Message"
;
38
case
DoIPCloseReason::ApplicationRequest
:
39
return
os <<
"Application Request"
;
40
case
DoIPCloseReason::RoutingActivationDenied
:
41
return
os <<
"Routing Activation Denied"
;
42
default
:
43
return
os <<
"Unknown("
<<
static_cast<
int
>
(event) <<
")"
;
44
}
45
}
46
47
}
// namespace doip
48
49
#endif
/* DOIPCLOSEREASON_H */
doip
Definition:
AnsiColors.h:3
doip::operator<<
std::ostream & operator<<(std::ostream &os, const ByteArray &arr)
Stream operator for ByteArray.
Definition:
ByteArray.h:303
doip::DoIPCloseReason
DoIPCloseReason
Reason for connection closure.
Definition:
DoIPCloseReason.h:12
doip::DoIPCloseReason::AliveCheckTimeout
@ AliveCheckTimeout
doip::DoIPCloseReason::InitialInactivityTimeout
@ InitialInactivityTimeout
doip::DoIPCloseReason::RoutingActivationDenied
@ RoutingActivationDenied
doip::DoIPCloseReason::None
@ None
doip::DoIPCloseReason::ApplicationRequest
@ ApplicationRequest
doip::DoIPCloseReason::SocketError
@ SocketError
doip::DoIPCloseReason::InvalidMessage
@ InvalidMessage
doip::DoIPCloseReason::GeneralInactivityTimeout
@ GeneralInactivityTimeout
inc
DoIPCloseReason.h
Generated by
1.9.1