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

Method get_proxy_protocol_addr

include/iocore/net/NetVConnection.h:790–801  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

788}
789
790inline sockaddr const *
791NetVConnection::get_proxy_protocol_addr(const ProxyProtocolData src_or_dst) const
792{
793 const IpEndpoint &addr = (src_or_dst == ProxyProtocolData::SRC ? pp_info.src_addr : pp_info.dst_addr);
794
795 if ((addr.isValid() && addr.network_order_port() != 0) || (ats_is_ip4(&addr) && INADDR_ANY != ats_ip4_addr_cast(&addr)) // IPv4
796 || (ats_is_ip6(&addr) && !IN6_IS_ADDR_UNSPECIFIED(&addr.sin6.sin6_addr))) {
797 return &addr.sa;
798 }
799
800 return nullptr;
801}
802
803inline std::optional<std::string_view>
804NetVConnection::get_proxy_protocol_tlv(const uint8_t tlvCode) const

Callers 2

Calls 5

ats_is_ip4Function · 0.85
ats_is_ip6Function · 0.85
IN6_IS_ADDR_UNSPECIFIEDFunction · 0.85
isValidMethod · 0.45
network_order_portMethod · 0.45

Tested by

no test coverage detected