#include <squid_windows.h>
#endif
#include "squid.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
#ifdef _SQUID_WIN32_
struct arpreq {
- IPAddress arp_pa; /* protocol address */
+ IpAddress arp_pa; /* protocol address */
struct sockaddr arp_ha; /* hardware address */
int arp_flags; /* flags */
#endif
static void aclParseArpList(SplayNode<acl_arp_data *> **curlist);
static int decode_eth(const char *asc, char *eth);
-static int aclMatchArp(SplayNode<acl_arp_data *> **dataptr, IPAddress &c);
+static int aclMatchArp(SplayNode<acl_arp_data *> **dataptr, IpAddress &c);
static SplayNode<acl_arp_data *>::SPLAYCMP aclArpCompare;
static SplayNode<acl_arp_data *>::SPLAYWALKEE aclDumpArpListWalkee;
/* aclMatchArp */
/***************/
int
-aclMatchArp(SplayNode<acl_arp_data *> **dataptr, IPAddress &c)
+aclMatchArp(SplayNode<acl_arp_data *> **dataptr, IpAddress &c)
{
struct arpreq arpReq;
struct sockaddr_in *sa = NULL;
- IPAddress ipAddr = c;
+ IpAddress ipAddr = c;
#if defined(_SQUID_LINUX_)
#include "CbDataList.h"
#include "ACLStrategised.h"
#include "ACLChecklist.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
-SQUIDCEXTERN int asnMatchIp(CbDataList<int> *, IPAddress &);
+SQUIDCEXTERN int asnMatchIp(CbDataList<int> *, IpAddress &);
/// \ingroup ACLAPI
SQUIDCEXTERN void asnInit(void);
SQUIDCEXTERN void asnFreeMemory(void);
/// \ingroup ACLAPI
-class ACLASN : public ACLData<IPAddress>
+class ACLASN : public ACLData<IpAddress>
{
public:
virtual ~ACLASN();
- virtual bool match(IPAddress);
+ virtual bool match(IpAddress);
virtual wordlist *dump();
virtual void parse();
bool empty() const;
- virtual ACLData<IPAddress> *clone() const;
+ virtual ACLData<IpAddress> *clone() const;
virtual void prepareForUse();
private:
static ACL::Prototype SourceRegistryProtoype;
- static ACLStrategised<IPAddress> SourceRegistryEntry_;
+ static ACLStrategised<IpAddress> SourceRegistryEntry_;
static ACL::Prototype DestinationRegistryProtoype;
- static ACLStrategised<IPAddress> DestinationRegistryEntry_;
+ static ACLStrategised<IpAddress> DestinationRegistryEntry_;
CbDataList<int> *data;
};
const acl_access *accessList;
- IPAddress src_addr;
+ IpAddress src_addr;
- IPAddress dst_addr;
+ IpAddress dst_addr;
- IPAddress my_addr;
+ IpAddress my_addr;
struct peer *dst_peer;
#include "ACLASN.h"
#include "ACLStrategy.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
/// \ingroup ACLAPI
-class ACLDestinationASNStrategy : public ACLStrategy<IPAddress>
+class ACLDestinationASNStrategy : public ACLStrategy<IpAddress>
{
public:
int
aclIpAddrNetworkCompare(acl_ip_data * const &p, acl_ip_data * const &q)
{
- IPAddress A = p->addr1;
+ IpAddress A = p->addr1;
/* apply netmask */
A.ApplyMask(q->mask);
* This function should NOT be called if 'asc' is a hostname!
*/
bool
-acl_ip_data::DecodeMask(const char *asc, IPAddress &mask, int ctype)
+acl_ip_data::DecodeMask(const char *asc, IpAddress &mask, int ctype)
{
char junk;
int a1 = 0;
LOCAL_ARRAY(char, mask, 256);
acl_ip_data *r = NULL;
acl_ip_data **Q = NULL;
- IPAddress temp;
+ IpAddress temp;
char c;
unsigned int changed;
acl_ip_data *q = new acl_ip_data;
/*
* Note, must use plain xgetaddrinfo() here because at startup
* ipcache hasn't been initialized
- * TODO: offload this to one of the IPAddress lookups.
+ * TODO: offload this to one of the IpAddress lookups.
*/
debugs(28, 5, "aclIpParseIpData: Lookup Host/IP " << addr1);
struct addrinfo *hp = NULL, *x = NULL;
struct addrinfo hints;
- IPAddress *prev_addr = NULL;
+ IpAddress *prev_addr = NULL;
memset(&hints, 0, sizeof(struct addrinfo));
}
int
-ACLIP::match(IPAddress &clientip)
+ACLIP::match(IpAddress &clientip)
{
static acl_ip_data ClientAddress;
/*
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) {}
#include "ACL.h"
#include "splay.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
/// \ingroup ACLAPI
class acl_ip_data
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;
+ IpAddress addr1;
- IPAddress addr2;
+ IpAddress addr2;
- IPAddress mask; /**< \todo This should perhapse be stored as a CIDR range now instead of a full IP mask. */
+ IpAddress mask; /**< \todo This should perhapse be stored as a CIDR range now instead of a full IP mask. */
acl_ip_data *next; /**< used for parsing, not for storing */
private:
- static bool DecodeMask(const char *asc, IPAddress &mask, int string_format_type);
+ static bool DecodeMask(const char *asc, IpAddress &mask, int string_format_type);
};
MEMPROXY_CLASS_INLINE(acl_ip_data);
protected:
- int match(IPAddress &);
+ int match(IpAddress &);
IPSplay *data;
private:
int
ACLMaxUserIP::match(AuthUserRequest * auth_user_request,
- IPAddress const &src_addr)
+ IpAddress const &src_addr)
{
/*
* the logic for flush the ip list when the limit is hit vs keep
static Prototype RegistryProtoype;
static ACLMaxUserIP RegistryEntry_;
- int match(AuthUserRequest *, IPAddress const &);
+ int match(AuthUserRequest *, IpAddress const &);
char const *class_;
int maximum;
class ACLChecklist;
#include "ACLStrategy.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
-class ACLSourceASNStrategy : public ACLStrategy<IPAddress>
+class ACLSourceASNStrategy : public ACLStrategy<IpAddress>
{
public:
#include "HttpVersion.h"
#include "HttpRequestMethod.h"
#include "HierarchyLogEntry.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
#include "HttpRequestMethod.h"
/* forward decls */
{;
}
- IPAddress caddr;
+ IpAddress caddr;
int64_t requestSize;
int64_t replySize;
int64_t highOffset;
}
void
-AuthUser::removeIp(IPAddress ipaddr)
+AuthUser::removeIp(IpAddress ipaddr)
{
auth_user_ip_t *ipdata = (auth_user_ip_t *) ip_list.head;
}
void
-AuthUser::addIp(IPAddress ipaddr)
+AuthUser::addIp(IpAddress ipaddr)
{
auth_user_ip_t *ipdata = (auth_user_ip_t *) ip_list.head;
int found = 0;
/* for auth_type_t */
#include "enums.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
#include "dlink.h"
/**
_SQUID_INLINE_ char const *username() const;
_SQUID_INLINE_ void username(char const *);
void clearIp();
- void removeIp(IPAddress);
- void addIp(IPAddress);
+ void removeIp(IpAddress);
+ void addIp(IpAddress);
_SQUID_INLINE_ void addRequest(AuthUserRequest *);
void lock();
}
static void
-authenticateAuthUserRequestSetIp(AuthUserRequest * auth_user_request, IPAddress &ipaddr)
+authenticateAuthUserRequestSetIp(AuthUserRequest * auth_user_request, IpAddress &ipaddr)
{
AuthUser *auth_user = auth_user_request->user();
}
void
-authenticateAuthUserRequestRemoveIp(AuthUserRequest * auth_user_request, IPAddress const &ipaddr)
+authenticateAuthUserRequestRemoveIp(AuthUserRequest * auth_user_request, IpAddress const &ipaddr)
{
AuthUser *auth_user = auth_user_request->user();
* Caller is responsible for locking and unlocking their *auth_user_request!
*/
auth_acl_t
-AuthUserRequest::authenticate(AuthUserRequest ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData * conn, IPAddress &src_addr)
+AuthUserRequest::authenticate(AuthUserRequest ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData * conn, IpAddress &src_addr)
{
const char *proxy_auth;
assert(headertype != 0);
auth_acl_t
-AuthUserRequest::tryToAuthenticateAndSetAuthUser(AuthUserRequest ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData * conn, IPAddress &src_addr)
+AuthUserRequest::tryToAuthenticateAndSetAuthUser(AuthUserRequest ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData * conn, IpAddress &src_addr)
{
/* If we have already been called, return the cached value */
AuthUserRequest *t = authTryGetUser (auth_user_request, conn, request);
dlink_node node;
/* IP addr this user authenticated from */
- IPAddress ipaddr;
+ IpAddress ipaddr;
time_t ip_expiretime;
};
virtual void user(AuthUser *aUser) {_auth_user=aUser;}
- static auth_acl_t tryToAuthenticateAndSetAuthUser(AuthUserRequest **, http_hdr_type, HttpRequest *, ConnStateData *, IPAddress &);
+ static auth_acl_t tryToAuthenticateAndSetAuthUser(AuthUserRequest **, http_hdr_type, HttpRequest *, ConnStateData *, IpAddress &);
static void addReplyAuthHeader(HttpReply * rep, AuthUserRequest * auth_user_request, HttpRequest * request, int accelerated, int internal);
AuthUserRequest();
private:
- static auth_acl_t authenticate(AuthUserRequest ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData * conn, IPAddress &src_addr);
+ static auth_acl_t authenticate(AuthUserRequest ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData * conn, IpAddress &src_addr);
/** return a message on the 407 error pages */
char *message;
extern void authenticateAddTrailer(HttpReply *, AuthUserRequest *, HttpRequest *, int);
/// \ingroup AuthAPI
-extern void authenticateAuthUserRequestRemoveIp(AuthUserRequest *, IPAddress const &);
+extern void authenticateAuthUserRequestRemoveIp(AuthUserRequest *, IpAddress const &);
/// \ingroup AuthAPI
extern void authenticateAuthUserRequestClearIp(AuthUserRequest *);
/// \ingroup AuthAPI
#include "DelayPools.h"
#include "DelayIdComposite.h"
#include "CommRead.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
class StoreEntry;
public:
CompositeSelectionDetails() {}
- IPAddress src_addr;
+ IpAddress src_addr;
AuthUserRequest *user;
String tag;
};
#ifndef _SQUIDCONNECTIONDETAIL_H_
#define _SQUIDCONNECTIONDETAIL_H_
-#include "IPAddress.h"
+#include "IpAddress.h"
class ConnectionDetail
{
ConnectionDetail();
- IPAddress me;
+ IpAddress me;
- IPAddress peer;
+ IpAddress peer;
};
#endif
#include "ESIExpression.h"
#include "HttpRequest.h"
#include "MemBuf.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
/* quick reference on behaviour here.
* The ESI specification 1.0 requires the ESI processor to be able to
/* don't touch incoming, it's a pointer into buffered anyway */
}
-extern ErrorState *clientBuildError (err_type, http_status, char const *, IPAddress &, HttpRequest *);
+extern ErrorState *clientBuildError (err_type, http_status, char const *, IpAddress &, HttpRequest *);
/* This can ONLY be used before we have sent *any* data to the client */
ConnStateData *pinned_connection;
public:
- IPAddress host_addr;
+ IpAddress host_addr;
AuthUserRequest *auth_user_request;
int max_forwards;
- IPAddress client_addr;
+ IpAddress client_addr;
#if FOLLOW_X_FORWARDED_FOR
- IPAddress indirect_client_addr;
+ IpAddress indirect_client_addr;
#endif /* FOLLOW_X_FORWARDED_FOR */
- IPAddress my_addr;
+ IpAddress my_addr;
HierarchyLogEntry hier;
_icp_common_t();
_icp_common_t(char *buf, unsigned int len);
- void handleReply(char *buf, IPAddress &from);
+ void handleReply(char *buf, IpAddress &from);
static _icp_common_t *createMessage(icp_opcode opcode, int flags, const char *url, int reqnum, int pad);
icp_opcode getOpCode() const;
#endif
HttpRequest *request;
int fd;
- IPAddress from;
+ IpAddress from;
char *url;
};
/// \ingroup ServerProtocolICPAPI
struct icpUdpData {
- IPAddress address;
+ IpAddress address;
void *msg;
size_t len;
icpUdpData *next;
};
/// \ingroup ServerProtocolICPAPI
-HttpRequest* icpGetRequest(char *url, int reqnum, int fd, IPAddress &from);
+HttpRequest* icpGetRequest(char *url, int reqnum, int fd, IpAddress &from);
/// \ingroup ServerProtocolICPAPI
-int icpAccessAllowed(IPAddress &from, HttpRequest * icp_request);
+int icpAccessAllowed(IpAddress &from, HttpRequest * icp_request);
/// \ingroup ServerProtocolICPAPI
-SQUIDCEXTERN void icpCreateAndSend(icp_opcode, int flags, char const *url, int reqnum, int pad, int fd, const IPAddress &from);
+SQUIDCEXTERN void icpCreateAndSend(icp_opcode, int flags, char const *url, int reqnum, int pad, int fd, const IpAddress &from);
/// \ingroup ServerProtocolICPAPI
extern icp_opcode icpGetCommonOpcode();
/// \ingroup ServerProtocolICPAPI
-SQUIDCEXTERN int icpUdpSend(int, const IPAddress &, icp_common_t *, log_type, int);
+SQUIDCEXTERN int icpUdpSend(int, const IpAddress &, icp_common_t *, log_type, int);
/// \ingroup ServerProtocolICPAPI
SQUIDCEXTERN log_type icpLogFromICPCode(icp_opcode opcode);
/// \ingroup ServerProtocolICPAPI
-void icpDenyAccess(IPAddress &from, char *url, int reqnum, int fd);
+void icpDenyAccess(IpAddress &from, char *url, int reqnum, int fd);
/// \ingroup ServerProtocolICPAPI
SQUIDCEXTERN PF icpHandleUdp;
SQUIDCEXTERN PF icpUdpSendQueue;
/// \ingroup ServerProtocolICPAPI
-SQUIDCEXTERN void icpHandleIcpV3(int, IPAddress &, char *, int);
+SQUIDCEXTERN void icpHandleIcpV3(int, IpAddress &, char *, int);
/// \ingroup ServerProtocolICPAPI
SQUIDCEXTERN int icpCheckUdpHit(StoreEntry *, HttpRequest * request);
#include "cbdata.h"
#include "PingData.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
class ps_state
{
void *callback_data;
FwdServer *servers;
/*
- * Why are these IPAddress instead of peer *? Because a
+ * Why are these IpAddress instead of peer *? Because a
* peer structure can become invalid during the peer selection
* phase, specifically after a reconfigure. Thus we need to lookup
* the peer * based on the address when we are finally ready to
* reference the peer structure.
*/
- IPAddress first_parent_miss;
+ IpAddress first_parent_miss;
- IPAddress closest_parent_miss;
+ IpAddress closest_parent_miss;
/*
* ->hit can be peer* because it should only be
* accessed during the thread when it is set
http_port_list *next;
- IPAddress s;
+ IpAddress s;
char *protocol; /* protocol name */
char *name; /* visible name */
char *defaultsite; /* default web site */
{
public:
uint8_t len;
- IPAddress addr;
+ IpAddress addr;
- m_ADDR() : len(sizeof(IPAddress)) {};
+ m_ADDR() : len(sizeof(IpAddress)) {};
};
/* END of definitions for radix tree entries */
/* PUBLIC */
int
-asnMatchIp(CbDataList<int> *data, IPAddress &addr)
+asnMatchIp(CbDataList<int> *data, IpAddress &addr)
{
struct squid_radix_node *rn;
as_info *e;
CbDataList<int> *q = NULL;
as_info *asinfo = NULL;
- IPAddress mask;
- IPAddress addr;
+ IpAddress mask;
+ IpAddress addr;
char *t;
int bitl;
CbDataList<int> *q;
as_info *asinfo;
char buf[MAX_IPSTRLEN];
- IPAddress addr;
- IPAddress mask;
+ IpAddress addr;
+ IpAddress mask;
assert(e);
assert(e->e_info);
bool
-ACLASN::match(IPAddress toMatch)
+ACLASN::match(IpAddress toMatch)
{
return asnMatchIp(data, toMatch);
}
}
}
-ACLData<IPAddress> *
+ACLData<IpAddress> *
ACLASN::clone() const
{
if (data)
/* explicit template instantiation required for some systems */
-template class ACLStrategised<IPAddress>;
+template class ACLStrategised<IpAddress>;
ACL::Prototype ACLASN::SourceRegistryProtoype(&ACLASN::SourceRegistryEntry_, "src_as");
-ACLStrategised<IPAddress> ACLASN::SourceRegistryEntry_(new ACLASN, ACLSourceASNStrategy::Instance(), "src_as");
+ACLStrategised<IpAddress> ACLASN::SourceRegistryEntry_(new ACLASN, ACLSourceASNStrategy::Instance(), "src_as");
ACL::Prototype ACLASN::DestinationRegistryProtoype(&ACLASN::DestinationRegistryEntry_, "dst_as");
-ACLStrategised<IPAddress> ACLASN::DestinationRegistryEntry_(new ACLASN, ACLDestinationASNStrategy::Instance(), "dst_as");
+ACLStrategised<IpAddress> ACLASN::DestinationRegistryEntry_(new ACLASN, ACLDestinationASNStrategy::Instance(), "dst_as");
int
-ACLSourceASNStrategy::match (ACLData<IPAddress> * &data, ACLChecklist *checklist)
+ACLSourceASNStrategy::match (ACLData<IpAddress> * &data, ACLChecklist *checklist)
{
return data->match(checklist->src_addr);
}
debugs(28, 3, "asnMatchAcl: Can't yet compare '" << "unknown" /*name*/ << "' ACL for '" << checklist->request->GetHost() << "'");
checklist->changeState (DestinationIPLookup::Instance());
} else {
- IPAddress noaddr;
+ IpAddress noaddr;
noaddr.SetNoAddr();
return data->match(noaddr);
}
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 */
}
static void
-dump_address(StoreEntry * entry, const char *name, IPAddress &addr)
+dump_address(StoreEntry * entry, const char *name, IpAddress &addr)
{
char buf[MAX_IPSTRLEN];
storeAppendPrintf(entry, "%s %s\n", name, addr.NtoA(buf,MAX_IPSTRLEN) );
}
static void
-parse_address(IPAddress *addr)
+parse_address(IpAddress *addr)
{
char *token = strtok(NULL, w_space);
}
static void
-free_address(IPAddress *addr)
+free_address(IpAddress *addr)
{
addr->SetEmpty();
}
#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;
char *tmp;
- IPAddress ipa;
+ IpAddress ipa;
unsigned short port;
- IPAddress_list *s;
+ IpAddress_list *s;
host = NULL;
port = 0;
while (*head)
head = &(*head)->next;
- s = static_cast<IPAddress_list *>(xcalloc(1, sizeof(*s)));
+ s = static_cast<IpAddress_list *>(xcalloc(1, sizeof(*s)));
s->s = ipa;
*head = s;
}
static void
-parse_IPAddress_list(IPAddress_list ** head)
+parse_IpAddress_list(IPAddress_list ** head)
{
char *token;
while ((token = strtok(NULL, w_space))) {
- parse_IPAddress_list_token(head, token);
+ parse_IpAddress_list_token(head, 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;
* be used by icp_port and htcp_port
*/
static int
-check_null_IPAddress_list(const IPAdress_list * s)
+check_null_IpAddress_list(const IPAdress_list * s)
{
return NULL == s;
}
static hash_table *client_table = NULL;
-static ClientInfo *clientdbAdd(const IPAddress &addr);
+static ClientInfo *clientdbAdd(const IpAddress &addr);
static FREE clientdbFreeItem;
static void clientdbStartGC(void);
static void clientdbScheduledGC(void *);
static ClientInfo *
-clientdbAdd(const IPAddress &addr)
+clientdbAdd(const IpAddress &addr)
{
ClientInfo *c;
char *buf = new char[MAX_IPSTRLEN];
}
void
-clientdbUpdate(const IPAddress &addr, log_type ltype, protocol_t p, size_t size)
+clientdbUpdate(const IpAddress &addr, log_type ltype, protocol_t p, size_t size)
{
char key[MAX_IPSTRLEN];
ClientInfo *c;
* -1. To get the current value, simply call with delta = 0.
*/
int
-clientdbEstablished(const IPAddress &addr, int delta)
+clientdbEstablished(const IpAddress &addr, int delta)
{
char key[MAX_IPSTRLEN];
ClientInfo *c;
#define CUTOFF_SECONDS 3600
int
-clientdbCutoffDenied(const IPAddress &addr)
+clientdbCutoffDenied(const IpAddress &addr)
{
char key[MAX_IPSTRLEN];
int NR;
#if SQUID_SNMP
-IPAddress *
-client_entry(IPAddress *current)
+IpAddress *
+client_entry(IpAddress *current)
{
ClientInfo *c = NULL;
char key[MAX_IPSTRLEN];
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;
result->port = cbdataReference(port);
if (port->intercepted || port->spoof_client_ip) {
- IPAddress client, dst;
+ IpAddress client, dst;
if (IpInterceptor.NatLookup(fd, me, peer, client, dst) == 0) {
result->me = client;
*/
ClientSocketContext::Pointer currentobject;
- IPAddress peer;
+ IpAddress peer;
- IPAddress me;
+ IpAddress me;
- IPAddress log_addr;
+ IpAddress log_addr;
char rfc931[USER_IDENT_SZ];
int nrequests;
/* Local functions */
extern "C" CSS clientReplyStatus;
-extern ErrorState *clientBuildError(err_type, http_status, char const *, IPAddress &, HttpRequest *);
+extern ErrorState *clientBuildError(err_type, http_status, char const *, IpAddress &, HttpRequest *);
/* privates */
void
clientReplyContext::setReplyToError(
err_type err, http_status status, const HttpRequestMethod& method, char const *uri,
- IPAddress &addr, HttpRequest * failedrequest, char *unparsedrequest,
+ IpAddress &addr, HttpRequest * failedrequest, char *unparsedrequest,
AuthUserRequest * auth_user_request)
{
ErrorState *errstate =
void
clientReplyContext::sendBodyTooLargeError()
{
- IPAddress tmp_noaddr;
+ IpAddress tmp_noaddr;
tmp_noaddr.SetNoAddr(); // TODO: make a global const
ErrorState *err = clientBuildError(ERR_TOO_BIG, HTTP_FORBIDDEN, NULL,
http->getConn() != NULL ? http->getConn()->peer : tmp_noaddr,
if (page_id == ERR_NONE)
page_id = ERR_ACCESS_DENIED;
- IPAddress tmp_noaddr;
+ IpAddress tmp_noaddr;
tmp_noaddr.SetNoAddr();
err = clientBuildError(page_id, HTTP_FORBIDDEN, NULL,
http->getConn() != NULL ? http->getConn()->peer : tmp_noaddr,
ErrorState *
clientBuildError(err_type page_id, http_status status, char const *url,
- IPAddress &src_addr, HttpRequest * request)
+ IpAddress &src_addr, HttpRequest * request)
{
ErrorState *err = errorCon(page_id, status, request);
err->src_addr = src_addr;
#include "clientStream.h"
#include "StoreClient.h"
#include "client_side_request.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
class ErrorState;
int storeOKTransferDone() const;
int storeNotOKTransferDone() const;
- void setReplyToError(err_type, http_status, const HttpRequestMethod&, char const *, IPAddress &, HttpRequest *, char *, AuthUserRequest *);
+ void setReplyToError(err_type, http_status, const HttpRequestMethod&, char const *, IpAddress &, HttpRequest *, char *, AuthUserRequest *);
void createStoreEntry(const HttpRequestMethod& m, request_flags flags);
void removeStoreReference(store_client ** scp, StoreEntry ** ep);
void removeClientStoreReference(store_client **scp, ClientHttpRequest *http);
clientStreamNode *node = (clientStreamNode *)http->client_stream.tail->prev->data;
clientReplyContext *repContext = dynamic_cast<clientReplyContext *>(node->data.getRaw());
assert (repContext);
- IPAddress tmpnoaddr;
+ IpAddress tmpnoaddr;
tmpnoaddr.SetNoAddr();
repContext->setReplyToError(page_id, status,
http->request->method, NULL,
// The original author of the code also wanted to pass an errno to
// setReplyToError, but it seems unlikely that the errno reflects the
// true cause of the error at this point, so I did not pass it.
- IPAddress noAddr;
+ IpAddress noAddr;
noAddr.SetNoAddr();
ConnStateData * c = getConn();
repContext->setReplyToError(ERR_ICAP_FAILURE, HTTP_INTERNAL_SERVER_ERROR,
#include "pconn.h"
#include "SquidTime.h"
#include "CommCalls.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
#include "DescriptorSet.h"
#include "icmp/net_db.h"
#include "ip/IpIntercept.h"
// defaults given by client
char *host;
u_short default_port;
- IPAddress default_addr;
+ IpAddress default_addr;
// NP: CANNOT store the default addr:port together as it gets set/reset differently.
- IPAddress S;
+ IpAddress S;
AsyncCall::Pointer callback;
int fd;
* synchronous wrapper around udp socket functions
*/
int
-comm_udp_recvfrom(int fd, void *buf, size_t len, int flags, IPAddress &from)
+comm_udp_recvfrom(int fd, void *buf, size_t len, int flags, IpAddress &from)
{
statCounter.syscalls.sock.recvfroms++;
int x = 0;
int
comm_udp_recv(int fd, void *buf, size_t len, int flags)
{
- IPAddress nul;
+ IpAddress nul;
return comm_udp_recvfrom(fd, buf, len, flags, nul);
}
u_short
comm_local_port(int fd)
{
- IPAddress temp;
+ IpAddress temp;
struct addrinfo *addr = NULL;
fde *F = &fd_table[fd];
int
comm_open(int sock_type,
int proto,
- IPAddress &addr,
+ IpAddress &addr,
int flags,
const char *note)
{
int
comm_openex(int sock_type,
int proto,
- IPAddress &addr,
+ IpAddress &addr,
int flags,
unsigned char TOS,
const char *note)
ConnectStateData::commResetFD()
{
struct addrinfo *AI = NULL;
- IPAddress nul;
+ IpAddress nul;
int new_family = AF_UNSPEC;
// XXX: do we have to check this?
}
int
-comm_connect_addr(int sock, const IPAddress &address)
+comm_connect_addr(int sock, const IpAddress &address)
{
comm_err_t status = COMM_OK;
fde *F = &fd_table[sock];
/* Send a udp datagram to specified TO_ADDR. */
int
comm_udp_sendto(int fd,
- const IPAddress &to_addr,
+ const IpAddress &to_addr,
const void *buf,
int len)
{
#include "AsyncCall.h"
#include "StoreIOBuffer.h"
#include "Array.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
#define COMMIO_FD_READCB(fd) (&commfd_table[(fd)].readcb)
#define COMMIO_FD_WRITECB(fd) (&commfd_table[(fd)].writecb)
SQUIDCEXTERN void commConnectStart(int fd, const char *, u_short, CNCB *, void *);
void commConnectStart(int fd, const char *, u_short, AsyncCall::Pointer &cb);
-SQUIDCEXTERN int comm_connect_addr(int sock, const IPAddress &addr);
+SQUIDCEXTERN int comm_connect_addr(int sock, const IpAddress &addr);
SQUIDCEXTERN void comm_init(void);
SQUIDCEXTERN void comm_exit(void);
-SQUIDCEXTERN int comm_open(int, int, IPAddress &, int, const char *note);
+SQUIDCEXTERN int comm_open(int, int, IpAddress &, int, const char *note);
-SQUIDCEXTERN int comm_openex(int, int, IPAddress &, int, unsigned char TOS, const char *);
+SQUIDCEXTERN int comm_openex(int, int, IpAddress &, int, unsigned char TOS, const char *);
SQUIDCEXTERN u_short comm_local_port(int fd);
SQUIDCEXTERN int comm_set_tos(int fd, int tos);
SQUIDCEXTERN void commSetSelect(int, unsigned int, PF *, void *, time_t);
SQUIDCEXTERN void commResetSelect(int);
-SQUIDCEXTERN int comm_udp_sendto(int sock, const IPAddress &to, const void *buf, int buflen);
+SQUIDCEXTERN int comm_udp_sendto(int sock, const IpAddress &to, const void *buf, int buflen);
extern void comm_write(int fd, const char *buf, int len, IOCB *callback, void *callback_data, FREE *func);
extern void comm_write(int fd, const char *buf, int size, AsyncCall::Pointer &callback, FREE * free_func = NULL);
SQUIDCEXTERN void comm_write_mbuf(int fd, MemBuf *mb, IOCB * handler, void *handler_data);
extern void comm_read(int fd, char *buf, int len, AsyncCall::Pointer &callback);
extern void comm_read_cancel(int fd, IOCB *callback, void *data);
extern void comm_read_cancel(int fd, AsyncCall::Pointer &callback);
-extern int comm_udp_recvfrom(int fd, void *buf, size_t len, int flags, IPAddress &from);
+extern int comm_udp_recvfrom(int fd, void *buf, size_t len, int flags, IpAddress &from);
extern int comm_udp_recv(int fd, void *buf, size_t len, int flags);
extern ssize_t comm_udp_send(int s, const void *buf, size_t len, int flags);
extern bool comm_has_incomplete_write(int);
#include "DelayBucket.h"
#include "DelayUser.h"
#include "DelayTagged.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
/// \ingroup DelayPoolsInternal
long DelayPools::MemoryUsed = 0;
virtual char const *label() const = 0;
- virtual unsigned int makeKey (IPAddress &src_addr) const = 0;
+ virtual unsigned int makeKey (IpAddress &src_addr) const = 0;
DelaySpec spec;
protected:
virtual char const *label() const {return "Individual";}
- virtual unsigned int makeKey (IPAddress &src_addr) const;
+ virtual unsigned int makeKey (IpAddress &src_addr) const;
};
protected:
virtual char const *label() const {return "Network";}
- virtual unsigned int makeKey (IPAddress &src_addr) const;
+ virtual unsigned int makeKey (IpAddress &src_addr) const;
};
/* don't use remote storage for these */
virtual char const *label() const {return "Individual";}
- virtual unsigned int makeKey (IPAddress &src_addr) const;
+ virtual unsigned int makeKey (IpAddress &src_addr) const;
- unsigned char makeHostKey (IPAddress &src_addr) const;
+ unsigned char makeHostKey (IpAddress &src_addr) const;
DelaySpec spec;
VectorMap<unsigned char, ClassCBucket> buckets;
}
unsigned int
-IndividualPool::makeKey (IPAddress &src_addr) const
+IndividualPool::makeKey (IpAddress &src_addr) const
{
/* FIXME INET6 : IPv6 requires a 64-128 bit result from this function */
if ( !src_addr.IsIPv4() )
}
unsigned int
-ClassCNetPool::makeKey (IPAddress &src_addr) const
+ClassCNetPool::makeKey (IpAddress &src_addr) const
{
/* FIXME INET6 : IPv6 requires a 64-128 bit result from this function */
if ( !src_addr.IsIPv4() )
}
unsigned char
-ClassCHostPool::makeHostKey (IPAddress &src_addr) const
+ClassCHostPool::makeHostKey (IpAddress &src_addr) const
{
/* FIXME INET6 : IPv6 requires a 64-128 bit result from this function */
if ( !src_addr.IsIPv4() )
}
unsigned int
-ClassCHostPool::makeKey (IPAddress &src_addr) const
+ClassCHostPool::makeKey (IpAddress &src_addr) const
{
/* FIXME INET6 : IPv6 requires a 64-128 bit result from this function */
if ( !src_addr.IsIPv4() )
};
struct _ns {
- IPAddress S;
+ IpAddress S;
int nqueries;
int nreplies;
nsvc *vc;
static IOCB idnsReadVCHeader;
static void idnsDoSendQueryVC(nsvc *vc);
-static int idnsFromKnownNameserver(IPAddress const &from);
+static int idnsFromKnownNameserver(IpAddress const &from);
static idns_query *idnsFindQuery(unsigned short id);
static void idnsGrokReply(const char *buf, size_t sz);
static PF idnsRead;
static void
idnsAddNameserver(const char *buf)
{
- IPAddress A;
+ IpAddress A;
if (!(A = buf)) {
debugs(78, 0, "WARNING: rejecting '" << buf << "' as a name server, because it is not a numeric IP address");
nameservers[ns].vc = vc;
vc->ns = ns;
- IPAddress addr;
+ IpAddress addr;
if (!Config.Addrs.udp_outgoing.IsNoAddr())
addr = Config.Addrs.udp_outgoing;
}
static int
-idnsFromKnownNameserver(IPAddress const &from)
+idnsFromKnownNameserver(IpAddress const &from)
{
int i;
int max = INCOMING_DNS_MAX;
static char rbuf[SQUID_UDP_SO_RCVBUF];
int ns;
- IPAddress from;
+ IpAddress from;
debugs(78, 3, "idnsRead: starting with FD " << fd);
* The cause of this is still unknown, however copying the data appears
* to allow it to be passed further without this erasure.
*/
- IPAddress bugbypass;
+ IpAddress bugbypass;
while (max--) {
len = comm_udp_recvfrom(fd, rbuf, SQUID_UDP_SO_RCVBUF, 0, bugbypass);
if (DnsSocket < 0) {
int port;
- IPAddress addr;
+ IpAddress addr;
if (!Config.Addrs.udp_outgoing.IsNoAddr())
addr = Config.Addrs.udp_outgoing;
}
void
-idnsPTRLookup(const IPAddress &addr, IDNSCB * callback, void *data)
+idnsPTRLookup(const IpAddress &addr, IDNSCB * callback, void *data)
{
idns_query *q;
\endverbatim
*/
-#include "IPAddress.h"
+#include "IpAddress.h"
#if LIBRESOLV_DNS_TTL_HACK
/// \ingroup dnsserver
int ttl = 0;
int retry = 0;
unsigned int i = 0;
- IPAddress ipa;
+ IpAddress ipa;
char ntoabuf[MAX_IPSTRLEN];
struct addrinfo hints;
struct addrinfo *AI = NULL;
#endif
#if HAVE_RES_INIT
- IPAddress ipa;
+ IpAddress ipa;
int opt_s = 0;
#ifdef _SQUID_RES_NSADDR_LIST
#include "squid.h"
#include "cbdata.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
/**
\defgroup ErrorPageAPI Error Pages API
char *dnsserver_msg;
time_t ttl;
- IPAddress src_addr;
+ IpAddress src_addr;
char *redirect_url;
ERCB *callback;
void *callback_data;
QUOTE_METHOD_URL
} quote;
- IPAddress local_addr;
+ IpAddress local_addr;
};
struct _external_acl_format {
#define SQUID_FDE_H
#include "comm.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
class PconnPool;
unsigned int type;
u_short remote_port;
- IPAddress local_addr;
+ IpAddress local_addr;
unsigned char tos;
int sock_family;
char ipaddr[MAX_IPSTRLEN]; /* dotted decimal address of peer */
halfClosedReader = NULL;
// XXX: the following memset may corrupt or leak new or changed members
memset(this, 0, sizeof(fde));
- local_addr.SetEmpty(); // IPAddress likes to be setup nicely.
+ local_addr.SetEmpty(); // IpAddress likes to be setup nicely.
}
};
int ctimeout;
int ftimeout = Config.Timeout.forward - (squid_curtime - start_t);
- IPAddress outgoing;
+ IpAddress outgoing;
unsigned short tos;
- IPAddress client_addr;
+ IpAddress client_addr;
assert(fs);
assert(server_fd == -1);
debugs(17, 3, "fwdConnectStart: " << url);
if (!fs->_peer && request->flags.spoof_client_ip) {
// try to set the outgoing address using TPROXY v2
// if it fails we abort any further TPROXY actions on this connection
- if (IpInterceptor.SetTproxy2OutgoingAddr(int fd, const IPAddress &src) == -1) {
+ if (IpInterceptor.SetTproxy2OutgoingAddr(int fd, const IpAddress &src) == -1) {
request->flags.spoof_client_ip = 0;
}
}
void
-FwdState::pconnPush(int fd, const char *host, int port, const char *domain, IPAddress &client_addr)
+FwdState::pconnPush(int fd, const char *host, int port, const char *domain, IpAddress &client_addr)
{
fwdPconnPool->push(fd, host, port, domain, client_addr);
}
memFree(fs, MEM_FWD_SERVER);
}
-static IPAddress
+static IpAddress
aclMapAddr(acl_address * head, ACLChecklist * ch)
{
acl_address *l;
- IPAddress addr;
+ IpAddress addr;
for (l = head; l; l = l->next) {
if (ch->matchAclListFast(l->aclList))
return 0;
}
-IPAddress
+IpAddress
getOutgoingAddr(HttpRequest * request, struct peer *dst_peer)
{
ACLChecklist ch;
class ErrorState;
#include "comm.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
class FwdServer
{
bool checkRetry();
bool checkRetriable();
void dispatch();
- void pconnPush(int fd, const char *host, int port, const char *domain, IPAddress &client_addr);
+ void pconnPush(int fd, const char *host, int port, const char *domain, IpAddress &client_addr);
bool dontRetry() { return flags.dont_retry; }
unsigned int forward_completed:1;
} flags;
- IPAddress src; /* Client address for this connection. Needed for transparent operations. */
+ IpAddress src; /* Client address for this connection. Needed for transparent operations. */
};
#endif
* and does not affect the FQDN cache.
*/
void
-fqdncache_nbgethostbyaddr(IPAddress &addr, FQDNH * handler, void *handlerData)
+fqdncache_nbgethostbyaddr(IpAddress &addr, FQDNH * handler, void *handlerData)
{
fqdncache_entry *f = NULL;
char name[MAX_IPSTRLEN];
*
*/
const char *
-fqdncache_gethostbyaddr(IPAddress &addr, int flags)
+fqdncache_gethostbyaddr(IpAddress &addr, int flags)
{
char name[MAX_IPSTRLEN];
fqdncache_entry *f = NULL;
/// \ingroup FQDNCacheAPI
const char *
-fqdnFromAddr(IPAddress &addr)
+fqdnFromAddr(IpAddress &addr)
{
const char *n;
static char buf[MAX_IPSTRLEN];
char h1, h2, h3, h4;
int n;
u_short port;
- IPAddress ipa_remote;
+ IpAddress ipa_remote;
int fd = ftpState->data.fd;
char *buf;
debugs(9, 3, HERE);
static void
ftpSendPassive(FtpStateData * ftpState)
{
- IPAddress addr;
+ IpAddress addr;
struct addrinfo *AI = NULL;
/** Checks the server control channel is still available before running. */
int p1, p2;
int n;
u_short port;
- IPAddress ipa_remote;
+ IpAddress ipa_remote;
int fd = ftpState->data.fd;
char *buf;
LOCAL_ARRAY(char, ipaddr, 1024);
{
int fd;
- IPAddress addr;
+ IpAddress addr;
struct addrinfo *AI = NULL;
int on = 1;
int x = 0;
{
int fd;
- IPAddress ipa;
+ IpAddress ipa;
struct addrinfo *AI = NULL;
unsigned char *addrptr;
unsigned char *portptr;
ftpSendEPRT(FtpStateData * ftpState)
{
int fd;
- IPAddress addr;
+ IpAddress addr;
struct addrinfo *AI = NULL;
char buf[MAX_IPSTRLEN];
extern struct acl_deny_info_list *DenyInfoList; /* NULL */
-//MOVED:icp_v2.cc extern IPAddress theOutICPAddr;
-//MOVED:snmp_core.cc extern IPAddress theOutSNMPAddr;
+//MOVED:icp_v2.cc extern IpAddress theOutICPAddr;
+//MOVED:snmp_core.cc extern IpAddress theOutSNMPAddr;
extern struct timeval squid_start;
extern int shutting_down; /* 0 */
#include "squid.h"
#include "cbdata.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
class helper_request;
int n_running;
int n_active;
int ipc_type;
- IPAddress addr;
+ IpAddress addr;
unsigned int concurrency;
time_t last_queue_warn;
time_t last_restart;
int n_running;
int n_active;
int ipc_type;
- IPAddress addr;
+ IpAddress addr;
MemAllocator *datapool;
HLPSAVAIL *IsAvailable;
HLPSONEQ *OnEmptyQueue;
struct _helper_server {
int index;
int pid;
- IPAddress addr;
+ IpAddress addr;
int rfd;
int wfd;
MemBuf *wqueue;
struct _helper_stateful_server {
int index;
int pid;
- IPAddress addr;
+ IpAddress addr;
int rfd;
int wfd;
/* MemBuf wqueue; */
void checkHit();
void checkedHit(StoreEntry *e);
- void setFrom (IPAddress &from);
+ void setFrom (IpAddress &from);
void setDataHeader (htcpDataHeader *);
char *method;
char *uri;
private:
HttpRequest *checkHitRequest;
- IPAddress from; // was a ptr. return to such IFF needed. otherwise copy should do.
+ IpAddress from; // was a ptr. return to such IFF needed. otherwise copy should do.
htcpDataHeader *dhdr;
};
static u_int32_t queried_id[N_QUERIED_KEYS];
static cache_key queried_keys[N_QUERIED_KEYS][SQUID_MD5_DIGEST_LENGTH];
-static IPAddress queried_addr[N_QUERIED_KEYS];
+static IpAddress queried_addr[N_QUERIED_KEYS];
static MemAllocator *htcpDetailPool = NULL;
static int old_squid_format = 0;
static void htcpFreeSpecifier(htcpSpecifier * s);
static void htcpFreeDetail(htcpDetail * s);
-static void htcpHandleMsg(char *buf, int sz, IPAddress &from);
+static void htcpHandleMsg(char *buf, int sz, IpAddress &from);
-static void htcpHandleMon(htcpDataHeader *, char *buf, int sz, IPAddress &from);
+static void htcpHandleMon(htcpDataHeader *, char *buf, int sz, IpAddress &from);
-static void htcpHandleNop(htcpDataHeader *, char *buf, int sz, IPAddress &from);
+static void htcpHandleNop(htcpDataHeader *, char *buf, int sz, IpAddress &from);
-static void htcpHandleSet(htcpDataHeader *, char *buf, int sz, IPAddress &from);
+static void htcpHandleSet(htcpDataHeader *, char *buf, int sz, IpAddress &from);
-static void htcpHandleTst(htcpDataHeader *, char *buf, int sz, IPAddress &from);
+static void htcpHandleTst(htcpDataHeader *, char *buf, int sz, IpAddress &from);
static void htcpRecv(int fd, void *data);
-static void htcpSend(const char *buf, int len, IPAddress &to);
+static void htcpSend(const char *buf, int len, IpAddress &to);
-static void htcpTstReply(htcpDataHeader *, StoreEntry *, htcpSpecifier *, IPAddress &);
+static void htcpTstReply(htcpDataHeader *, StoreEntry *, htcpSpecifier *, IpAddress &);
-static void htcpHandleTstRequest(htcpDataHeader *, char *buf, int sz, IPAddress &from);
+static void htcpHandleTstRequest(htcpDataHeader *, char *buf, int sz, IpAddress &from);
-static void htcpHandleTstResponse(htcpDataHeader *, char *, int, IPAddress &);
+static void htcpHandleTstResponse(htcpDataHeader *, char *, int, IpAddress &);
static void
htcpHexdump(const char *tag, const char *s, int sz)
static void
-htcpSend(const char *buf, int len, IPAddress &to)
+htcpSend(const char *buf, int len, IpAddress &to)
{
int x;
void
-htcpSpecifier::setFrom (IPAddress &aSocket)
+htcpSpecifier::setFrom (IpAddress &aSocket)
{
from = aSocket;
}
static int
-htcpAccessCheck(acl_access * acl, htcpSpecifier * s, IPAddress &from)
+htcpAccessCheck(acl_access * acl, htcpSpecifier * s, IpAddress &from)
{
ACLChecklist checklist;
checklist.src_addr = from;
}
static void
-htcpTstReply(htcpDataHeader * dhdr, StoreEntry * e, htcpSpecifier * spec, IPAddress &from)
+htcpTstReply(htcpDataHeader * dhdr, StoreEntry * e, htcpSpecifier * spec, IpAddress &from)
{
htcpStuff stuff;
static char pkt[8192];
static void
-htcpClrReply(htcpDataHeader * dhdr, int purgeSucceeded, IPAddress &from)
+htcpClrReply(htcpDataHeader * dhdr, int purgeSucceeded, IpAddress &from)
{
htcpStuff stuff;
static char pkt[8192];
static void
-htcpHandleNop(htcpDataHeader * hdr, char *buf, int sz, IPAddress &from)
+htcpHandleNop(htcpDataHeader * hdr, char *buf, int sz, IpAddress &from)
{
debugs(31, 3, "htcpHandleNop: Unimplemented");
}
static void
-htcpHandleTst(htcpDataHeader * hdr, char *buf, int sz, IPAddress &from)
+htcpHandleTst(htcpDataHeader * hdr, char *buf, int sz, IpAddress &from)
{
debugs(31, 3, "htcpHandleTst: sz = " << sz);
static void
-htcpHandleTstResponse(htcpDataHeader * hdr, char *buf, int sz, IPAddress &from)
+htcpHandleTstResponse(htcpDataHeader * hdr, char *buf, int sz, IpAddress &from)
{
htcpReplyData htcpReply;
cache_key *key = NULL;
- IPAddress *peer;
+ IpAddress *peer;
htcpDetail *d = NULL;
char *t;
static void
-htcpHandleTstRequest(htcpDataHeader * dhdr, char *buf, int sz, IPAddress &from)
+htcpHandleTstRequest(htcpDataHeader * dhdr, char *buf, int sz, IpAddress &from)
{
/* buf should be a SPECIFIER */
htcpSpecifier *s;
static void
-htcpHandleMon(htcpDataHeader * hdr, char *buf, int sz, IPAddress &from)
+htcpHandleMon(htcpDataHeader * hdr, char *buf, int sz, IpAddress &from)
{
debugs(31, 3, "htcpHandleMon: Unimplemented");
}
static void
-htcpHandleSet(htcpDataHeader * hdr, char *buf, int sz, IPAddress &from)
+htcpHandleSet(htcpDataHeader * hdr, char *buf, int sz, IpAddress &from)
{
debugs(31, 3, "htcpHandleSet: Unimplemented");
}
static void
-htcpHandleClr(htcpDataHeader * hdr, char *buf, int sz, IPAddress &from)
+htcpHandleClr(htcpDataHeader * hdr, char *buf, int sz, IpAddress &from)
{
htcpSpecifier *s;
/* buf[0/1] is reserved and reason */
* hands it off to other functions to break apart message-specific data.
*/
static void
-htcpHandleMsg(char *buf, int sz, IPAddress &from)
+htcpHandleMsg(char *buf, int sz, IpAddress &from)
{
htcpHeader htcpHdr;
htcpDataHeader hdr;
{
static char buf[8192];
int len;
- static IPAddress from;
+ static IpAddress from;
/* Receive up to 8191 bytes, leaving room for a null */
return;
}
- IPAddress incomingAddr = Config.Addrs.udp_incoming;
+ IpAddress incomingAddr = Config.Addrs.udp_incoming;
incomingAddr.SetPort(Config.Port.htcp);
enter_suid();
debugs(31, 1, "Accepting HTCP messages on port " << Config.Port.htcp << ", FD " << htcpInSocket << ".");
if (!Config.Addrs.udp_outgoing.IsNoAddr()) {
- IPAddress outgoingAddr = Config.Addrs.udp_outgoing;
+ IpAddress outgoingAddr = Config.Addrs.udp_outgoing;
outgoingAddr.SetPort(Config.Port.htcp);
enter_suid();
#if USE_HTCP
#include "HttpHeader.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
/// \ingroup ServerProtocolHTCP
class HtcpReplyData
typedef class HtcpReplyData htcpReplyData;
/// \ingroup ServerProtocolHTCP
-SQUIDCEXTERN void neighborsHtcpReply(const cache_key *, htcpReplyData *, const IPAddress &);
+SQUIDCEXTERN void neighborsHtcpReply(const cache_key *, htcpReplyData *, const IpAddress &);
/// \ingroup ServerProtocolHTCP
SQUIDCEXTERN void htcpInit(void);
HttpStateData::processReplyBody()
{
AsyncCall::Pointer call;
- IPAddress client_addr;
+ IpAddress client_addr;
bool ispinned = false;
if (!flags.headers_parsed) {
#include "wordlist.h"
#include "SquidTime.h"
#include "SwapDir.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
#include "icmp/net_db.h"
/// \ingroup ServerProtocolICPInternal2
-static void icpLogIcp(const IPAddress &, log_type, int, const char *, int);
+static void icpLogIcp(const IpAddress &, log_type, int, const char *, int);
/// \ingroup ServerProtocolICPInternal2
-static void icpHandleIcpV2(int, IPAddress &, char *, int);
+static void icpHandleIcpV2(int, IpAddress &, char *, int);
/// \ingroup ServerProtocolICPInternal2
static void icpCount(void *, int, size_t, int);
static icpUdpData *IcpQueueTail = NULL;
/// \ingroup ServerProtocolICPInternal2
-IPAddress theOutICPAddr;
+IpAddress theOutICPAddr;
/* icp_common_t */
_icp_common_t::_icp_common_t() : opcode(ICP_INVALID), version(0), length(0), reqnum(0), flags(0), pad(0), shostid(0)
/// \ingroup ServerProtocolICPInternal2
static void
-icpLogIcp(const IPAddress &caddr, log_type logcode, int len, const char *url, int delay)
+icpLogIcp(const IpAddress &caddr, log_type logcode, int len, const char *url, int delay)
{
AccessLogEntry al;
int
icpUdpSend(int fd,
- const IPAddress &to,
+ const IpAddress &to,
icp_common_t * msg,
log_type logcode,
int delay)
}
void
-icpCreateAndSend(icp_opcode opcode, int flags, char const *url, int reqnum, int pad, int fd, const IPAddress &from)
+icpCreateAndSend(icp_opcode opcode, int flags, char const *url, int reqnum, int pad, int fd, const IpAddress &from)
{
icp_common_t *reply = _icp_common_t::createMessage(opcode, flags, url, reqnum, pad);
icpUdpSend(fd, from, reply, icpLogFromICPCode(opcode), 0);
}
void
-icpDenyAccess(IPAddress &from, char *url, int reqnum, int fd)
+icpDenyAccess(IpAddress &from, char *url, int reqnum, int fd)
{
debugs(12, 2, "icpDenyAccess: Access Denied for " << from << " by " << AclMatchedName << ".");
}
int
-icpAccessAllowed(IPAddress &from, HttpRequest * icp_request)
+icpAccessAllowed(IpAddress &from, HttpRequest * icp_request)
{
ACLChecklist checklist;
checklist.src_addr = from;
}
HttpRequest *
-icpGetRequest(char *url, int reqnum, int fd, IPAddress &from)
+icpGetRequest(char *url, int reqnum, int fd, IpAddress &from)
{
if (strpbrk(url, w_space)) {
url = rfc1738_escape(url);
}
static void
-doV2Query(int fd, IPAddress &from, char *buf, icp_common_t header)
+doV2Query(int fd, IpAddress &from, char *buf, icp_common_t header)
{
int rtt = 0;
int src_rtt = 0;
}
void
-_icp_common_t::handleReply(char *buf, IPAddress &from)
+_icp_common_t::handleReply(char *buf, IpAddress &from)
{
if (neighbors_do_private_keys && reqnum == 0) {
debugs(12, 0, "icpHandleIcpV2: Neighbor " << from << " returned reqnum = 0");
}
static void
-icpHandleIcpV2(int fd, IPAddress &from, char *buf, int len)
+icpHandleIcpV2(int fd, IpAddress &from, char *buf, int len)
{
if (len <= 0) {
debugs(12, 3, "icpHandleIcpV2: ICP message is too small");
icpPktDump(icp_common_t * pkt)
{
- IPAddress a;
+ IpAddress a;
debugs(12, 9, "opcode: " << std::setw(3) << pkt->opcode << " " << icp_opcode_str[pkt->opcode]);
debugs(12, 9, "version: "<< std::left << std::setw(8) << pkt->version);
{
int *N = &incoming_sockets_accepted;
- IPAddress from;
+ IpAddress from;
LOCAL_ARRAY(char, buf, SQUID_UDP_SO_RCVBUF);
int len;
int icp_version;
{
u_int16_t port;
- IPAddress addr;
+ IpAddress addr;
struct addrinfo *xai = NULL;
int x;
/// \ingroup ServerProtocolICPInternal3
static void
-doV3Query(int fd, IPAddress &from, char *buf, icp_common_t header)
+doV3Query(int fd, IpAddress &from, char *buf, icp_common_t header)
{
/* We have a valid packet */
char *url = buf + sizeof(icp_common_t) + sizeof(u_int32_t);
/// \ingroup ServerProtocolICPInternal3
/* Currently Harvest cached-2.x uses ICP_VERSION_3 */
void
-icpHandleIcpV3(int fd, IPAddress&from, char *buf, int len)
+icpHandleIcpV3(int fd, IpAddress&from, char *buf, int len)
{
if (len <= 0) {
debugs(12, 3, "icpHandleIcpV3: ICP message is too small");
hash_link hash; /* must be first */
int fd; /* IDENT fd */
- IPAddress me;
+ IpAddress me;
- IPAddress my_peer;
+ IpAddress my_peer;
IdentClient *clients;
char buf[4096];
} IdentStateData;
* 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;
#include "cbdata.h"
-class IPAddress;
+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);
#if USE_IPV6
/* check for an IP address and format appropriately if found */
- IPAddress test = lc_host;
+ IpAddress test = lc_host;
if ( !test.IsAnyAddr() ) {
test.ToHostname(lc_host,SQUIDHOSTNAMELEN);
}
#include "squid.h"
#include "comm.h"
#include "fde.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
static const char *hello_string = "hi there\n";
#define HELLO_BUF_SZ 32
}
pid_t
-ipcCreate(int type, const char *prog, const char *const args[], const char *name, IPAddress &local_addr, int *rfd, int *wfd, void **hIpc)
+ipcCreate(int type, const char *prog, const char *const args[], const char *name, IpAddress &local_addr, int *rfd, int *wfd, void **hIpc)
{
pid_t pid;
- IPAddress ChS;
- IPAddress PaS;
+ IpAddress ChS;
+ IpAddress PaS;
struct addrinfo *AI = NULL;
int crfd = -1;
int prfd = -1;
int type;
int crfd;
int cwfd;
- IPAddress local_addr;
+ IpAddress local_addr;
struct addrinfo PS;
const char *prog;
char **args;
}
pid_t
-ipcCreate(int type, const char *prog, const char *const args[], const char *name, IPAddress &local_addr, int *rfd, int *wfd, void **hIpc)
+ipcCreate(int type, const char *prog, const char *const args[], const char *name, IpAddress &local_addr, int *rfd, int *wfd, void **hIpc)
{
unsigned long thread;
DWORD ecode = 0;
pid_t pid;
- IPAddress tmp_addr;
+ IpAddress tmp_addr;
struct addrinfo *aiCS = NULL;
struct addrinfo *aiPS = NULL;
return ipcCloseAllFD(prfd, pwfd, crfd, cwfd);
}
- /* NP: tmp_addr was left with eiether empty or aiCS in IPAddress format */
+ /* NP: tmp_addr was left with eiether empty or aiCS in IpAddress format */
if (comm_connect_addr(pwfd, tmp_addr) == COMM_ERROR) {
CloseHandle((HANDLE) thread);
return ipcCloseAllFD(prfd, pwfd, -1, -1);
int prfd_ipc = -1, pwfd_ipc = -1, crfd_ipc = -1, cwfd_ipc = -1;
char *prog = NULL, *buf1 = NULL;
- IPAddress PS_ipc;
- IPAddress CS_ipc;
+ IpAddress PS_ipc;
+ IpAddress CS_ipc;
struct addrinfo *aiPS_ipc = NULL;
struct addrinfo *aiCS_ipc = NULL;
int cwfd = params->cwfd;
char **args = params->args;
- IPAddress PS = params->PS;
- IPAddress local_addr = params->local_addr;
+ IpAddress PS = params->PS;
+ IpAddress local_addr = params->local_addr;
buf1 = (char *)xcalloc(1, 8192);
strcpy(buf1, params->prog);
#include "SquidTime.h"
#include "Store.h"
#include "wordlist.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
/**
\defgroup IPCacheAPI IP Cache API
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->SetEmpty(); // properly setup the 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 *
(float) Config.ipcache.high) / (float) 100);
#if DNS_CNAME
/**
- * Takes two IPAddress arrays and merges them into a single array
+ * Takes two IpAddress arrays and merges them into a single array
* which is allocated dynamically to fit the number of unique addresses
*
\param aaddrs One list to merge
\param outlen Size of list out
*/
void
-ipcacheMergeIPLists(const IPAddress *aaddrs, const int alen,
- const IPAddress *baddrs, const int blen,
- IPAddress **out, int &outlen )
+ipcacheMergeIPLists(const IpAddress *aaddrs, const int alen,
+ const IpAddress *baddrs, const int blen,
+ IpAddress **out, int &outlen )
{
int fc=0, t=0, c=0;
- IPAddress const *ip4ptrs[255];
+ IpAddress const *ip4ptrs[255];
#if USE_IPV6
- IPAddress const *ip6ptrs[255];
+ IpAddress const *ip6ptrs[255];
#endif
int num_ip4 = 0;
int num_ip6 = 0;
- memset(ip4ptrs, 0, sizeof(IPAddress*)*255);
+ memset(ip4ptrs, 0, sizeof(IpAddress*)*255);
#if USE_IPV6
- memset(ip6ptrs, 0, sizeof(IPAddress*)*255);
+ memset(ip6ptrs, 0, sizeof(IpAddress*)*255);
#endif
// for each unique address in list A - grab ptr
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);
#if DNS_CNAME
ipcache_entry *i = NULL;
char *pname = NULL;
- IPAddress *tmpbuf = NULL;
+ IpAddress *tmpbuf = NULL;
int fc = 0;
int ttl = 0;
generic_cbdata* gcb = (generic_cbdata*)cbdata;
ipcacheCheckNumeric(const char *name)
{
- IPAddress ip;
+ IpAddress ip;
/* check if it's already a IP address in text form. */
/* it may be IPv6-wrapped */
\param addr specific addres to be marked bad
*/
void
-ipcacheMarkBadAddr(const char *name, IPAddress &addr)
+ipcacheMarkBadAddr(const char *name, IpAddress &addr)
{
ipcache_entry *i;
ipcache_addrs *ia;
/// \ingroup IPCacheAPI
void
-ipcacheMarkGoodAddr(const char *name, IPAddress &addr)
+ipcacheMarkGoodAddr(const char *name, IpAddress &addr)
{
ipcache_entry *i;
ipcache_addrs *ia;
{
ipcache_entry *i;
- IPAddress ip;
+ IpAddress ip;
if (!(ip = ipaddr)) {
#if USE_IPV6
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;
#include "PeerSelectState.h"
#include "SquidTime.h"
#include "Store.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
#include "icmp/net_db.h"
/* count mcast group peers every 15 minutes */
static void peerCountMcastPeersSchedule(peer * p, time_t when);
static IRCB peerCountHandleIcpReply;
-static void neighborIgnoreNonPeer(const IPAddress &, icp_opcode);
+static void neighborIgnoreNonPeer(const IpAddress &, icp_opcode);
static OBJH neighborDumpPeers;
static OBJH neighborDumpNonPeers;
static void dump_peers(StoreEntry * sentry, peer * peers);
peer *
-whichPeer(const IPAddress &from)
+whichPeer(const IpAddress &from)
{
int j;
void
neighbors_init(void)
{
- IPAddress nul;
+ IpAddress nul;
struct addrinfo *AI = NULL;
struct servent *sep = NULL;
const char *me = getMyHostname();
static peer *non_peers = NULL;
static void
-neighborIgnoreNonPeer(const IPAddress &from, icp_opcode opcode)
+neighborIgnoreNonPeer(const IpAddress &from, icp_opcode opcode)
{
peer *np;
*/
void
-neighborsUdpAck(const cache_key * key, icp_common_t * header, const IPAddress &from)
+neighborsUdpAck(const cache_key * key, icp_common_t * header, const IpAddress &from)
{
peer *p = NULL;
StoreEntry *entry;
if (squid_curtime - p->stats.last_connect_probe == 0)
return ret;/* don't probe to often */
- IPAddress temp(getOutgoingAddr(NULL,p));
+ IpAddress temp(getOutgoingAddr(NULL,p));
fd = comm_open(SOCK_STREAM, IPPROTO_TCP, temp, COMM_NONBLOCKING, p->host);
#if USE_HTCP
void
-neighborsHtcpReply(const cache_key * key, htcpReplyData * htcp, const IPAddress &from)
+neighborsHtcpReply(const cache_key * key, htcpReplyData * htcp, const IpAddress &from)
{
StoreEntry *e = Store::Root().get(key);
MemObject *mem = NULL;
/* ========== PconnPool PRIVATE FUNCTIONS ============================================ */
const char *
-PconnPool::key(const char *host, u_short port, const char *domain, IPAddress &client_address)
+PconnPool::key(const char *host, u_short port, const char *domain, IpAddress &client_address)
{
LOCAL_ARRAY(char, buf, SQUIDHOSTNAMELEN * 2 + 10);
char ntoabuf[MAX_IPSTRLEN];
}
void
-PconnPool::push(int fd, const char *host, u_short port, const char *domain, IPAddress &client_address)
+PconnPool::push(int fd, const char *host, u_short port, const char *domain, IpAddress &client_address)
{
IdleConnList *list;
*/
int
-PconnPool::pop(const char *host, u_short port, const char *domain, IPAddress &client_address, bool isRetriable)
+PconnPool::pop(const char *host, u_short port, const char *domain, IpAddress &client_address, bool isRetriable)
{
IdleConnList *list;
const char * aKey = key(host, port, domain, client_address);
};
-class IPAddress;
+class IpAddress;
class StoreEntry;
class IdleConnLimit;
PconnPool(const char *);
void moduleInit();
- void push(int fd, const char *host, u_short port, const char *domain, IPAddress &client_address);
- int pop(const char *host, u_short port, const char *domain, IPAddress &client_address, bool retriable);
+ void push(int fd, const char *host, u_short port, const char *domain, IpAddress &client_address);
+ int pop(const char *host, u_short port, const char *domain, IpAddress &client_address, bool retriable);
void count(int uses);
void dumpHist(StoreEntry *e);
void unlinkList(IdleConnList *list) const;
private:
- static const char *key(const char *host, u_short port, const char *domain, IPAddress &client_address);
+ static const char *key(const char *host, u_short port, const char *domain, IpAddress &client_address);
int hist[PCONN_HIST_SZ];
hash_table *table;
*/
#include "Packer.h"
/* for routines still in this file that take CacheManager parameters */
-#include "IPAddress.h"
+#include "IpAddress.h"
/* for parameters that still need these */
#include "enums.h"
/* some parameters stil need this */
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 clientdbInit(void);
-SQUIDCEXTERN void clientdbUpdate(const IPAddress &, log_type, protocol_t, size_t);
+SQUIDCEXTERN void clientdbUpdate(const IpAddress &, log_type, protocol_t, size_t);
-SQUIDCEXTERN int clientdbCutoffDenied(const IPAddress &);
+SQUIDCEXTERN int clientdbCutoffDenied(const IpAddress &);
SQUIDCEXTERN void clientdbDump(StoreEntry *);
SQUIDCEXTERN void clientdbFreeMemory(void);
-SQUIDCEXTERN int clientdbEstablished(const IPAddress &, int);
+SQUIDCEXTERN int clientdbEstablished(const IpAddress &, int);
SQUIDCEXTERN void clientOpenListenSockets(void);
SQUIDCEXTERN void clientHttpConnectionsClose(void);
SQUIDCEXTERN void httpRequestFree(void *);
SQUIDCEXTERN void idnsShutdown(void);
SQUIDCEXTERN void idnsALookup(const char *, IDNSCB *, void *);
-SQUIDCEXTERN void idnsPTRLookup(const IPAddress &, IDNSCB *, void *);
+SQUIDCEXTERN void idnsPTRLookup(const IpAddress &, IDNSCB *, void *);
SQUIDCEXTERN void fd_close(int fd);
SQUIDCEXTERN void fd_open(int fd, unsigned int type, const char *);
SQUIDCEXTERN void filemapFreeMemory(fileMap *);
-SQUIDCEXTERN void fqdncache_nbgethostbyaddr(IPAddress &, FQDNH *, void *);
+SQUIDCEXTERN void fqdncache_nbgethostbyaddr(IpAddress &, FQDNH *, void *);
-SQUIDCEXTERN const char *fqdncache_gethostbyaddr(IPAddress &, int flags);
+SQUIDCEXTERN const char *fqdncache_gethostbyaddr(IpAddress &, int flags);
SQUIDCEXTERN void fqdncache_init(void);
SQUIDCEXTERN void fqdnStats(StoreEntry *);
SQUIDCEXTERN void fqdncacheReleaseInvalid(const char *);
-SQUIDCEXTERN const char *fqdnFromAddr(IPAddress &);
+SQUIDCEXTERN const char *fqdnFromAddr(IpAddress &);
SQUIDCEXTERN int fqdncacheQueueDrain(void);
SQUIDCEXTERN void fqdncacheFreeMemory(void);
SQUIDCEXTERN void fqdncache_restart(void);
SQUIDCEXTERN void snmpConnectionClose(void);
SQUIDCEXTERN void snmpDebugOid(int lvl, oid * Name, snint Len);
-SQUIDCEXTERN void addr2oid(IPAddress &addr, oid *Dest);
-SQUIDCEXTERN void oid2addr(oid *Dest, IPAddress &addr, u_int code);
+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 *);
SQUIDCEXTERN void stat_ipcache_get(StoreEntry *);
SQUIDCEXTERN void ipcacheCycleAddr(const char *name, ipcache_addrs *);
-SQUIDCEXTERN void ipcacheMarkBadAddr(const char *name, IPAddress &);
+SQUIDCEXTERN void ipcacheMarkBadAddr(const char *name, IpAddress &);
-SQUIDCEXTERN void ipcacheMarkGoodAddr(const char *name, IPAddress &);
+SQUIDCEXTERN void ipcacheMarkGoodAddr(const char *name, IpAddress &);
SQUIDCEXTERN void ipcacheFreeMemory(void);
SQUIDCEXTERN ipcache_addrs *ipcacheCheckNumeric(const char *name);
SQUIDCEXTERN void ipcache_restart(void);
int *timeout);
SQUIDCEXTERN void neighborAddAcl(const char *, const char *);
-SQUIDCEXTERN void neighborsUdpAck(const cache_key *, icp_common_t *, const IPAddress &);
+SQUIDCEXTERN void neighborsUdpAck(const cache_key *, icp_common_t *, const IpAddress &);
SQUIDCEXTERN void neighborAdd(const char *, const char *, int, int, int, int, int);
SQUIDCEXTERN void neighbors_init(void);
#if USE_HTCP
SQUIDCEXTERN void dump_peer_options(StoreEntry *, peer *);
SQUIDCEXTERN int peerHTTPOkay(const peer *, HttpRequest *);
-SQUIDCEXTERN peer *whichPeer(const IPAddress &from);
+SQUIDCEXTERN peer *whichPeer(const IpAddress &from);
SQUIDCEXTERN void peerSelect(HttpRequest *, StoreEntry *, PSC *, void *data);
SQUIDCEXTERN void peerSelectInit(void);
SQUIDCEXTERN void peerDigestNotePeerGone(PeerDigest * pd);
SQUIDCEXTERN void peerDigestStatsReport(const PeerDigest * pd, StoreEntry * e);
-extern IPAddress getOutgoingAddr(HttpRequest * request, struct peer *dst_peer);
+extern IpAddress getOutgoingAddr(HttpRequest * request, struct peer *dst_peer);
unsigned long getOutgoingTOS(HttpRequest * request);
SQUIDCEXTERN void urnStart(HttpRequest *, StoreEntry *);
const char *prog,
const char *const args[],
const char *name,
- IPAddress &local_addr,
+ IpAddress &local_addr,
int *rfd,
int *wfd,
void **hIpc);
void *data;
char *orig_url;
- IPAddress client_addr;
+ IpAddress client_addr;
const char *client_ident;
const char *method_s;
RH *handler;
LOCAL_ARRAY(char, tbuf, 256);
LOCAL_ARRAY(char, sndbuf, BUFSIZ);
- IPAddress S;
+ IpAddress S;
char *host = Config.Announce.host;
char *file = NULL;
u_short port = Config.Announce.port;
{
variable_list *Answer = NULL;
- IPAddress laddr;
+ IpAddress laddr;
char *cp = NULL;
peer *p = NULL;
int cnt = 0;
#include "comm.h"
#include "cache_snmp.h"
#include "ACLChecklist.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
#define SNMP_REQUEST_SIZE 4096
#define MAX_PROTOSTAT 5
-IPAddress theOutSNMPAddr;
+IpAddress theOutSNMPAddr;
typedef struct _mib_tree_entry mib_tree_entry;
typedef oid *(instance_Fn) (oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn);
snmpHandleUdp(int sock, void *not_used)
{
LOCAL_ARRAY(char, buf, SNMP_REQUEST_SIZE);
- IPAddress from;
+ IpAddress from;
snmp_request_t *snmp_rq;
int len;
client_Inst(oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn)
{
oid *instance = NULL;
- IPAddress laddr;
- IPAddress *aux;
+ IpAddress laddr;
+ IpAddress *aux;
int size = 0;
int newshift = 0;
oid == 32.1.50.239.162.33.251.20.50.0.0.0.0.0.0.0.0.0.1
*/
void
-addr2oid(IPAddress &addr, oid * Dest)
+addr2oid(IpAddress &addr, oid * Dest)
{
u_int i ;
u_char *cp = NULL;
IPv6 adress : 20:01:32:ef:a2:21:fb:32:00:00:00:00:00:00:00:00:OO:01
*/
void
-oid2addr(oid * id, IPAddress &addr, u_int size)
+oid2addr(oid * id, IpAddress &addr, u_int size)
{
struct in_addr iaddr;
u_int i;
#include "profiling.h"
#include "MemPool.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
#if !HAVE_TEMPNAM
#include "tempnam.h"
long reqid;
int outlen;
- IPAddress from;
+ IpAddress from;
struct snmp_pdu *PDU;
ACLChecklist *acl_checklist;
acl_address *next;
ACLList *aclList;
- IPAddress addr;
+ IpAddress addr;
};
struct acl_tos {
struct {
- IPAddress router;
+ IpAddress router;
- IPAddress address;
+ IpAddress address;
int version;
} Wccp;
#endif
#if USE_WCCPv2
struct {
- IPAddress_list *router;
+ IpAddress_list *router;
- IPAddress address;
+ IpAddress address;
int forwarding_method;
int return_method;
int assignment_method;
struct {
- IPAddress udp_incoming;
+ IpAddress udp_incoming;
- IPAddress udp_outgoing;
+ IpAddress udp_outgoing;
#if SQUID_SNMP
- IPAddress snmp_incoming;
+ IpAddress snmp_incoming;
- IPAddress snmp_outgoing;
+ IpAddress snmp_outgoing;
#endif
/* FIXME INET6 : this should really be a CIDR value */
- IPAddress client_netmask;
+ IpAddress client_netmask;
} Addrs;
size_t tcpRcvBufsz;
size_t udpMaxHitObjsz;
struct {
- IPAddress addr;
+ IpAddress addr;
int ttl;
unsigned short port;
char *encode_key;
};
struct _ipcache_addrs {
- IPAddress *in_addrs;
+ IpAddress *in_addrs;
unsigned char *bad_mask;
unsigned char count;
unsigned char cur;
char *host;
peer_t type;
- IPAddress in_addr;
+ IpAddress in_addr;
struct {
int pings_sent;
int tcp_up; /* 0 if a connect() fails */
- IPAddress addresses[10];
+ IpAddress addresses[10];
int n_addresses;
int rr_count;
peer *next;
struct _ClientInfo {
hash_link hash; /* must be first */
- IPAddress addr;
+ IpAddress addr;
struct {
int result_hist[LOG_TYPE_MAX];
/* bah, cheating on stub count */
pid_t
-ipcCreate(int type, const char *prog, const char *const args[], const char *name, IPAddress &local_addr, int *rfd, int *wfd, void **hIpc)
+ipcCreate(int type, const char *prog, const char *const args[], const char *name, IpAddress &local_addr, int *rfd, int *wfd, void **hIpc)
{
fatal ("Not implemented");
return -1;
LOCAL_ARRAY(char, host, SQUIDHOSTNAMELEN + 1);
static int present = 0;
struct addrinfo *AI = NULL;
- IPAddress sa;
+ IpAddress sa;
if (Config.visibleHostname != NULL)
return Config.visibleHostname;
statCounter.server.all.requests++;
statCounter.server.other.requests++;
/* Create socket. */
- IPAddress temp = getOutgoingAddr(request,NULL);
+ IpAddress temp = getOutgoingAddr(request,NULL);
sock = comm_openex(SOCK_STREAM,
IPPROTO_TCP,
temp,
unlinkdInit(void)
{
const char *args[2];
- IPAddress localhost;
+ IpAddress localhost;
args[0] = "(unlinkd)";
args[1] = NULL;
};
struct wccp_cache_entry_t {
- IPAddress ip_addr;
+ IpAddress ip_addr;
int revision;
char hash[WCCP_HASH_SIZE];
int reserved;
static int last_assign_buckets_change;
static unsigned int number_caches;
-static IPAddress local_ip;
+static IpAddress local_ip;
static PF wccpHandleUdp;
static int wccpLowestIP(void);
wccpHandleUdp(int sock, void *not_used)
{
- IPAddress from;
+ IpAddress from;
int len;
debugs(80, 6, "wccpHandleUdp: Called.");
#include "Parsing.h"
#include "Store.h"
#include "SwapDir.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
#if USE_WCCPv2
#if HAVE_NETDB_H
void
wccp2Init(void)
{
- IPAddress_list *s;
+ IpAddress_list *s;
char *ptr;
uint32_t service_flags;
commSetSelect(sock, COMM_SELECT_READ, wccp2HandleUdp, NULL, 0);
/* FIXME INET6 : drop conversion boundary */
- IPAddress from_tmp;
+ IpAddress from_tmp;
len = comm_udp_recvfrom(sock,
&wccp2_i_see_you,
struct wccp2_mask_identity_info_t *wccp2_mask_identity_info_ptr;
- IPAddress router;
+ IpAddress router;
debugs(80, 6, "wccp2HereIam: Called");
if (wccp2_numrouters > 1) {
/* FIXME INET6 : drop temp conversion */
- IPAddress tmp_rtr(router);
+ IpAddress tmp_rtr(router);
comm_udp_sendto(theWccp2Connection,
tmp_rtr,
&wccp_packet,
int new_socket;
fde *F = NULL;
- IPAddress localhost;
- IPAddress handle0;
- IPAddress handle1;
+ IpAddress localhost;
+ IpAddress handle0;
+ IpAddress handle1;
struct addrinfo *AI = NULL;
localhost.SetLocalhost();
#include "assert.h"
#include "util.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
#include "getfullhostname.h"
#ifndef DEFAULT_CACHEMGR_CONFIG
char ipbuf[MAX_IPSTRLEN];
struct addrinfo *AI = NULL;
- IPAddress S;
+ IpAddress S;
int s;
int l;
#endif
#include "util.h"
-#include "IPAddress.h"
+#include "IpAddress.h"
#ifndef BUFSIZ
#define BUFSIZ 8192
typedef void SIGHDLR(int sig);
/* Local functions */
-static int client_comm_bind(int, const IPAddress &);
+static int client_comm_bind(int, const IpAddress &);
-static int client_comm_connect(int, const IPAddress &, struct timeval *);
+static int client_comm_connect(int, const IpAddress &, struct timeval *);
static void usage(const char *progname);
static int Now(struct timeval *);
int opt_noaccept = 0;
int opt_verbose = 0;
const char *hostname, *localhost;
- IPAddress iaddr;
+ IpAddress iaddr;
char url[BUFSIZ], msg[MESSAGELEN], buf[BUFSIZ];
char extra_hdrs[HEADERLEN];
const char *method = "GET";
}
static int
-client_comm_bind(int sock, const IPAddress &addr) {
+client_comm_bind(int sock, const IpAddress &addr) {
int res;
}
static int
-client_comm_connect(int sock, const IPAddress &addr, struct timeval *tvp) {
+client_comm_connect(int sock, const IpAddress &addr, struct timeval *tvp) {
int res;
static struct addrinfo *AI = NULL;