| 788 | } |
| 789 | |
| 790 | inline sockaddr const * |
| 791 | NetVConnection::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 | |
| 803 | inline std::optional<std::string_view> |
| 804 | NetVConnection::get_proxy_protocol_tlv(const uint8_t tlvCode) const |
no test coverage detected