Create quic::ToNetAddress() to replace direct access to impl() method of QuicIpAddress.
gfe-relnote: n/a (no functional change)
PiperOrigin-RevId: 245866232
Change-Id: Ib637a6d28248258fedea30d9f167a487c2c72322
diff --git a/quic/platform/api/quic_ip_address.cc b/quic/platform/api/quic_ip_address.cc
index 2b86cad..3b48c47 100644
--- a/quic/platform/api/quic_ip_address.cc
+++ b/quic/platform/api/quic_ip_address.cc
@@ -85,7 +85,15 @@
bool QuicIpAddress::InSameSubnet(const QuicIpAddress& other,
int subnet_length) {
- return impl_.InSameSubnet(other.impl(), subnet_length);
+ return impl_.InSameSubnet(other.impl_, subnet_length);
+}
+
+in_addr QuicIpAddress::GetIPv4() const {
+ return impl_.GetIPv4();
+}
+
+in6_addr QuicIpAddress::GetIPv6() const {
+ return impl_.GetIPv6();
}
} // namespace quic
diff --git a/quic/platform/api/quic_ip_address.h b/quic/platform/api/quic_ip_address.h
index f6013af..856efbe 100644
--- a/quic/platform/api/quic_ip_address.h
+++ b/quic/platform/api/quic_ip_address.h
@@ -73,6 +73,9 @@
bool IsIPv6() const;
bool InSameSubnet(const QuicIpAddress& other, int subnet_length);
+ in_addr GetIPv4() const;
+ in6_addr GetIPv6() const;
+
const QuicIpAddressImpl& impl() const { return impl_; }
private: