acl_ip_data::acl_ip_data () :addr1(), addr2(), mask(), next (NULL) {}
-acl_ip_data::acl_ip_data (IpAddress const &anAddress1, IPAddress const &anAddress2, IPAddress const &aMask, acl_ip_data *aNext) : addr1(anAddress1), addr2(anAddress2), mask(aMask), next(aNext) {}
+acl_ip_data::acl_ip_data (IpAddress const &anAddress1, IpAddress const &anAddress2, IPAddress const &aMask, acl_ip_data *aNext) : addr1(anAddress1), addr2(anAddress2), mask(aMask), next(aNext) {}
acl_ip_data ();
- acl_ip_data (IpAddress const &, IPAddress const &, IPAddress const &, acl_ip_data *);
+ acl_ip_data (IpAddress const &, IpAddress const &, IPAddress const &, acl_ip_data *);
void toStr(char *buf, int len) const;
IpAddress addr1;
static void free_denyinfo(acl_deny_info_list ** var);
#if USE_WCCPv2
-static void parse_IpAddress_list(IPAddress_list **);
-static void dump_IpAddress_list(StoreEntry *, const char *, const IPAddress_list *);
-static void free_IpAddress_list(IPAddress_list **);
+static void parse_IpAddress_list(IpAddress_list **);
+static void dump_IpAddress_list(StoreEntry *, const char *, const IpAddress_list *);
+static void free_IpAddress_list(IpAddress_list **);
#if CURRENTLY_UNUSED
-static int check_null_IpAddress_list(const IPAddress_list *);
+static int check_null_IpAddress_list(const IpAddress_list *);
#endif /* CURRENTLY_UNUSED */
#endif /* USE_WCCPv2 */
#if USE_WCCPv2
void
-parse_IpAddress_list_token(IPAddress_list ** head, char *token)
+parse_IpAddress_list_token(IpAddress_list ** head, char *token)
{
char *t;
char *host;
}
static void
-parse_IpAddress_list(IPAddress_list ** head)
+parse_IpAddress_list(IpAddress_list ** head)
{
char *token;
}
static void
-dump_IpAddress_list(StoreEntry * e, const char *n, const IPAddress_list * s)
+dump_IpAddress_list(StoreEntry * e, const char *n, const IpAddress_list * s)
{
char ntoabuf[MAX_IPSTRLEN];
}
static void
-free_IpAddress_list(IPAddress_list ** head)
+free_IpAddress_list(IpAddress_list ** head)
{
if (*head) delete *head;
*head = NULL;
static int connKeepReadingIncompleteRequest(ConnStateData * conn);
static void connCancelIncompleteRequests(ConnStateData * conn);
-static ConnStateData *connStateCreate(const IpAddress &peer, const IPAddress &me, int fd, http_port_list *port);
+static ConnStateData *connStateCreate(const IpAddress &peer, const IpAddress &me, int fd, http_port_list *port);
int
}
ConnStateData *
-connStateCreate(const IpAddress &peer, const IPAddress &me, int fd, http_port_list *port)
+connStateCreate(const IpAddress &peer, const IpAddress &me, int fd, http_port_list *port)
{
ConnStateData *result = new ConnStateData;
static hash_table *addr_table = NULL;
static hash_table *host_table = NULL;
-IpAddress networkFromInaddr(const IPAddress &a);
+IpAddress networkFromInaddr(const IpAddress &a);
static void netdbRelease(netdbEntry * n);
static void netdbHashInsert(netdbEntry * n, IpAddress &addr);
* start a TCP connection to the peer host on port 113
*/
void
-identStart(IpAddress &me, IPAddress &my_peer, IDCB * callback, void *data)
+identStart(IpAddress &me, IpAddress &my_peer, IDCB * callback, void *data)
{
IdentStateData *state;
int fd;
class IpAddress;
/// \ingroup IdentAPI
-SQUIDCEXTERN void identStart(IpAddress &me, IPAddress &my_peer, IDCB * callback, void *cbdata);
+SQUIDCEXTERN void identStart(IpAddress &me, IpAddress &my_peer, IDCB * callback, void *cbdata);
/// \ingroup IdentAPI
SQUIDCEXTERN void identInit(void);
/*
- * $Id: IpAddress.cc,v 1.4 2008/02/15 09:45:57 amosjeffries Exp $
- *
* DEBUG: section 14 IP Storage and Handling
* AUTHOR: Amos Jeffries
*
}
#endif
-IpAddress::IPAddress()
+IpAddress::IpAddress()
{
SetEmpty();
}
-IpAddress::~IPAddress()
+IpAddress::~IpAddress()
{
memset(this,0,sizeof(IpAddress));
}
return len;
}
-const int IpAddress::ApplyMask(IPAddress const &mask_addr)
+const int IpAddress::ApplyMask(IpAddress const &mask_addr)
{
uint32_t *p1 = (uint32_t*)(&m_SocketAddr.sin6_addr);
uint32_t const *p2 = (uint32_t const *)(&mask_addr.m_SocketAddr.sin6_addr);
return false;
}
-IpAddress& IPAddress::operator =(const IPAddress &s)
+IpAddress& IpAddress::operator =(const IPAddress &s)
{
memcpy(this, &s, sizeof(IpAddress));
return *this;
};
-IpAddress::IPAddress(const char*s)
+IpAddress::IpAddress(const char*s)
{
SetEmpty();
operator=(s);
return true;
}
-IpAddress::IPAddress(struct sockaddr_in const &s)
+IpAddress::IpAddress(struct sockaddr_in const &s)
{
SetEmpty();
operator=(s);
};
-IpAddress& IPAddress::operator =(struct sockaddr_in const &s)
+IpAddress& IpAddress::operator =(struct sockaddr_in const &s)
{
#if USE_IPV6
Map4to6((const in_addr)s.sin_addr, m_SocketAddr.sin6_addr);
return *this;
};
-IpAddress& IPAddress::operator =(const struct sockaddr_storage &s)
+IpAddress& IpAddress::operator =(const struct sockaddr_storage &s)
{
#if USE_IPV6
/* some AF_* magic to tell socket types apart and what we need to do */
}
#if USE_IPV6
-IpAddress::IPAddress(struct sockaddr_in6 const &s)
+IpAddress::IpAddress(struct sockaddr_in6 const &s)
{
SetEmpty();
operator=(s);
};
-IpAddress& IPAddress::operator =(struct sockaddr_in6 const &s)
+IpAddress& IpAddress::operator =(struct sockaddr_in6 const &s)
{
memcpy(&m_SocketAddr, &s, sizeof(struct sockaddr_in6));
#endif
-IpAddress::IPAddress(struct in_addr const &s)
+IpAddress::IpAddress(struct in_addr const &s)
{
SetEmpty();
operator=(s);
};
-IpAddress& IPAddress::operator =(struct in_addr const &s)
+IpAddress& IpAddress::operator =(struct in_addr const &s)
{
#if USE_IPV6
Map4to6((const in_addr)s, m_SocketAddr.sin6_addr);
#if USE_IPV6
-IpAddress::IPAddress(struct in6_addr const &s)
+IpAddress::IpAddress(struct in6_addr const &s)
{
SetEmpty();
operator=(s);
};
-IpAddress& IPAddress::operator =(struct in6_addr const &s)
+IpAddress& IpAddress::operator =(struct in6_addr const &s)
{
memcpy(&m_SocketAddr.sin6_addr, &s, sizeof(struct in6_addr));
#endif
-IpAddress::IPAddress(const IPAddress &s)
+IpAddress::IpAddress(const IPAddress &s)
{
SetEmpty();
operator=(s);
}
-IpAddress::IPAddress(IPAddress *s)
+IpAddress::IpAddress(IPAddress *s)
{
SetEmpty();
operator=(s);
}
-IpAddress& IPAddress::operator =(IPAddress *s)
+IpAddress& IpAddress::operator =(IPAddress *s)
{
IpAddress *tmp = NULL;
if (!s) return *this;
return operator=(*tmp);
}
-IpAddress::IPAddress(const struct hostent &s)
+IpAddress::IpAddress(const struct hostent &s)
{
SetEmpty();
operator=(s);
return true;
}
-IpAddress::IPAddress(const struct addrinfo &s)
+IpAddress::IpAddress(const struct addrinfo &s)
{
SetEmpty();
operator=(s);
ai = NULL;
}
-int IpAddress::matchIPAddr(const IPAddress &rhs) const
+int IpAddress::matchIPAddr(const IpAddress &rhs) const
{
#if USE_IPV6
uint8_t *l = (uint8_t*)m_SocketAddr.sin6_addr.s6_addr;
return 0;
}
-bool IpAddress::operator ==(const IPAddress &s) const
+bool IpAddress::operator ==(const IpAddress &s) const
{
return (0 == matchIPAddr(s));
}
-bool IpAddress::operator !=(const IPAddress &s) const
+bool IpAddress::operator !=(const IpAddress &s) const
{
return ! ( operator==(s) );
}
-bool IpAddress::operator <=(const IPAddress &rhs) const
+bool IpAddress::operator <=(const IpAddress &rhs) const
{
if (IsAnyAddr() && !rhs.IsAnyAddr())
return true;
return (matchIPAddr(rhs) <= 0);
}
-bool IpAddress::operator >=(const IPAddress &rhs) const
+bool IpAddress::operator >=(const IpAddress &rhs) const
{
if (IsNoAddr() && !rhs.IsNoAddr())
return true;
return ( matchIPAddr(rhs) >= 0);
}
-bool IpAddress::operator >(const IPAddress &rhs) const
+bool IpAddress::operator >(const IpAddress &rhs) const
{
if (IsNoAddr() && !rhs.IsNoAddr())
return true;
return ( matchIPAddr(rhs) > 0);
}
-bool IpAddress::operator <(const IPAddress &rhs) const
+bool IpAddress::operator <(const IpAddress &rhs) const
{
if (IsNoAddr() && !rhs.IsNoAddr())
return true;
/*
- * $Id: IpAddress.h,v 1.3 2008/02/05 22:39:42 amosjeffries Exp $
- *
* DEBUG: section 14 IP Storage and Handling
* AUTHOR: Amos Jeffries
*
/** @name Constructors and Destructor */
/*@{*/
IpAddress();
- IpAddress(const IPAddress &);
+ IpAddress(const IpAddress &);
/**
* This constructor takes its own copy of the object pointed to for memory-safe usage later.
\deprecated Use of pointers can be nasty. Consider this a last-resort.
* Prefer the by-reference (&) version instead.
*/
- IpAddress(IPAddress *);
+ IpAddress(IpAddress *);
IpAddress(const struct in_addr &);
/** @name Assignment Operators */
/*@{*/
- IpAddress& operator =(const IPAddress &s);
- IpAddress& operator =(IPAddress *s);
+ IpAddress& operator =(const IpAddress &s);
+ IpAddress& operator =(IpAddress *s);
IpAddress& operator =(struct sockaddr_in const &s);
IpAddress& operator =(struct sockaddr_storage const &s);
IpAddress& operator =(struct in_addr const &s);
* Some situations may also require an actual call to the system getaddrinfo()
* to pull relevant OS details for the socket.
\par
- * IpAddress allocated objects MUST be destructed by IPAddress::FreeAddrInfo
+ * IpAddress allocated objects MUST be destructed by IpAddress::FreeAddrInfo
* System getaddrinfo() allocated objects MUST be freed with system freeaddrinfo()
\par
* Some OS require that IPv4 addresses are pre-mapped by the client.
}
int
-IpIntercept::NetfilterInterception(int fd, const IpAddress &me, IPAddress &dst, int silent)
+IpIntercept::NetfilterInterception(int fd, const IpAddress &me, IpAddress &dst, int silent)
{
#if LINUX_NETFILTER
struct addrinfo *lookup = NULL;
}
int
-IpIntercept::NetfilterTransparent(int fd, const IpAddress &me, IPAddress &client, int silent)
+IpIntercept::NetfilterTransparent(int fd, const IpAddress &me, IpAddress &client, int silent)
{
#if LINUX_NETFILTER
}
int
-IpIntercept::IpfwInterception(int fd, const IpAddress &me, IPAddress &dst, int silent)
+IpIntercept::IpfwInterception(int fd, const IpAddress &me, IpAddress &dst, int silent)
{
#if IPFW_TRANSPARENT
struct addrinfo *lookup = NULL;
}
int
-IpIntercept::NatLookup(int fd, const IpAddress &me, const IPAddress &peer, IPAddress &client, IPAddress &dst)
+IpIntercept::NatLookup(int fd, const IpAddress &me, const IpAddress &peer, IPAddress &client, IPAddress &dst)
{
#if IPF_TRANSPARENT /* --enable-ipf-transparent */
client = me;
~IpIntercept() {};
/** Perform NAT lookups */
- int NatLookup(int fd, const IpAddress &me, const IPAddress &peer, IPAddress &client, IPAddress &dst);
+ int NatLookup(int fd, const IpAddress &me, const IpAddress &peer, IPAddress &client, IPAddress &dst);
#if LINUX_TPROXY2
// only relevant to TPROXY v2 connections.
\retval 0 Successfuly located the new address.
\retval -1 An error occured during NAT lookups.
*/
- int NetfilterInterception(int fd, const IpAddress &me, IPAddress &client, int silent);
+ int NetfilterInterception(int fd, const IpAddress &me, IpAddress &client, int silent);
/**
* perform Lookups on Netfilter fully-transparent interception targets (TPROXY).
\retval 0 Successfuly located the new address.
\retval -1 An error occured during NAT lookups.
*/
- int NetfilterTransparent(int fd, const IpAddress &me, IPAddress &dst, int silent);
+ int NetfilterTransparent(int fd, const IpAddress &me, IpAddress &dst, int silent);
/**
* perform Lookups on IPFW interception.
\retval 0 Successfuly located the new address.
\retval -1 An error occured during NAT lookups.
*/
- int IpfwInterception(int fd, const IpAddress &me, IPAddress &client, int silent);
+ int IpfwInterception(int fd, const IpAddress &me, IpAddress &client, int silent);
int transparent_active;
if (ipcount > 0) {
int j, k;
- i->addrs.in_addrs = (IpAddress *)xcalloc(ipcount, sizeof(IPAddress));
+ i->addrs.in_addrs = (IpAddress *)xcalloc(ipcount, sizeof(IpAddress));
for (int l = 0; l < ipcount; l++)
i->addrs.in_addrs[l].SetEmpty(); // perform same init actions as constructor would.
i->addrs.bad_mask = (unsigned char *)xcalloc(ipcount, sizeof(unsigned char));
return 0;
}
- i->addrs.in_addrs = (IpAddress *)xcalloc(na, sizeof(IPAddress));
+ i->addrs.in_addrs = (IpAddress *)xcalloc(na, sizeof(IpAddress));
for (int l = 0; l < na; l++)
i->addrs.in_addrs[l].SetEmpty(); // perform same init actions as constructor would.
i->addrs.bad_mask = (unsigned char *)xcalloc(na, sizeof(unsigned char));
memset(&lru_list, '\0', sizeof(lru_list));
memset(&static_addrs, '\0', sizeof(ipcache_addrs));
- static_addrs.in_addrs = (IpAddress *)xcalloc(1, sizeof(IPAddress));
+ static_addrs.in_addrs = (IpAddress *)xcalloc(1, sizeof(IpAddress));
static_addrs.in_addrs->SetEmpty(); // properly setup the IpAddress!
static_addrs.bad_mask = (unsigned char *)xcalloc(1, sizeof(unsigned char));
ipcache_high = (long) (((float) Config.ipcache.size *
debugs(14, 5, "ipcacheMergeIPLists: Merge " << alen << "+" << blen << " into " << fc << " unique IPs.");
// copy the old IPs into the new list buffer.
- (*out) = (IpAddress*)xcalloc(fc, sizeof(IPAddress));
+ (*out) = (IpAddress*)xcalloc(fc, sizeof(IpAddress));
outlen=0;
assert(out != NULL);
i->addrs.cur = 0;
i->addrs.badcount = 0;
- i->addrs.in_addrs = (IpAddress *)xcalloc(1, sizeof(IPAddress));
+ i->addrs.in_addrs = (IpAddress *)xcalloc(1, sizeof(IpAddress));
i->addrs.bad_mask = (unsigned char *)xcalloc(1, sizeof(unsigned char));
i->addrs.in_addrs[0] = ip;
i->addrs.bad_mask[0] = FALSE;
SQUIDCEXTERN void requirePathnameExists(const char *name, const char *path);
SQUIDCEXTERN void parse_time_t(time_t * var);
-SQUIDCEXTERN void parse_IpAddress_list_token(IPAddress_list **, char *);
+SQUIDCEXTERN void parse_IpAddress_list_token(IpAddress_list **, char *);
/* client_side.c - FD related client side routines */
SQUIDCEXTERN void addr2oid(IpAddress &addr, oid *Dest);
SQUIDCEXTERN void oid2addr(oid *Dest, IpAddress &addr, u_int code);
-SQUIDCEXTERN IpAddress *client_entry(IPAddress *current);
+SQUIDCEXTERN IpAddress *client_entry(IpAddress *current);
SQUIDCEXTERN variable_list *snmp_basicFn(variable_list *, snint *);
SQUIDCEXTERN variable_list *snmp_confFn(variable_list *, snint *);
SQUIDCEXTERN variable_list *snmp_sysFn(variable_list *, snint *);