23 #include "pedigree/kernel/compiler.h" 24 #include "pedigree/kernel/processor/types.h" 25 #include "pedigree/kernel/utilities/String.h" 26 #include "pedigree/kernel/utilities/utility.h" 41 : m_Type(IPv4), m_Ipv4(0), m_Ipv6(), m_bSet(false), m_Ipv6Prefix(128)
45 : m_Type(type), m_Ipv4(0), m_Ipv6(), m_bSet(
false), m_Ipv6Prefix(128)
49 : m_Type(IPv4), m_Ipv4(ipv4), m_Ipv6(), m_bSet(
true), m_Ipv6Prefix(128)
53 : m_Type(IPv6), m_Ipv4(0), m_Ipv6(), m_bSet(
true), m_Ipv6Prefix(128)
55 MemoryCopy(m_Ipv6, ipv6, 16);
78 ByteSet(m_Ipv6, 0, 16);
83 void setIp(uint8_t *ipv6)
86 MemoryCopy(m_Ipv6, ipv6, 16);
98 inline void getIp(uint8_t *ipv6)
const 101 MemoryCopy(ipv6, m_Ipv6, 16);
115 if (a.
getType() != m_Type || m_Type == IPv6 || a.
getType() == IPv6)
126 if (a.
getType() != m_Type || m_Type == IPv6 || a.
getType() == IPv6)
153 return (a.
getIp() == getIp());
156 return !MemoryCompare(m_Ipv6, a.m_Ipv6, 16);
163 return (a.
getIp() != getIp());
166 return !MemoryCompare(m_Ipv6, a.m_Ipv6, 16);
172 if (getType() == IPv4)
173 return (a == getIp());
180 if (getType() != IPv4)
181 return (a != getIp());
189 String prefixString(
size_t override = 256)
const;
192 bool isLinkLocal()
const;
195 bool isMulticast()
const;
200 return !isMulticast();
212 m_Ipv6Prefix = prefix;
IpAddress operator+(const IpAddress &a) const
void setIp(uint32_t ipv4)
void setIpv6Prefix(size_t prefix)
Sets the IPv6 prefix for this address.
bool isUnicast() const
Whether the IP address is a valid unicast address.
size_t getIpv6Prefix() const
Obtains the IPv6 prefix for this address.
bool operator==(const Iterator< originalT, Struct, FunctionPrev, FunctionNext, T1 > &x1, const Iterator< originalT, Struct, FunctionPrev, FunctionNext, T2 > &x2)
bool operator!=(const T1 &x1, const T2 &x2)
Global != operator for types with overloaded == operator.