PcapPlusPlus  24.09
IpAddressUtils.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 // Forward declarations
6 struct in_addr;
7 struct in6_addr;
8 
13 namespace pcpp
14 {
15  // Forward declarations
16  class IPv4Address;
17  class IPv6Address;
18  class IPAddress;
19 
24  bool operator==(const IPv4Address& lhs, const in_addr& rhs);
29  inline bool operator!=(const IPv4Address& lhs, const in_addr& rhs)
30  {
31  return !(lhs == rhs);
32  }
37  inline bool operator==(const in_addr& lhs, const IPv4Address& rhs)
38  {
39  return rhs == lhs;
40  }
45  inline bool operator!=(const in_addr& lhs, const IPv4Address& rhs)
46  {
47  return !(lhs == rhs);
48  }
49 
54  bool operator==(const IPv6Address& lhs, const in6_addr& rhs);
59  inline bool operator!=(const IPv6Address& lhs, const in6_addr& rhs)
60  {
61  return !(lhs == rhs);
62  }
67  inline bool operator==(const in6_addr& lhs, const IPv6Address& rhs)
68  {
69  return rhs == lhs;
70  }
75  inline bool operator!=(const in6_addr& lhs, const IPv6Address& rhs)
76  {
77  return !(lhs == rhs);
78  }
79 
84  bool operator==(const IPAddress& lhs, const in_addr& rhs);
89  inline bool operator!=(const IPAddress& lhs, const in_addr& rhs)
90  {
91  return !(lhs == rhs);
92  }
97  inline bool operator==(const in_addr& lhs, const IPAddress& rhs)
98  {
99  return rhs == lhs;
100  }
105  inline bool operator!=(const in_addr& lhs, const IPAddress& rhs)
106  {
107  return !(lhs == rhs);
108  }
109 
114  bool operator==(const IPAddress& lhs, const in6_addr& rhs);
119  inline bool operator!=(const IPAddress& lhs, const in6_addr& rhs)
120  {
121  return !(lhs == rhs);
122  }
127  inline bool operator==(const in6_addr& lhs, const IPAddress& rhs)
128  {
129  return rhs == lhs;
130  }
135  inline bool operator!=(const in6_addr& lhs, const IPAddress& rhs)
136  {
137  return !(lhs == rhs);
138  }
139 } // namespace pcpp
Definition: IpAddress.h:358
Definition: IpAddress.h:32
Definition: IpAddress.h:199
The main namespace for the PcapPlusPlus lib.
bool operator!=(const IPv4Address &lhs, const in_addr &rhs)
Definition: IpAddressUtils.h:29
bool operator==(const IPv4Address &lhs, const in_addr &rhs)