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