// single global instance for access by other components.
-IpIntercept IpInterceptor;
+Ip::Intercept Ip::Interceptor;
void
-IpIntercept::StopTransparency(const char *str)
+Ip::Intercept::StopTransparency(const char *str)
{
if (transparent_active) {
debugs(89, DBG_IMPORTANT, "Stopping full transparency: " << str);
}
void
-IpIntercept::StopInterception(const char *str)
+Ip::Intercept::StopInterception(const char *str)
{
if (intercept_active) {
debugs(89, DBG_IMPORTANT, "Stopping IP interception: " << str);
}
int
-IpIntercept::NetfilterInterception(int fd, const IpAddress &me, IpAddress &dst, int silent)
+Ip::Intercept::NetfilterInterception(int fd, const Ip::Address &me, Ip::Address &dst, int silent)
{
#if LINUX_NETFILTER
struct addrinfo *lookup = NULL;
dst = *lookup;
}
- dst.FreeAddrInfo(lookup);
+ Address::FreeAddrInfo(lookup);
if (me != dst) {
debugs(89, 5, HERE << "address NAT: me= " << me << ", dst= " << dst);
}
int
-IpIntercept::NetfilterTransparent(int fd, const IpAddress &me, IpAddress &client, int silent)
+Ip::Intercept::NetfilterTransparent(int fd, const Ip::Address &me, Ip::Address &client, int silent)
{
#if LINUX_NETFILTER
}
int
-IpIntercept::IpfwInterception(int fd, const IpAddress &me, IpAddress &dst, int silent)
+Ip::Intercept::IpfwInterception(int fd, const Ip::Address &me, Ip::Address &dst, int silent)
{
#if IPFW_TRANSPARENT
struct addrinfo *lookup = NULL;
dst = *lookup;
}
- dst.FreeAddrInfo(lookup);
+ Address::FreeAddrInfo(lookup);
if (me != dst) {
debugs(89, 5, HERE << "address NAT: me= " << me << ", dst= " << dst);
}
int
-IpIntercept::IpfInterception(int fd, const IpAddress &me, IpAddress &client, IpAddress &dst, int silent)
+Ip::Intercept::IpfInterception(int fd, const Ip::Address &me, Ip::Address &client, Ip::Address &dst, int silent)
{
#if IPF_TRANSPARENT /* --enable-ipf-transparent */
}
int
-IpIntercept::PfInterception(int fd, const IpAddress &me, IpAddress &client, IpAddress &dst, int silent)
+Ip::Intercept::PfInterception(int fd, const Ip::Address &me, Ip::Address &client, Ip::Address &dst, int silent)
{
#if PF_TRANSPARENT /* --enable-pf-transparent */
int
-IpIntercept::NatLookup(int fd, const IpAddress &me, const IpAddress &peer, IpAddress &client, IpAddress &dst)
+Ip::Intercept::NatLookup(int fd, const Ip::Address &me, const Ip::Address &peer, Ip::Address &client, Ip::Address &dst)
{
/* --enable-linux-netfilter */
/* --enable-ipfw-transparent */
#if LINUX_TPROXY2
int
-IpIntercept::SetTproxy2OutgoingAddr(int fd, const IpAddress &src)
+Ip::Intercept::SetTproxy2OutgoingAddr(int fd, const Ip::Address &src)
{
- IpAddress addr;
+ Address addr;
struct in_tproxy itp;
src.GetInAddr(itp.v.addr.faddr);
#endif
bool
-IpIntercept::ProbeForTproxy(IpAddress &test)
+Ip::Intercept::ProbeForTproxy(Ip::Address &test)
{
debugs(3, 3, "Detect TPROXY support on port " << test);
#if LINUX_TPROXY2
debugs(3, 3, "...Probing for IPv6 TPROXY support.");
struct sockaddr_in6 tmp_ip6;
- IpAddress tmp = "::2";
+ Ip::Address tmp = "::2";
tmp.SetPort(0);
tmp.GetSockAddr(tmp_ip6);
debugs(3, 3, "...Probing for IPv4 TPROXY support.");
struct sockaddr_in tmp_ip4;
- IpAddress tmp = "127.0.0.2";
+ Ip::Address tmp = "127.0.0.2";
tmp.SetPort(0);
tmp.GetSockAddr(tmp_ip4);