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

Function getClientAddr

plugins/header_rewrite/conditions.cc:1738–1760  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1736}
1737
1738static const struct sockaddr *
1739getClientAddr(TSHttpTxn txnp, int txn_private_slot)
1740{
1741 const struct sockaddr *addr = nullptr;
1742 int addr_len;
1743
1744 PrivateSlotData private_data;
1745 private_data.raw = reinterpret_cast<uint64_t>(TSUserArgGet(txnp, txn_private_slot));
1746 switch (private_data.ip_source) {
1747 case IP_SRC_PEER:
1748 addr = TSHttpTxnClientAddrGet(txnp);
1749 break;
1750 case IP_SRC_PROXY:
1751 TSVConnPPInfoGet(TSHttpSsnClientVConnGet(TSHttpTxnSsnGet(txnp)), TS_PP_INFO_SRC_ADDR, reinterpret_cast<const char **>(&addr),
1752 &addr_len);
1753 break;
1754 default:
1755 Dbg(pi_dbg_ctl, "Unknown IP source (%d) was specified", private_data.ip_source);
1756 addr = TSHttpTxnClientAddrGet(txnp);
1757 break;
1758 }
1759 return addr;
1760}

Callers 2

evalMethod · 0.85
append_valueMethod · 0.85

Calls 5

TSUserArgGetFunction · 0.85
TSHttpTxnClientAddrGetFunction · 0.85
TSVConnPPInfoGetFunction · 0.85
TSHttpSsnClientVConnGetFunction · 0.85
TSHttpTxnSsnGetFunction · 0.85

Tested by

no test coverage detected