PLCnext API Documentation 23.0.2.9
TlsOptions.hpp
1
2//
3// Copyright PHOENIX CONTACT Electronics GmbH
4//
6#pragma once
8#include "Arp/System/Core/Enum.hxx"
9
10namespace Arp { namespace System { namespace Commons { namespace Net
11{
12
23enum class TlsOptions : uint32
24{
25 None = 0,
26 Default = (1 << 0),
27 EnableTlsv12 = (1 << 1),
28 EnableTlsv13 = (1 << 2),
29 SupportSessionRenegotiation = (1 << 3),
30 CheckLeafCrl = (1 << 4),
31 CheckAllCrl = (1 << 5)
32};
33
35// global stream operators of enum TlsOptions for logging and parsing
36ARP_CXX_SYMBOL_EXPORT std::ostream& operator<<(std::ostream& os, TlsOptions value);
37ARP_CXX_SYMBOL_EXPORT std::istream& operator>>(std::istream& is, TlsOptions& value);
38
40// global logical operators of enum TlsOptions
41inline constexpr TlsOptions operator&(TlsOptions lhs, TlsOptions rhs)
42{
43 using U = std::underlying_type<TlsOptions>::type;
44 return static_cast<TlsOptions>(static_cast<U>(lhs) & static_cast<U>(rhs));
45}
46
47inline constexpr TlsOptions operator|(TlsOptions lhs, TlsOptions rhs)
48{
49 using U = std::underlying_type<TlsOptions>::type;
50 return static_cast<TlsOptions>(static_cast<U>(lhs) | static_cast<U>(rhs));
51}
52
53inline TlsOptions& operator&=(TlsOptions& lhs, TlsOptions rhs)
54{
55 lhs = lhs & rhs;
56 return lhs;
57}
58
59inline TlsOptions& operator|=(TlsOptions& lhs, TlsOptions rhs)
60{
61 lhs = lhs | rhs;
62 return lhs;
63}
64
65inline TlsOptions operator~(TlsOptions arg)
66{
67 using U = std::underlying_type<TlsOptions>::type;
68 return static_cast<TlsOptions>(~static_cast<U>(arg));
69}
70
71
72}}}} // end of namespace Arp::System::Commons::Net
std::uint32_t uint32
The Arp unsigned integer type of 4 byte size.
Definition: PrimitiveTypes.hpp:35
@ System
System components used by the System, Device, Plc or Io domains.
std::ostream & operator<<(std::ostream &os, const IpAddress &ipAddress)
The ostream operator is used for logging and string formatting.
Definition: IpAddress.hpp:107
std::istream & operator>>(std::istream &is, IpAddress &ipAddress)
The istream operator is used for string parsing.
Definition: IpAddress.hpp:114
TlsOptions
This enum is used to select different options for the TlsSocket class
Definition: TlsOptions.hpp:24
Root namespace for the PLCnext API