join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
protocol.hpp
Go to the documentation of this file.
1
25#ifndef JOIN_CORE_PROTOCOL_HPP
26#define JOIN_CORE_PROTOCOL_HPP
27
28// libjoin.
29#include <join/endpoint.hpp>
30
31// C.
32#include <linux/netlink.h>
33#include <net/ethernet.h>
34
35namespace join
36{
37 template <class Protocol>
38 class BasicSocket;
39 template <class Protocol>
40 class BasicDatagramSocket;
41 template <class Protocol>
42 class BasicStreamSocket;
43 template <class Protocol>
44 class BasicTlsSocket;
45
46 template <class Protocol>
47 class BasicSocketStream;
48 template <class Protocol>
49 class BasicTlsStream;
50
51 template <class Protocol>
53 template <class Protocol>
55
56 template <class Protocol>
58 template <class Protocol>
59 class BasicTlsResolver;
60
61 template <class Protocol>
63 template <class Protocol>
65
66 template <class Protocol>
67 class BasicHttpClient;
68 template <class Protocol>
70
71 template <class Protocol>
72 class BasicHttpWorker;
73 template <class Protocol>
74 class BasicHttpServer;
75 template <class Protocol>
77
78 template <class Protocol>
79 class BasicSmtpClient;
80 template <class Protocol>
82
87 {
88 public:
91
95 constexpr UnixDgram () noexcept = default;
96
101 constexpr int family () const noexcept
102 {
103 return AF_UNIX;
104 }
105
110 constexpr int type () const noexcept
111 {
112 return SOCK_DGRAM;
113 }
114
119 constexpr int protocol () const noexcept
120 {
121 return 0;
122 }
123 };
124
129 {
130 public:
135
139 constexpr UnixStream () noexcept = default;
140
145 constexpr int family () const noexcept
146 {
147 return AF_UNIX;
148 }
149
154 constexpr int type () const noexcept
155 {
156 return SOCK_STREAM;
157 }
158
163 constexpr int protocol () const noexcept
164 {
165 return 0;
166 }
167 };
168
173 {
174 public:
177
182 constexpr Netlink (int proto = NETLINK_ROUTE) noexcept
183 : _proto (proto)
184 {
185 }
186
191 static inline Netlink& rt () noexcept
192 {
193 static Netlink route (NETLINK_ROUTE);
194 return route;
195 }
196
201 static inline Netlink& nf () noexcept
202 {
203 static Netlink netfilter (NETLINK_NETFILTER);
204 return netfilter;
205 }
206
211 constexpr int family () const noexcept
212 {
213 return AF_NETLINK;
214 }
215
220 constexpr int type () const noexcept
221 {
222 return SOCK_RAW;
223 }
224
229 constexpr int protocol () const noexcept
230 {
231 return _proto;
232 }
233
234 private:
236 int _proto;
237 };
238
245 constexpr bool operator== (const Netlink& a, const Netlink& b) noexcept
246 {
247 return a.protocol () == b.protocol ();
248 }
249
256 constexpr bool operator!= (const Netlink& a, const Netlink& b) noexcept
257 {
258 return !(a == b);
259 }
260
264 class Raw
265 {
266 public:
269
273 constexpr Raw () noexcept = default;
274
279 constexpr int family () const noexcept
280 {
281 return AF_PACKET;
282 }
283
288 constexpr int type () const noexcept
289 {
290 return SOCK_RAW;
291 }
292
297 constexpr int protocol () const noexcept
298 {
299 if (BYTE_ORDER == LITTLE_ENDIAN)
300 {
301 return (ETH_P_ALL >> 8) | (ETH_P_ALL << 8);
302 }
303 return ETH_P_ALL;
304 }
305 };
306
310 class Udp
311 {
312 public:
315
320 constexpr Udp (int family = AF_INET) noexcept
321 : _family (family)
322 {
323 }
324
329 static inline Udp& v4 () noexcept
330 {
331 static Udp udpv4 (AF_INET);
332 return udpv4;
333 }
334
339 static inline Udp& v6 () noexcept
340 {
341 static Udp udpv6 (AF_INET6);
342 return udpv6;
343 }
344
349 constexpr int family () const noexcept
350 {
351 return _family;
352 }
353
358 constexpr int type () const noexcept
359 {
360 return SOCK_DGRAM;
361 }
362
367 constexpr int protocol () const noexcept
368 {
369 return IPPROTO_UDP;
370 }
371
372 private:
374 int _family;
375 };
376
383 constexpr bool operator== (const Udp& a, const Udp& b) noexcept
384 {
385 return a.family () == b.family ();
386 }
387
394 constexpr bool operator!= (const Udp& a, const Udp& b) noexcept
395 {
396 return !(a == b);
397 }
398
402 class Icmp
403 {
404 public:
407
412 constexpr Icmp (int family = AF_INET) noexcept
413 : _family (family)
414 {
415 }
416
421 static inline Icmp& v4 () noexcept
422 {
423 static Icmp icmpv4 (AF_INET);
424 return icmpv4;
425 }
426
431 static inline Icmp& v6 () noexcept
432 {
433 static Icmp icmpv6 (AF_INET6);
434 return icmpv6;
435 }
436
441 constexpr int family () const noexcept
442 {
443 return _family;
444 }
445
450 constexpr int type () const noexcept
451 {
452 return SOCK_RAW;
453 }
454
459 constexpr int protocol () const noexcept
460 {
461 if (family () == AF_INET6)
462 {
463 return int (IPPROTO_ICMPV6);
464 }
465
466 return IPPROTO_ICMP;
467 }
468
469 private:
471 int _family;
472 };
473
480 constexpr bool operator== (const Icmp& a, const Icmp& b) noexcept
481 {
482 return a.family () == b.family ();
483 }
484
491 constexpr bool operator!= (const Icmp& a, const Icmp& b) noexcept
492 {
493 return !(a == b);
494 }
495
499 class Tcp
500 {
501 public:
506
511 constexpr Tcp (int family = AF_INET) noexcept
512 : _family (family)
513 {
514 }
515
520 static inline Tcp& v4 () noexcept
521 {
522 static Tcp tcpv4 (AF_INET);
523 return tcpv4;
524 }
525
530 static inline Tcp& v6 () noexcept
531 {
532 static Tcp tcpv6 (AF_INET6);
533 return tcpv6;
534 }
535
540 constexpr int family () const noexcept
541 {
542 return _family;
543 }
544
549 constexpr int type () const noexcept
550 {
551 return SOCK_STREAM;
552 }
553
558 constexpr int protocol () const noexcept
559 {
560 return IPPROTO_TCP;
561 }
562
563 private:
565 int _family;
566 };
567
574 constexpr bool operator== (const Tcp& a, const Tcp& b) noexcept
575 {
576 return a.family () == b.family ();
577 }
578
585 constexpr bool operator!= (const Tcp& a, const Tcp& b) noexcept
586 {
587 return !(a == b);
588 }
589
593 class Tls
594 {
595 public:
600
605 constexpr Tls (int family = AF_INET) noexcept
606 : _family (family)
607 {
608 }
609
614 static inline Tls& v4 () noexcept
615 {
616 static Tls tlsv4 (AF_INET);
617 return tlsv4;
618 }
619
624 static inline Tls& v6 () noexcept
625 {
626 static Tls tlsv6 (AF_INET6);
627 return tlsv6;
628 }
629
634 constexpr int family () const noexcept
635 {
636 return _family;
637 }
638
643 constexpr int type () const noexcept
644 {
645 return SOCK_STREAM;
646 }
647
652 constexpr int protocol () const noexcept
653 {
654 return IPPROTO_TCP;
655 }
656
657 private:
659 int _family;
660 };
661
668 constexpr bool operator== (const Tls& a, const Tls& b) noexcept
669 {
670 return a.family () == b.family ();
671 }
672
679 constexpr bool operator!= (const Tls& a, const Tls& b) noexcept
680 {
681 return !(a == b);
682 }
683
687 class Dns
688 {
689 public:
694
699 constexpr Dns (int family = AF_INET) noexcept
700 : _family (family)
701 {
702 }
703
708 static inline Dns& v4 () noexcept
709 {
710 static Dns dnsv4 (AF_INET);
711 return dnsv4;
712 }
713
718 static inline Dns& v6 () noexcept
719 {
720 static Dns dnsv6 (AF_INET6);
721 return dnsv6;
722 }
723
728 constexpr int family () const noexcept
729 {
730 return _family;
731 }
732
737 constexpr int type () const noexcept
738 {
739 return SOCK_DGRAM;
740 }
741
746 constexpr int protocol () const noexcept
747 {
748 return IPPROTO_UDP;
749 }
750
752 static constexpr uint16_t defaultPort = 53;
753
755 static constexpr size_t maxMsgSize = 8192;
756
757 private:
759 int _family;
760 };
761
768 constexpr bool operator== (const Dns& a, const Dns& b) noexcept
769 {
770 return a.family () == b.family ();
771 }
772
779 constexpr bool operator!= (const Dns& a, const Dns& b) noexcept
780 {
781 return !(a == b);
782 }
783
787 class Mdns
788 {
789 public:
793
798 constexpr Mdns (int family = AF_INET) noexcept
799 : _family (family)
800 {
801 }
802
807 static inline Mdns& v4 () noexcept
808 {
809 static Mdns mdnsv4 (AF_INET);
810 return mdnsv4;
811 }
812
817 static inline Mdns& v6 () noexcept
818 {
819 static Mdns mdnsv6 (AF_INET6);
820 return mdnsv6;
821 }
822
827 constexpr int family () const noexcept
828 {
829 return _family;
830 }
831
836 constexpr int type () const noexcept
837 {
838 return SOCK_DGRAM;
839 }
840
845 constexpr int protocol () const noexcept
846 {
847 return IPPROTO_UDP;
848 }
849
855 static IpAddress multicastAddress (int family) noexcept
856 {
857 return (family == AF_INET6) ? "ff02::fb" : "224.0.0.251";
858 }
859
861 static constexpr uint16_t defaultPort = 5353;
862
864 static constexpr size_t maxMsgSize = 8192;
865
866 private:
868 int _family;
869 };
870
877 constexpr bool operator== (const Mdns& a, const Mdns& b) noexcept
878 {
879 return a.family () == b.family ();
880 }
881
888 constexpr bool operator!= (const Mdns& a, const Mdns& b) noexcept
889 {
890 return !(a == b);
891 }
892
896 class Dot
897 {
898 public:
902
907 constexpr Dot (int family = AF_INET) noexcept
908 : _family (family)
909 {
910 }
911
916 static inline Dot& v4 () noexcept
917 {
918 static Dot dotv4 (AF_INET);
919 return dotv4;
920 }
921
926 static inline Dot& v6 () noexcept
927 {
928 static Dot dotv6 (AF_INET6);
929 return dotv6;
930 }
931
936 constexpr int family () const noexcept
937 {
938 return _family;
939 }
940
945 constexpr int type () const noexcept
946 {
947 return SOCK_STREAM;
948 }
949
954 constexpr int protocol () const noexcept
955 {
956 return IPPROTO_TCP;
957 }
958
960 static constexpr uint16_t defaultPort = 853;
961
963 static constexpr size_t maxMsgSize = 16384;
964
965 private:
967 int _family;
968 };
969
976 constexpr bool operator== (const Dot& a, const Dot& b) noexcept
977 {
978 return a.family () == b.family ();
979 }
980
987 constexpr bool operator!= (const Dot& a, const Dot& b) noexcept
988 {
989 return !(a == b);
990 }
991
995 class Http
996 {
997 public:
1005
1010 constexpr Http (int family = AF_INET) noexcept
1011 : _family (family)
1012 {
1013 }
1014
1019 static inline Http& v4 () noexcept
1020 {
1021 static Http httpv4 (AF_INET);
1022 return httpv4;
1023 }
1024
1029 static inline Http& v6 () noexcept
1030 {
1031 static Http httpv6 (AF_INET6);
1032 return httpv6;
1033 }
1034
1039 constexpr int family () const noexcept
1040 {
1041 return _family;
1042 }
1043
1048 constexpr int type () const noexcept
1049 {
1050 return SOCK_STREAM;
1051 }
1052
1057 constexpr int protocol () const noexcept
1058 {
1059 return IPPROTO_TCP;
1060 }
1061
1062 private:
1064 int _family;
1065 };
1066
1073 constexpr bool operator== (const Http& a, const Http& b) noexcept
1074 {
1075 return a.family () == b.family ();
1076 }
1077
1084 constexpr bool operator!= (const Http& a, const Http& b) noexcept
1085 {
1086 return !(a == b);
1087 }
1088
1092 class Https
1093 {
1094 public:
1102
1107 constexpr Https (int family = AF_INET) noexcept
1108 : _family (family)
1109 {
1110 }
1111
1116 static inline Https& v4 () noexcept
1117 {
1118 static Https httpsv4 (AF_INET);
1119 return httpsv4;
1120 }
1121
1126 static inline Https& v6 () noexcept
1127 {
1128 static Https httpsv6 (AF_INET6);
1129 return httpsv6;
1130 }
1131
1136 constexpr int family () const noexcept
1137 {
1138 return _family;
1139 }
1140
1145 constexpr int type () const noexcept
1146 {
1147 return SOCK_STREAM;
1148 }
1149
1154 constexpr int protocol () const noexcept
1155 {
1156 return IPPROTO_TCP;
1157 }
1158
1159 private:
1161 int _family;
1162 };
1163
1170 constexpr bool operator== (const Https& a, const Https& b) noexcept
1171 {
1172 return a.family () == b.family ();
1173 }
1174
1181 constexpr bool operator!= (const Https& a, const Https& b) noexcept
1182 {
1183 return !(a == b);
1184 }
1185
1189 class Smtp
1190 {
1191 public:
1196
1201 constexpr Smtp (int family = AF_INET) noexcept
1202 : _family (family)
1203 {
1204 }
1205
1210 static inline Smtp& v4 () noexcept
1211 {
1212 static Smtp smtpv4 (AF_INET);
1213 return smtpv4;
1214 }
1215
1220 static inline Smtp& v6 () noexcept
1221 {
1222 static Smtp smtpv6 (AF_INET6);
1223 return smtpv6;
1224 }
1225
1230 constexpr int family () const noexcept
1231 {
1232 return _family;
1233 }
1234
1239 constexpr int type () const noexcept
1240 {
1241 return SOCK_STREAM;
1242 }
1243
1248 constexpr int protocol () const noexcept
1249 {
1250 return IPPROTO_TCP;
1251 }
1252
1253 private:
1255 int _family;
1256 };
1257
1264 constexpr bool operator== (const Smtp& a, const Smtp& b) noexcept
1265 {
1266 return a.family () == b.family ();
1267 }
1268
1275 constexpr bool operator!= (const Smtp& a, const Smtp& b) noexcept
1276 {
1277 return !(a == b);
1278 }
1279
1283 class Smtps
1284 {
1285 public:
1290
1295 constexpr Smtps (int family = AF_INET) noexcept
1296 : _family (family)
1297 {
1298 }
1299
1304 static inline Smtps& v4 () noexcept
1305 {
1306 static Smtps smtpsv4 (AF_INET);
1307 return smtpsv4;
1308 }
1309
1314 static inline Smtps& v6 () noexcept
1315 {
1316 static Smtps smtpsv6 (AF_INET6);
1317 return smtpsv6;
1318 }
1319
1324 constexpr int family () const noexcept
1325 {
1326 return _family;
1327 }
1328
1333 constexpr int type () const noexcept
1334 {
1335 return SOCK_STREAM;
1336 }
1337
1342 constexpr int protocol () const noexcept
1343 {
1344 return IPPROTO_TCP;
1345 }
1346
1347 private:
1349 int _family;
1350 };
1351
1358 constexpr bool operator== (const Smtps& a, const Smtps& b) noexcept
1359 {
1360 return a.family () == b.family ();
1361 }
1362
1369 constexpr bool operator!= (const Smtps& a, const Smtps& b) noexcept
1370 {
1371 return !(a == b);
1372 }
1373}
1374
1375#endif
basic DNS name server over datagram socket.
Definition nameserver.hpp:41
mDNS peer.
Definition nameserver.hpp:225
basic DNS resolver over datagram socket.
Definition resolver.hpp:52
basic datagram socket class.
Definition socket.hpp:644
basic HTTP client.
Definition httpclient.hpp:46
basic HTTPS client.
Definition httpclient.hpp:488
basic HTTPS server.
Definition httpserver.hpp:979
basic HTTP server.
Definition httpserver.hpp:644
basic HTTP worker.
Definition httpserver.hpp:81
basic internet endpoint class.
Definition endpoint.hpp:670
basic link layer endpoint class.
Definition endpoint.hpp:498
basic netlink endpoint class.
Definition endpoint.hpp:266
basic SMTP client.
Definition smtpclient.hpp:41
Basic SMTPS client.
Definition smtpclient.hpp:650
socket stream class.
Definition socketstream.hpp:329
basic socket class.
Definition socket.hpp:59
basic stream acceptor class.
Definition protocol.hpp:52
basic stream socket class.
Definition socket.hpp:1141
basic TLS acceptor class.
Definition protocol.hpp:54
basic DNS resolver over TLS socket (DNS over TLS).
Definition resolver.hpp:1040
basic TLS socket class.
Definition socket.hpp:1551
TLS stream class.
Definition socketstream.hpp:513
basic unix endpoint class.
Definition endpoint.hpp:98
DNS over UDP protocol class.
Definition protocol.hpp:688
static constexpr size_t maxMsgSize
maximum DNS message size.
Definition protocol.hpp:755
constexpr int family() const noexcept
get the protocol IP address family.
Definition protocol.hpp:728
constexpr int type() const noexcept
get the protocol communication semantic.
Definition protocol.hpp:737
constexpr int protocol() const noexcept
get the protocol type.
Definition protocol.hpp:746
static Dns & v6() noexcept
get protocol suitable for IPv6 address family.
Definition protocol.hpp:718
constexpr Dns(int family=AF_INET) noexcept
construct the DNS protocol instance.
Definition protocol.hpp:699
static Dns & v4() noexcept
get protocol suitable for IPv4 address family.
Definition protocol.hpp:708
static constexpr uint16_t defaultPort
default DNS port.
Definition protocol.hpp:752
DNS over TLS protocol class.
Definition protocol.hpp:897
static constexpr uint16_t defaultPort
default DoT port.
Definition protocol.hpp:960
constexpr int protocol() const noexcept
get the protocol type.
Definition protocol.hpp:954
static constexpr size_t maxMsgSize
maximum DoT message size.
Definition protocol.hpp:963
static Dot & v4() noexcept
get protocol suitable for IPv4 address family.
Definition protocol.hpp:916
constexpr int type() const noexcept
get the protocol communication semantic.
Definition protocol.hpp:945
constexpr int family() const noexcept
get the protocol IP address family.
Definition protocol.hpp:936
static Dot & v6() noexcept
get protocol suitable for IPv6 address family.
Definition protocol.hpp:926
constexpr Dot(int family=AF_INET) noexcept
construct the DoT protocol instance.
Definition protocol.hpp:907
HTTP protocol class.
Definition protocol.hpp:996
constexpr int protocol() const noexcept
get the protocol type.
Definition protocol.hpp:1057
constexpr Http(int family=AF_INET) noexcept
create the HTTP protocol instance.
Definition protocol.hpp:1010
static Http & v4() noexcept
get protocol suitable for IPv4 address family.
Definition protocol.hpp:1019
static Http & v6() noexcept
get protocol suitable for IPv6 address family.
Definition protocol.hpp:1029
constexpr int type() const noexcept
get the protocol communication semantic.
Definition protocol.hpp:1048
constexpr int family() const noexcept
get the protocol IP address family.
Definition protocol.hpp:1039
HTTPS protocol class.
Definition protocol.hpp:1093
constexpr int protocol() const noexcept
get the protocol type.
Definition protocol.hpp:1154
constexpr int family() const noexcept
get the protocol IP address family.
Definition protocol.hpp:1136
constexpr int type() const noexcept
get the protocol communication semantic.
Definition protocol.hpp:1145
static Https & v6() noexcept
get protocol suitable for IPv6 address family.
Definition protocol.hpp:1126
static Https & v4() noexcept
get protocol suitable for IPv4 address family.
Definition protocol.hpp:1116
constexpr Https(int family=AF_INET) noexcept
create the HTTPS protocol instance.
Definition protocol.hpp:1107
ICMP protocol class.
Definition protocol.hpp:403
constexpr int family() const noexcept
get the protocol IP address family.
Definition protocol.hpp:441
constexpr int protocol() const noexcept
get the protocol type.
Definition protocol.hpp:459
constexpr int type() const noexcept
get the protocol communication semantic.
Definition protocol.hpp:450
static Icmp & v6() noexcept
get protocol suitable for IPv6 address family.
Definition protocol.hpp:431
static Icmp & v4() noexcept
get protocol suitable for IPv4 address family.
Definition protocol.hpp:421
constexpr Icmp(int family=AF_INET) noexcept
create the icmp protocol instance.
Definition protocol.hpp:412
IPv6, IPv4 address class.
Definition ipaddress.hpp:51
Multicast DNS protocol class.
Definition protocol.hpp:788
static constexpr size_t maxMsgSize
maximum DNS message size.
Definition protocol.hpp:864
static Mdns & v6() noexcept
get protocol suitable for IPv6 address family.
Definition protocol.hpp:817
constexpr int protocol() const noexcept
get the protocol type.
Definition protocol.hpp:845
static constexpr uint16_t defaultPort
default DNS port.
Definition protocol.hpp:861
constexpr int family() const noexcept
get the protocol IP address family.
Definition protocol.hpp:827
static Mdns & v4() noexcept
get protocol suitable for IPv4 address family.
Definition protocol.hpp:807
constexpr Mdns(int family=AF_INET) noexcept
construct the mDNS protocol instance.
Definition protocol.hpp:798
static IpAddress multicastAddress(int family) noexcept
get multicast address for the given address family.
Definition protocol.hpp:855
constexpr int type() const noexcept
get the protocol communication semantic.
Definition protocol.hpp:836
RAW protocol class.
Definition protocol.hpp:265
constexpr int type() const noexcept
get the protocol communication semantic.
Definition protocol.hpp:288
constexpr Raw() noexcept=default
default constructor.
constexpr int family() const noexcept
get the protocol ip address family.
Definition protocol.hpp:279
constexpr int protocol() const noexcept
get the protocol type.
Definition protocol.hpp:297
SMTP protocol class.
Definition protocol.hpp:1190
static Smtp & v4() noexcept
get protocol suitable for IPv4 address family.
Definition protocol.hpp:1210
constexpr int protocol() const noexcept
get the protocol type.
Definition protocol.hpp:1248
static Smtp & v6() noexcept
get protocol suitable for IPv6 address family.
Definition protocol.hpp:1220
constexpr int family() const noexcept
get the protocol IP address family.
Definition protocol.hpp:1230
constexpr Smtp(int family=AF_INET) noexcept
create the SMTP protocol instance.
Definition protocol.hpp:1201
constexpr int type() const noexcept
get the protocol communication semantic.
Definition protocol.hpp:1239
SMTPS protocol class.
Definition protocol.hpp:1284
constexpr int protocol() const noexcept
get the protocol type.
Definition protocol.hpp:1342
constexpr int type() const noexcept
get the protocol communication semantic.
Definition protocol.hpp:1333
constexpr Smtps(int family=AF_INET) noexcept
create the SMTPS protocol instance.
Definition protocol.hpp:1295
constexpr int family() const noexcept
get the protocol IP address family.
Definition protocol.hpp:1324
static Smtps & v6() noexcept
get protocol suitable for IPv6 address family.
Definition protocol.hpp:1314
static Smtps & v4() noexcept
get protocol suitable for IPv4 address family.
Definition protocol.hpp:1304
TCP protocol class.
Definition protocol.hpp:500
static Tcp & v6() noexcept
get protocol suitable for IPv6 address family.
Definition protocol.hpp:530
constexpr int type() const noexcept
get the protocol communication semantic.
Definition protocol.hpp:549
constexpr int family() const noexcept
get the protocol IP address family.
Definition protocol.hpp:540
constexpr Tcp(int family=AF_INET) noexcept
create the tcp protocol instance.
Definition protocol.hpp:511
static Tcp & v4() noexcept
get protocol suitable for IPv4 address family.
Definition protocol.hpp:520
constexpr int protocol() const noexcept
get the protocol type.
Definition protocol.hpp:558
SSL/TLS protocol class.
Definition protocol.hpp:594
constexpr int protocol() const noexcept
get the protocol type.
Definition protocol.hpp:652
static Tls & v6() noexcept
get protocol suitable for IPv6 address family.
Definition protocol.hpp:624
static Tls & v4() noexcept
get protocol suitable for IPv4 address family.
Definition protocol.hpp:614
constexpr int family() const noexcept
get the protocol IP address family.
Definition protocol.hpp:634
constexpr Tls(int family=AF_INET) noexcept
create the tcp protocol instance.
Definition protocol.hpp:605
constexpr int type() const noexcept
get the protocol communication semantic.
Definition protocol.hpp:643
UDP protocol class.
Definition protocol.hpp:311
constexpr int type() const noexcept
get the protocol communication semantic.
Definition protocol.hpp:358
static Udp & v6() noexcept
get protocol suitable for IPv6 address family.
Definition protocol.hpp:339
static Udp & v4() noexcept
get protocol suitable for IPv4 address family.
Definition protocol.hpp:329
constexpr Udp(int family=AF_INET) noexcept
construct the udp protocol instance.
Definition protocol.hpp:320
constexpr int family() const noexcept
get the protocol IP address family.
Definition protocol.hpp:349
constexpr int protocol() const noexcept
get the protocol type.
Definition protocol.hpp:367
unix datagram protocol class.
Definition protocol.hpp:87
constexpr int type() const noexcept
get the protocol communication semantic.
Definition protocol.hpp:110
constexpr UnixDgram() noexcept=default
construct the unix datagram protocol instance by default.
constexpr int protocol() const noexcept
get the protocol type.
Definition protocol.hpp:119
constexpr int family() const noexcept
get the protocol ip address family.
Definition protocol.hpp:101
unix stream protocol class.
Definition protocol.hpp:129
constexpr UnixStream() noexcept=default
construct the unix stream protocol instance by default.
constexpr int type() const noexcept
get the protocol communication semantic.
Definition protocol.hpp:154
constexpr int family() const noexcept
get the protocol ip address family.
Definition protocol.hpp:145
constexpr int protocol() const noexcept
get the protocol type.
Definition protocol.hpp:163
Definition acceptor.hpp:32
bool operator!=(const BasicUnixEndpoint< Protocol > &a, const BasicUnixEndpoint< Protocol > &b) noexcept
compare if endpoints are not equal.
Definition endpoint.hpp:195
bool operator==(const BasicUnixEndpoint< Protocol > &a, const BasicUnixEndpoint< Protocol > &b) noexcept
compare if endpoints are equal.
Definition endpoint.hpp:183