xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
protocol_type.h
Go to the documentation of this file.
1 #pragma once
5 
6 #include "../../ustring.h"
7 
9 #undef unix
10 
13 namespace xtd {
15  namespace net {
17  namespace sockets {
27  enum class protocol_type {
29  unknown = -1,
33  unspecified = 0,
35  ip = 0,
37  icmp = 1,
39  igmp = 2,
41  ggp = 3,
43  ip_v4 = 4,
45  tcp = 6,
47  pup = 12,
49  udp = 17,
51  idp = 22,
53  ip_v6 = 41,
63  icmp_v6 = 58,
69  nd = 77,
71  raw = 255,
73  ipx = 1000,
75  spx = 1256,
77  spx_2 = 1257,
78  };
79 
81  inline std::ostream& operator<<(std::ostream& os, protocol_type value) {return os << to_string(value, {{protocol_type::unknown, "unknown"}, {protocol_type::ip_v6_hop_by_hop_options, "ip_v6_hop_by_hop_options"}, {protocol_type::unspecified, "unspecified"}, {protocol_type::ip, "ip"}, {protocol_type::icmp, "icmp"}, {protocol_type::igmp, "igmp"}, {protocol_type::ggp, "ggp"}, {protocol_type::ip_v4, "ip_v4"}, {protocol_type::tcp, "tcp"}, {protocol_type::pup, "pup"}, {protocol_type::udp, "udp"}, {protocol_type::idp, "idp"}, {protocol_type::ip_v6, "ip_v6"}, {protocol_type::ip_v6_routing_header, "ip_v6_routing_header"}, {protocol_type::ip_v6_fragment_header, "ip_v6_fragment_header"}, {protocol_type::ip_sec_encapsulating_security_payload, "ip_sec_encapsulating_security_payload"}, {protocol_type::ip_sec_authentication_header, "ip_sec_authentication_header"}, {protocol_type::icmp_v6, "icmp_v6"}, {protocol_type::ip_v6_no_next_header, "ip_v6_no_next_header"}, {protocol_type::ip_v6_destination_options, "ip_v6_destination_options"}, {protocol_type::nd, "nd"}, {protocol_type::raw, "raw"}, {protocol_type::ipx, "ipx"}, {protocol_type::spx, "spx"}, {protocol_type::spx_2, "spx_2"}});}
82  inline std::wostream& operator<<(std::wostream& os, protocol_type value) {return os << to_string(value, {{protocol_type::unknown, L"unknown"}, {protocol_type::ip_v6_hop_by_hop_options, L"ip_v6_hop_by_hop_options"}, {protocol_type::unspecified, L"unspecified"}, {protocol_type::ip, L"ip"}, {protocol_type::icmp, L"icmp"}, {protocol_type::igmp, L"igmp"}, {protocol_type::ggp, L"ggp"}, {protocol_type::ip_v4, L"ip_v4"}, {protocol_type::tcp, L"tcp"}, {protocol_type::pup, L"pup"}, {protocol_type::udp, L"udp"}, {protocol_type::idp, L"idp"}, {protocol_type::ip_v6, L"ip_v6"}, {protocol_type::ip_v6_routing_header, L"ip_v6_routing_header"}, {protocol_type::ip_v6_fragment_header, L"ip_v6_fragment_header"}, {protocol_type::ip_sec_encapsulating_security_payload, L"ip_sec_encapsulating_security_payload"}, {protocol_type::ip_sec_authentication_header, L"ip_sec_authentication_header"}, {protocol_type::icmp_v6, L"icmp_v6"}, {protocol_type::ip_v6_no_next_header, L"ip_v6_no_next_header"}, {protocol_type::ip_v6_destination_options, L"ip_v6_destination_options"}, {protocol_type::nd, L"nd"}, {protocol_type::raw, L"raw"}, {protocol_type::ipx, L"ipx"}, {protocol_type::spx, L"spx"}, {protocol_type::spx_2, L"spx_2"}});}
84  }
85  }
86 }
protocol_type
Specifies the protocols that the xtd::net::sockets::socket class supports.
Definition: protocol_type.h:27
Internet Datagram Protocol.
Internet Group Management Protocol.
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Internet Control Message Protocol for IPv6.
Internet Protocol version 6 (IPv6).
std::string to_string(const date_time &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: date_time.h:1110
Internet Protocol version 4.
Transmission Control Protocol.
Address for PUP protocols.
Internet Control Message Protocol.
IPv6 Authentication header. For details, see RFC 2292 section 2.2.1, available at http://www...
Sequenced Packet Exchange version 2 protocol.
Gateway To Gateway Protocol.
Net Disk Protocol (unofficial).
Sequenced Packet Exchange protocol.