LibSWOC++ 1.5.14
Solid Wall of C++
Loading...
Searching...
No Matches
swoc_ip.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// Copyright Network Geographics 2014
6
7#pragma once
8#include <array>
9#include <climits>
10#include <netinet/in.h>
11#include <sys/socket.h>
12#include <string_view>
13#include <variant>
14
15#include "swoc/swoc_version.h"
16#include "swoc/TextView.h"
17
18#include "swoc/IPEndpoint.h"
19#include "swoc/IPAddr.h"
20#include "swoc/IPSrv.h"
21#include "swoc/IPRange.h"
22
23namespace swoc { inline namespace SWOC_VERSION_NS {
24
25// --- Cross type address operators
26
27inline bool
28operator==(IPAddr const &lhs, IPEndpoint const &rhs) {
29 return lhs == &rhs.sa;
30}
31
33inline bool
34operator==(IPEndpoint const &lhs, IPAddr const &rhs) {
35 return &lhs.sa == rhs;
36}
37
39inline bool
40operator!=(IPAddr const &lhs, IPEndpoint const &rhs) {
41 return !(lhs == &rhs.sa);
42}
43
45inline bool
46operator!=(IPEndpoint const &lhs, IPAddr const &rhs) {
47 return !(rhs == &lhs.sa);
48}
49
50}} // namespace swoc::SWOC_VERSION_NS
bool operator==(RBNode *n, RBNode::Color c)
Definition RBTree.cc:19
For template deduction guides.
Definition ArenaWriter.cc:9
bool operator==(IPAddr const &lhs, sockaddr const *sa)
Equality.
Definition swoc_ip.cc:650
bool operator!=(IP4Addr const &lhs, IP4Addr const &rhs)
Definition IPAddr.h:845
struct sockaddr sa
Generic address.
Definition IPEndpoint.h:40