MCPcopy Create free account
hub / github.com/apache/trafficserver / get_local_addr

Method get_local_addr

include/iocore/net/NetVConnection.h:769–781  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

767}
768
769inline sockaddr const *
770NetVConnection::get_local_addr()
771{
772 if (!got_local_addr) {
773 set_local_addr();
774 if ((ats_is_ip(&local_addr) && ats_ip_port_cast(&local_addr)) // IP and has a port.
775 || (ats_is_ip4(&local_addr) && INADDR_ANY != ats_ip4_addr_cast(&local_addr)) // IPv4
776 || (ats_is_ip6(&local_addr) && !IN6_IS_ADDR_UNSPECIFIED(&local_addr.sin6.sin6_addr))) {
777 got_local_addr = true;
778 }
779 }
780 return &local_addr.sa;
781}
782
783/// @return The local port in host order.
784inline uint16_t

Callers 1

get_local_portMethod · 0.95

Calls 4

ats_is_ipFunction · 0.85
ats_is_ip4Function · 0.85
ats_is_ip6Function · 0.85
IN6_IS_ADDR_UNSPECIFIEDFunction · 0.85

Tested by

no test coverage detected