From: hno <> Date: Tue, 19 Apr 2005 03:52:40 +0000 (+0000) Subject: IPv6 preparation by Rafael Martinez Torres X-Git-Tag: SQUID_3_0_PRE4~809 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ddfcbc224187ef41d7261c831746ad6f6fcb1860;p=thirdparty%2Fsquid.git IPv6 preparation by Rafael Martinez Torres - This patch does change literally the term IN_ADDR by in_addr in all the files containing this term, except the file "inet_ntoa.c", the only one not including "config.h" (either direct or undirectly). - The correposding "defines" are in config.h . They are guarded by "INET6" define, (#ifdef INET6), so branches others that squid3-ipv6 should not be affected in their compilations. --- diff --git a/doc/Programming-Guide/prog-guide.sgml b/doc/Programming-Guide/prog-guide.sgml index 301b61fb72..3e4865ddfc 100644 --- a/doc/Programming-Guide/prog-guide.sgml +++ b/doc/Programming-Guide/prog-guide.sgml @@ -2,7 +2,7 @@
Squid Programmers Guide Squid Developers -$Id: prog-guide.sgml,v 1.57 2004/08/11 19:23:21 wessels Exp $ +$Id: prog-guide.sgml,v 1.58 2005/04/18 21:52:40 hno Exp $ Squid is a WWW Cache application developed by the National Laboratory @@ -2579,7 +2579,7 @@ struct _auth_user_t { } flags; long expiretime; /* IP addr this user authenticated from */ - struct in_addr ipaddr; + struct IN_ADDR ipaddr; time_t ip_expiretime; /* how many references are outstanding to this instance*/ size_t references; diff --git a/helpers/basic_auth/MSNT/rfcnb-priv.h b/helpers/basic_auth/MSNT/rfcnb-priv.h index 1e906b3bdd..01f9a5caa0 100644 --- a/helpers/basic_auth/MSNT/rfcnb-priv.h +++ b/helpers/basic_auth/MSNT/rfcnb-priv.h @@ -55,7 +55,7 @@ typedef struct redirect_addr *redirect_ptr; struct redirect_addr { - struct in_addr ip_addr; + struct IN_ADDR ip_addr; int port; redirect_ptr next; diff --git a/helpers/basic_auth/MSNT/rfcnb-util.c b/helpers/basic_auth/MSNT/rfcnb-util.c index 86ae2d0137..270fad0f4c 100644 --- a/helpers/basic_auth/MSNT/rfcnb-util.c +++ b/helpers/basic_auth/MSNT/rfcnb-util.c @@ -345,7 +345,7 @@ RFCNB_Print_Pkt(FILE * fd, char *dirn, struct RFCNB_Pkt *pkt, int len) /* Resolve a name into an address */ int -RFCNB_Name_To_IP(char *host, struct in_addr *Dest_IP) +RFCNB_Name_To_IP(char *host, struct IN_ADDR *Dest_IP) { int addr; /* Assumes IP4, 32 bit network addresses */ struct hostent *hp; @@ -366,12 +366,12 @@ RFCNB_Name_To_IP(char *host, struct in_addr *Dest_IP) } else { /* We got a name */ - memcpy((void *) Dest_IP, (void *) hp->h_addr_list[0], sizeof(struct in_addr)); + memcpy((void *) Dest_IP, (void *) hp->h_addr_list[0], sizeof(struct IN_ADDR)); } } else { /* It was an IP address */ - memcpy((void *) Dest_IP, (void *) &addr, sizeof(struct in_addr)); + memcpy((void *) Dest_IP, (void *) &addr, sizeof(struct IN_ADDR)); } @@ -397,7 +397,7 @@ RFCNB_Close(int socket) * Not sure how to handle socket options etc. */ int -RFCNB_IP_Connect(struct in_addr Dest_IP, int port) +RFCNB_IP_Connect(struct IN_ADDR Dest_IP, int port) { struct sockaddr_in Socket; int fd; @@ -439,7 +439,7 @@ RFCNB_Session_Req(struct RFCNB_Con *con, char *Called_Name, char *Calling_Name, BOOL * redirect, - struct in_addr *Dest_IP, + struct IN_ADDR *Dest_IP, int *port) { char *sess_pkt; @@ -539,7 +539,7 @@ RFCNB_Session_Req(struct RFCNB_Con *con, *redirect = TRUE; /* Copy port and ip addr */ - memcpy(Dest_IP, (resp + RFCNB_Pkt_IP_Offset), sizeof(struct in_addr)); + memcpy(Dest_IP, (resp + RFCNB_Pkt_IP_Offset), sizeof(struct IN_ADDR)); *port = SVAL(resp, RFCNB_Pkt_Port_Offset); return (0); diff --git a/helpers/basic_auth/MSNT/rfcnb-util.h b/helpers/basic_auth/MSNT/rfcnb-util.h index e19330d4be..2db8541b05 100644 --- a/helpers/basic_auth/MSNT/rfcnb-util.h +++ b/helpers/basic_auth/MSNT/rfcnb-util.h @@ -35,17 +35,17 @@ struct RFCNB_Pkt *RFCNB_Alloc_Pkt(int n); void RFCNB_Print_Pkt(FILE * fd, char *dirn, struct RFCNB_Pkt *pkt, int len); -int RFCNB_Name_To_IP(char *host, struct in_addr *Dest_IP); +int RFCNB_Name_To_IP(char *host, struct IN_ADDR *Dest_IP); int RFCNB_Close(int socket); -int RFCNB_IP_Connect(struct in_addr Dest_IP, int port); +int RFCNB_IP_Connect(struct IN_ADDR Dest_IP, int port); int RFCNB_Session_Req(RFCNB_Con * con, char *Called_Name, char *Calling_Name, BOOL * redirect, - struct in_addr *Dest_IP, + struct IN_ADDR *Dest_IP, int *port); void RFCNB_Free_Pkt(struct RFCNB_Pkt *pkt); diff --git a/helpers/basic_auth/MSNT/session.c b/helpers/basic_auth/MSNT/session.c index a1c33bfd1d..f90991db51 100644 --- a/helpers/basic_auth/MSNT/session.c +++ b/helpers/basic_auth/MSNT/session.c @@ -56,7 +56,7 @@ RFCNB_Call(char *Called_Name, char *Calling_Name, char *Called_Address, int port) { struct RFCNB_Con *con; - struct in_addr Dest_IP; + struct IN_ADDR Dest_IP; int Client; BOOL redirect; struct redirect_addr *redir_addr; diff --git a/helpers/ntlm_auth/SMB/smbval/rfcnb-priv.h b/helpers/ntlm_auth/SMB/smbval/rfcnb-priv.h index 766a66fb92..40141cd81f 100644 --- a/helpers/ntlm_auth/SMB/smbval/rfcnb-priv.h +++ b/helpers/ntlm_auth/SMB/smbval/rfcnb-priv.h @@ -59,7 +59,7 @@ typedef struct redirect_addr *redirect_ptr; struct redirect_addr { - struct in_addr ip_addr; + struct IN_ADDR ip_addr; int port; redirect_ptr next; diff --git a/helpers/ntlm_auth/SMB/smbval/rfcnb-util.c b/helpers/ntlm_auth/SMB/smbval/rfcnb-util.c index 887775ed3e..14f7255682 100644 --- a/helpers/ntlm_auth/SMB/smbval/rfcnb-util.c +++ b/helpers/ntlm_auth/SMB/smbval/rfcnb-util.c @@ -320,7 +320,7 @@ RFCNB_Print_Pkt(FILE * fd, char *dirn, struct RFCNB_Pkt *pkt, int len) /* Resolve a name into an address */ int -RFCNB_Name_To_IP(char *host, struct in_addr *Dest_IP) +RFCNB_Name_To_IP(char *host, struct IN_ADDR *Dest_IP) { int addr; /* Assumes IP4, 32 bit network addresses */ struct hostent *hp; @@ -341,12 +341,12 @@ RFCNB_Name_To_IP(char *host, struct in_addr *Dest_IP) } else { /* We got a name */ - memcpy((void *) Dest_IP, (void *) hp->h_addr_list[0], sizeof(struct in_addr)); + memcpy((void *) Dest_IP, (void *) hp->h_addr_list[0], sizeof(struct IN_ADDR)); } } else { /* It was an IP address */ - memcpy((void *) Dest_IP, (void *) &addr, sizeof(struct in_addr)); + memcpy((void *) Dest_IP, (void *) &addr, sizeof(struct IN_ADDR)); } @@ -372,7 +372,7 @@ RFCNB_Close(int socket) * Not sure how to handle socket options etc. */ int -RFCNB_IP_Connect(struct in_addr Dest_IP, int port) +RFCNB_IP_Connect(struct IN_ADDR Dest_IP, int port) { struct sockaddr_in Socket; int fd; @@ -414,7 +414,7 @@ RFCNB_Session_Req(struct RFCNB_Con *con, char *Called_Name, char *Calling_Name, BOOL * redirect, - struct in_addr *Dest_IP, + struct IN_ADDR *Dest_IP, int *port) { char *sess_pkt; @@ -514,7 +514,7 @@ RFCNB_Session_Req(struct RFCNB_Con *con, *redirect = TRUE; /* Copy port and ip addr */ - memcpy(Dest_IP, (resp + RFCNB_Pkt_IP_Offset), sizeof(struct in_addr)); + memcpy(Dest_IP, (resp + RFCNB_Pkt_IP_Offset), sizeof(struct IN_ADDR)); *port = SVAL(resp, RFCNB_Pkt_Port_Offset); return (0); diff --git a/helpers/ntlm_auth/SMB/smbval/rfcnb-util.h b/helpers/ntlm_auth/SMB/smbval/rfcnb-util.h index 123c9cba29..024586009c 100644 --- a/helpers/ntlm_auth/SMB/smbval/rfcnb-util.h +++ b/helpers/ntlm_auth/SMB/smbval/rfcnb-util.h @@ -38,15 +38,15 @@ struct RFCNB_Pkt *RFCNB_Alloc_Pkt(int n); void RFCNB_Print_Pkt(FILE * fd, char *dirn, struct RFCNB_Pkt *pkt, int len); -int RFCNB_Name_To_IP(char *host, struct in_addr *Dest_IP); +int RFCNB_Name_To_IP(char *host, struct IN_ADDR *Dest_IP); int RFCNB_Close(int socket); -int RFCNB_IP_Connect(struct in_addr Dest_IP, int port); +int RFCNB_IP_Connect(struct IN_ADDR Dest_IP, int port); int RFCNB_Session_Req(struct RFCNB_Con *con, char *Called_Name, char *Calling_Name, BOOL * redirect, - struct in_addr *Dest_IP, + struct IN_ADDR *Dest_IP, int *port); diff --git a/helpers/ntlm_auth/SMB/smbval/session.c b/helpers/ntlm_auth/SMB/smbval/session.c index 361a8f886a..cf6131e819 100644 --- a/helpers/ntlm_auth/SMB/smbval/session.c +++ b/helpers/ntlm_auth/SMB/smbval/session.c @@ -77,7 +77,7 @@ RFCNB_Call(char *Called_Name, char *Calling_Name, char *Called_Address, int port) { struct RFCNB_Con *con; - struct in_addr Dest_IP; + struct IN_ADDR Dest_IP; int Client; BOOL redirect; struct redirect_addr *redir_addr; diff --git a/include/config.h b/include/config.h index 34a682524c..27e076c58b 100644 --- a/include/config.h +++ b/include/config.h @@ -1,5 +1,5 @@ /* - * $Id: config.h,v 1.16 2004/12/24 01:03:39 hno Exp $ + * $Id: config.h,v 1.17 2005/04/18 21:52:40 hno Exp $ * * AUTHOR: Duane Wessels * @@ -194,6 +194,17 @@ +/* + * This is hack to allow compiling IPv6-IPv4 version, + * not disturbing branches others than squid3-ipv6 + */ + +#ifdef INET6 +#define IN_ADDR in6_addr +#else +#define IN_ADDR in_addr +#endif + /* Typedefs for missing entries on a system */ #include "squid_types.h" diff --git a/include/rfc1035.h b/include/rfc1035.h index 4a7010088c..b35637e384 100644 --- a/include/rfc1035.h +++ b/include/rfc1035.h @@ -1,5 +1,5 @@ /* - * $Id: rfc1035.h,v 1.10 2003/12/18 01:16:01 robertc Exp $ + * $Id: rfc1035.h,v 1.11 2005/04/18 21:52:40 hno Exp $ * * AUTHOR: Duane Wessels * @@ -59,7 +59,7 @@ struct _rfc1035_rr { SQUIDCEXTERN unsigned short rfc1035BuildAQuery(const char *hostname, char *buf, size_t * szp); -SQUIDCEXTERN unsigned short rfc1035BuildPTRQuery(const struct in_addr, +SQUIDCEXTERN unsigned short rfc1035BuildPTRQuery(const struct IN_ADDR, char *buf, size_t * szp); SQUIDCEXTERN unsigned short rfc1035RetryQuery(char *); diff --git a/include/util.h b/include/util.h index 38e7418b1d..e63811e4c5 100644 --- a/include/util.h +++ b/include/util.h @@ -1,5 +1,5 @@ /* - * $Id: util.h,v 1.71 2003/07/07 22:44:28 robertc Exp $ + * $Id: util.h,v 1.72 2005/04/18 21:52:40 hno Exp $ * * AUTHOR: Harvest Derived * @@ -126,7 +126,7 @@ extern size_t xmalloc_total; extern void xmalloc_find_leaks(void); #endif -typedef struct in_addr SIA; +typedef struct IN_ADDR SIA; SQUIDCEXTERN int safe_inet_addr(const char *, SIA *); SQUIDCEXTERN time_t parse_iso3307_time(const char *buf); SQUIDCEXTERN char *base64_decode(const char *coded); diff --git a/lib/rfc1035.c b/lib/rfc1035.c index 44180b9daf..800b777991 100644 --- a/lib/rfc1035.c +++ b/lib/rfc1035.c @@ -1,6 +1,6 @@ /* - * $Id: rfc1035.c,v 1.35 2005/01/23 14:59:06 serassio Exp $ + * $Id: rfc1035.c,v 1.36 2005/04/18 21:52:40 hno Exp $ * * Low level DNS protocol routines * AUTHOR: Duane Wessels @@ -636,7 +636,7 @@ rfc1035BuildAQuery(const char *hostname, char *buf, size_t * szp) * Return value is the query ID. */ unsigned short -rfc1035BuildPTRQuery(const struct in_addr addr, char *buf, size_t * szp) +rfc1035BuildPTRQuery(const struct IN_ADDR addr, char *buf, size_t * szp) { static rfc1035_header h; size_t offset = 0; @@ -710,7 +710,7 @@ main(int argc, char *argv[]) S.sin_port = htons(atoi(argv[2])); S.sin_addr.s_addr = inet_addr(argv[1]); while (fgets(input, 512, stdin)) { - struct in_addr junk; + struct IN_ADDR junk; strtok(input, "\r\n"); memset(buf, '\0', 512); sz = 512; @@ -752,7 +752,7 @@ main(int argc, char *argv[]) printf("%d answers\n", n); for (i = 0; i < n; i++) { if (answers[i].type == RFC1035_TYPE_A) { - struct in_addr a; + struct IN_ADDR a; memcpy(&a, answers[i].rdata, 4); printf("A\t%d\t%s\n", answers[i].ttl, inet_ntoa(a)); } else if (answers[i].type == RFC1035_TYPE_PTR) { diff --git a/lib/safe_inet_addr.c b/lib/safe_inet_addr.c index 1a0c1453d6..c03b72c174 100644 --- a/lib/safe_inet_addr.c +++ b/lib/safe_inet_addr.c @@ -1,6 +1,6 @@ /* - * $Id: safe_inet_addr.c,v 1.13 2003/01/23 00:37:01 robertc Exp $ + * $Id: safe_inet_addr.c,v 1.14 2005/04/18 21:52:40 hno Exp $ */ #include "config.h" @@ -31,11 +31,11 @@ #include "snprintf.h" int -safe_inet_addr(const char *buf, struct in_addr *addr) +safe_inet_addr(const char *buf, struct IN_ADDR *addr) { static char addrbuf[32]; int a1 = 0, a2 = 0, a3 = 0, a4 = 0; - struct in_addr A; + struct IN_ADDR A; char x; #if defined(_SQUID_HPUX_) /* diff --git a/src/ACLARP.cc b/src/ACLARP.cc index ffbf303648..bee7ef9cf1 100644 --- a/src/ACLARP.cc +++ b/src/ACLARP.cc @@ -1,5 +1,5 @@ /* - * $Id: ACLARP.cc,v 1.11 2005/01/06 10:44:39 serassio Exp $ + * $Id: ACLARP.cc,v 1.12 2005/04/18 21:52:41 hno Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -82,7 +82,7 @@ struct arpreq #endif static void aclParseArpList(SplayNode **curlist); static int decode_eth(const char *asc, char *eth); -static int aclMatchArp(SplayNode **dataptr, struct in_addr c); +static int aclMatchArp(SplayNode **dataptr, struct IN_ADDR c); static SplayNode::SPLAYCMP aclArpCompare; static SplayNode::SPLAYWALKEE aclDumpArpListWalkee; @@ -231,7 +231,7 @@ ACLARP::match(ACLChecklist *checklist) /* aclMatchArp */ /***************/ int -aclMatchArp(SplayNode **dataptr, struct in_addr c) +aclMatchArp(SplayNode **dataptr, struct IN_ADDR c) { #if defined(_SQUID_LINUX_) diff --git a/src/ACLASN.h b/src/ACLASN.h index a09325ce11..7733925d14 100644 --- a/src/ACLASN.h +++ b/src/ACLASN.h @@ -1,6 +1,6 @@ /* - * $Id: ACLASN.h,v 1.5 2004/08/30 05:12:31 robertc Exp $ + * $Id: ACLASN.h,v 1.6 2005/04/18 21:52:41 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -40,11 +40,11 @@ #include "ACLStrategised.h" #include "ACLChecklist.h" -SQUIDCEXTERN int asnMatchIp(List *, struct in_addr); +SQUIDCEXTERN int asnMatchIp(List *, struct IN_ADDR); SQUIDCEXTERN void asnInit(void); SQUIDCEXTERN void asnFreeMemory(void); -class ACLASN : public ACLData +class ACLASN : public ACLData { public: @@ -52,17 +52,17 @@ public: virtual ~ACLASN(); - virtual bool match(struct in_addr); + virtual bool match(struct IN_ADDR); virtual wordlist *dump(); virtual void parse(); - virtual ACLData *clone() const; + virtual ACLData *clone() const; virtual void prepareForUse(); private: static ACL::Prototype SourceRegistryProtoype; - static ACLStrategised SourceRegistryEntry_; + static ACLStrategised SourceRegistryEntry_; static ACL::Prototype DestinationRegistryProtoype; - static ACLStrategised DestinationRegistryEntry_; + static ACLStrategised DestinationRegistryEntry_; List *data; }; diff --git a/src/ACLChecklist.cc b/src/ACLChecklist.cc index bcb2499a50..4c13356f58 100644 --- a/src/ACLChecklist.cc +++ b/src/ACLChecklist.cc @@ -1,5 +1,5 @@ /* - * $Id: ACLChecklist.cc,v 1.25 2004/12/27 15:57:15 hno Exp $ + * $Id: ACLChecklist.cc,v 1.26 2005/04/18 21:52:41 hno Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -301,11 +301,11 @@ ACLChecklist::ACLChecklist() : accessList (NULL), my_port (0), request (NULL), sourceDomainChecked_(false) { - memset (&src_addr, '\0', sizeof (struct in_addr)); + memset (&src_addr, '\0', sizeof (struct IN_ADDR)); - memset (&dst_addr, '\0', sizeof (struct in_addr)); + memset (&dst_addr, '\0', sizeof (struct IN_ADDR)); - memset (&my_addr, '\0', sizeof (struct in_addr)); + memset (&my_addr, '\0', sizeof (struct IN_ADDR)); rfc931[0] = '\0'; } diff --git a/src/ACLChecklist.h b/src/ACLChecklist.h index 0e06f3a468..763bc85e03 100644 --- a/src/ACLChecklist.h +++ b/src/ACLChecklist.h @@ -1,6 +1,6 @@ /* - * $Id: ACLChecklist.h,v 1.19 2003/09/21 12:06:06 robertc Exp $ + * $Id: ACLChecklist.h,v 1.20 2005/04/18 21:52:41 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -114,11 +114,11 @@ class NullState : public AsyncState const acl_access *accessList; - struct in_addr src_addr; + struct IN_ADDR src_addr; - struct in_addr dst_addr; + struct IN_ADDR dst_addr; - struct in_addr my_addr; + struct IN_ADDR my_addr; unsigned short my_port; HttpRequest *request; /* for acls that look at reply data */ diff --git a/src/ACLDestinationASN.h b/src/ACLDestinationASN.h index bdcbbd0a7b..02e19e843e 100644 --- a/src/ACLDestinationASN.h +++ b/src/ACLDestinationASN.h @@ -1,6 +1,6 @@ /* - * $Id: ACLDestinationASN.h,v 1.1 2003/02/25 12:22:33 robertc Exp $ + * $Id: ACLDestinationASN.h,v 1.2 2005/04/18 21:52:41 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -38,7 +38,7 @@ #include "ACLASN.h" #include "ACLStrategy.h" -class ACLDestinationASNStrategy : public ACLStrategy +class ACLDestinationASNStrategy : public ACLStrategy { public: diff --git a/src/ACLIP.cc b/src/ACLIP.cc index f4aec2b351..a252612bb2 100644 --- a/src/ACLIP.cc +++ b/src/ACLIP.cc @@ -112,11 +112,11 @@ int aclIpAddrNetworkCompare(acl_ip_data * const &p, acl_ip_data * const &q) { - struct in_addr A = p->addr1; + struct IN_ADDR A = p->addr1; - const struct in_addr B = q->addr1; + const struct IN_ADDR B = q->addr1; - const struct in_addr C = q->addr2; + const struct IN_ADDR C = q->addr2; A.s_addr &= q->mask.s_addr; /* apply netmask */ if (C.s_addr == 0) { /* single address check */ @@ -181,7 +181,7 @@ acl_ip_data::NetworkCompare(acl_ip_data * const & a, acl_ip_data * const &b) */ bool -acl_ip_data::DecodeMask(const char *asc, struct in_addr *mask) +acl_ip_data::DecodeMask(const char *asc, struct IN_ADDR *mask) { char junk; int a1 = 0; @@ -360,7 +360,7 @@ ACLIP::valid () const int -ACLIP::match(struct in_addr &clientip) +ACLIP::match(struct IN_ADDR &clientip) { static acl_ip_data ClientAddress (any_addr, any_addr, no_addr, NULL); /* @@ -380,4 +380,4 @@ ACLIP::match(struct in_addr &clientip) acl_ip_data::acl_ip_data () :addr1(any_addr), addr2(any_addr), mask (any_addr), next (NULL) {} -acl_ip_data::acl_ip_data (struct in_addr const &anAddress1, struct in_addr const &anAddress2, struct in_addr const &aMask, acl_ip_data *aNext) : addr1(anAddress1), addr2(anAddress2), mask(aMask), next(aNext){} +acl_ip_data::acl_ip_data (struct IN_ADDR const &anAddress1, struct IN_ADDR const &anAddress2, struct IN_ADDR const &aMask, acl_ip_data *aNext) : addr1(anAddress1), addr2(anAddress2), mask(aMask), next(aNext){} diff --git a/src/ACLIP.h b/src/ACLIP.h index f6acf47be4..7de38af0d5 100644 --- a/src/ACLIP.h +++ b/src/ACLIP.h @@ -48,19 +48,19 @@ public: acl_ip_data (); - acl_ip_data (struct in_addr const &, struct in_addr const &, struct in_addr const &, acl_ip_data *); + acl_ip_data (struct IN_ADDR const &, struct IN_ADDR const &, struct IN_ADDR const &, acl_ip_data *); void toStr(char *buf, int len) const; - struct in_addr addr1; /* if addr2 non-zero then its a range */ + struct IN_ADDR addr1; /* if addr2 non-zero then its a range */ - struct in_addr addr2; + struct IN_ADDR addr2; - struct in_addr mask; + struct IN_ADDR mask; acl_ip_data *next; /* used for parsing, not for storing */ private: - static bool DecodeMask(const char *asc, struct in_addr *mask); + static bool DecodeMask(const char *asc, struct IN_ADDR *mask); }; MEMPROXY_CLASS_INLINE(acl_ip_data) @@ -87,7 +87,7 @@ public: protected: - int match(struct in_addr &); + int match(struct IN_ADDR &); IPSplay *data; private: diff --git a/src/ACLMaxUserIP.cc b/src/ACLMaxUserIP.cc index a8b5565e7a..1f85f7a3a7 100644 --- a/src/ACLMaxUserIP.cc +++ b/src/ACLMaxUserIP.cc @@ -1,5 +1,5 @@ /* - * $Id: ACLMaxUserIP.cc,v 1.6 2004/08/30 05:12:31 robertc Exp $ + * $Id: ACLMaxUserIP.cc,v 1.7 2005/04/18 21:52:41 hno Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -109,7 +109,7 @@ ACLMaxUserIP::parse() int ACLMaxUserIP::match(auth_user_request_t * auth_user_request, - struct in_addr const &src_addr) + struct IN_ADDR const &src_addr) { /* * the logic for flush the ip list when the limit is hit vs keep diff --git a/src/ACLMaxUserIP.h b/src/ACLMaxUserIP.h index ddc5838219..30870b817d 100644 --- a/src/ACLMaxUserIP.h +++ b/src/ACLMaxUserIP.h @@ -1,6 +1,6 @@ /* - * $Id: ACLMaxUserIP.h,v 1.4 2004/08/30 05:12:31 robertc Exp $ + * $Id: ACLMaxUserIP.h,v 1.5 2005/04/18 21:52:41 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -61,7 +61,7 @@ private: static Prototype RegistryProtoype; static ACLMaxUserIP RegistryEntry_; - int match(auth_user_request_t *, struct in_addr const &); + int match(auth_user_request_t *, struct IN_ADDR const &); char const *class_; size_t maximum; diff --git a/src/ACLSourceASN.h b/src/ACLSourceASN.h index baa8fe6a15..7205c2e7c2 100644 --- a/src/ACLSourceASN.h +++ b/src/ACLSourceASN.h @@ -1,6 +1,6 @@ /* - * $Id: ACLSourceASN.h,v 1.1 2003/02/25 12:22:34 robertc Exp $ + * $Id: ACLSourceASN.h,v 1.2 2005/04/18 21:52:41 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -38,7 +38,7 @@ #include "ACLASN.h" #include "ACLStrategy.h" -class ACLSourceASNStrategy : public ACLStrategy +class ACLSourceASNStrategy : public ACLStrategy { public: diff --git a/src/AccessLogEntry.h b/src/AccessLogEntry.h index 0cd23a7c5e..e0ea912868 100644 --- a/src/AccessLogEntry.h +++ b/src/AccessLogEntry.h @@ -1,6 +1,6 @@ /* - * $Id: AccessLogEntry.h,v 1.3 2003/10/16 21:40:16 robertc Exp $ + * $Id: AccessLogEntry.h,v 1.4 2005/04/18 21:52:41 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -90,7 +90,7 @@ public: memset(&caddr, '\0', sizeof(caddr)); } - struct in_addr caddr; + struct IN_ADDR caddr; size_t size; off_t highOffset; size_t objectSize; diff --git a/src/AuthUserRequest.cc b/src/AuthUserRequest.cc index 50d31d5ba4..f9e3f4133b 100644 --- a/src/AuthUserRequest.cc +++ b/src/AuthUserRequest.cc @@ -1,6 +1,6 @@ /* - * $Id: AuthUserRequest.cc,v 1.2 2004/12/20 17:35:58 robertc Exp $ + * $Id: AuthUserRequest.cc,v 1.3 2005/04/18 21:52:41 hno Exp $ * * DO NOT MODIFY NEXT 2 LINES: * arch-tag: 6803fde1-d5a2-4c29-9034-1c0c9f650eb4 @@ -201,7 +201,7 @@ AuthUserRequest::denyMessage(char const * const default_message) static void -authenticateAuthUserRequestSetIp(auth_user_request_t * auth_user_request, struct in_addr ipaddr) +authenticateAuthUserRequestSetIp(auth_user_request_t * auth_user_request, struct IN_ADDR ipaddr) { auth_user_ip_t *ipdata, *tempnode; auth_user_t *auth_user; @@ -266,7 +266,7 @@ authenticateAuthUserRequestSetIp(auth_user_request_t * auth_user_request, struct void -authenticateAuthUserRequestRemoveIp(auth_user_request_t * auth_user_request, struct in_addr ipaddr) +authenticateAuthUserRequestRemoveIp(auth_user_request_t * auth_user_request, struct IN_ADDR ipaddr) { auth_user_ip_t *ipdata; auth_user_t *auth_user; @@ -403,7 +403,7 @@ authTryGetUser (auth_user_request_t **auth_user_request, ConnStateData::Pointer */ auth_acl_t -AuthUserRequest::authenticate(auth_user_request_t ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData::Pointer conn, struct in_addr src_addr) +AuthUserRequest::authenticate(auth_user_request_t ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData::Pointer conn, struct IN_ADDR src_addr) { const char *proxy_auth; assert(headertype != 0); @@ -616,7 +616,7 @@ AuthUserRequest::authenticate(auth_user_request_t ** auth_user_request, http_hdr auth_acl_t -AuthUserRequest::tryToAuthenticateAndSetAuthUser(auth_user_request_t ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData::Pointer conn, struct in_addr src_addr) +AuthUserRequest::tryToAuthenticateAndSetAuthUser(auth_user_request_t ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData::Pointer conn, struct IN_ADDR src_addr) { /* If we have already been called, return the cached value */ auth_user_request_t *t = authTryGetUser (auth_user_request, conn, request); diff --git a/src/AuthUserRequest.h b/src/AuthUserRequest.h index ac248489d3..f93352ce3a 100644 --- a/src/AuthUserRequest.h +++ b/src/AuthUserRequest.h @@ -1,6 +1,6 @@ /* - * $Id: AuthUserRequest.h,v 1.1 2004/08/30 03:28:56 robertc Exp $ + * $Id: AuthUserRequest.h,v 1.2 2005/04/18 21:52:41 hno Exp $ * * DO NOT MODIFY NEXT 2 LINES: * arch-tag: 674533af-8b21-4641-b71a-74c4639072a0 @@ -49,7 +49,7 @@ struct AuthUserIP dlink_node node; /* IP addr this user authenticated from */ - struct in_addr ipaddr; + struct IN_ADDR ipaddr; time_t ip_expiretime; }; @@ -81,7 +81,7 @@ public: public: - static auth_acl_t tryToAuthenticateAndSetAuthUser(auth_user_request_t **, http_hdr_type, HttpRequest *, ConnStateData::Pointer, struct in_addr); + static auth_acl_t tryToAuthenticateAndSetAuthUser(auth_user_request_t **, http_hdr_type, HttpRequest *, ConnStateData::Pointer, struct IN_ADDR); static void addReplyAuthHeader(HttpReply * rep, auth_user_request_t * auth_user_request, HttpRequest * request, int accelerated, int internal); AuthUserRequest(); @@ -110,7 +110,7 @@ public: private: - static auth_acl_t authenticate(auth_user_request_t ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData::Pointer conn, struct in_addr src_addr); + static auth_acl_t authenticate(auth_user_request_t ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData::Pointer conn, struct IN_ADDR src_addr); /* return a message on the 407 error pages */ char *message; @@ -131,7 +131,7 @@ extern size_t authenticateRequestRefCount (auth_user_request_t *); extern void authenticateFixHeader(HttpReply *, auth_user_request_t *, HttpRequest *, int, int); extern void authenticateAddTrailer(HttpReply *, auth_user_request_t *, HttpRequest *, int); -extern void authenticateAuthUserRequestRemoveIp(auth_user_request_t *, struct in_addr); +extern void authenticateAuthUserRequestRemoveIp(auth_user_request_t *, struct IN_ADDR); extern void authenticateAuthUserRequestClearIp(auth_user_request_t *); extern size_t authenticateAuthUserRequestIPCount(auth_user_request_t *); extern int authenticateDirection(auth_user_request_t *); diff --git a/src/CompositePoolNode.h b/src/CompositePoolNode.h index 95b480c677..6cb057754c 100644 --- a/src/CompositePoolNode.h +++ b/src/CompositePoolNode.h @@ -1,6 +1,6 @@ /* - * $Id: CompositePoolNode.h,v 1.5 2003/08/04 22:14:40 robertc Exp $ + * $Id: CompositePoolNode.h,v 1.6 2005/04/18 21:52:41 hno Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: Robert Collins @@ -76,7 +76,7 @@ public: public: CompositeSelectionDetails() {} - struct in_addr src_addr; + struct IN_ADDR src_addr; AuthUserRequest *user; String tag; }; diff --git a/src/ESI.cc b/src/ESI.cc index 28c5771bf5..975b1010a7 100644 --- a/src/ESI.cc +++ b/src/ESI.cc @@ -1,6 +1,6 @@ /* - * $Id: ESI.cc,v 1.12 2004/12/21 17:28:28 robertc Exp $ + * $Id: ESI.cc,v 1.13 2005/04/18 21:52:41 hno Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -1437,7 +1437,7 @@ ESIContext::freeResources () /* don't touch incoming, it's a pointer into buffered anyway */ } -extern ErrorState *clientBuildError (err_type, http_status, char const *, struct in_addr *, HttpRequest *); +extern ErrorState *clientBuildError (err_type, http_status, char const *, struct IN_ADDR *, HttpRequest *); /* This can ONLY be used before we have sent *any* data to the client */ diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc index 651c29bf9f..65491831a7 100644 --- a/src/HttpRequest.cc +++ b/src/HttpRequest.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpRequest.cc,v 1.47 2004/08/30 05:12:31 robertc Exp $ + * $Id: HttpRequest.cc,v 1.48 2005/04/18 21:52:41 hno Exp $ * * DEBUG: section 73 HTTP Request * AUTHOR: Duane Wessels @@ -63,9 +63,9 @@ HttpRequest::HttpRequest() : header(hoRequest) int max_forwards; /* these in_addr's could probably be sockaddr_in's */ - struct in_addr client_addr; + struct IN_ADDR client_addr; - struct in_addr my_addr; + struct IN_ADDR my_addr; unsigned short my_port; unsigned short client_port; HttpHeader header; diff --git a/src/HttpRequest.h b/src/HttpRequest.h index bd8ed8f580..86b40f9c86 100644 --- a/src/HttpRequest.h +++ b/src/HttpRequest.h @@ -1,6 +1,6 @@ /* - * $Id: HttpRequest.h,v 1.10 2004/08/30 05:12:31 robertc Exp $ + * $Id: HttpRequest.h,v 1.11 2005/04/18 21:52:41 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -82,9 +82,9 @@ public: int max_forwards; /* these in_addr's could probably be sockaddr_in's */ - struct in_addr client_addr; + struct IN_ADDR client_addr; - struct in_addr my_addr; + struct IN_ADDR my_addr; unsigned short my_port; unsigned short client_port; HttpHeader header; diff --git a/src/asn.cc b/src/asn.cc index 93c389d7ed..62eee5f534 100644 --- a/src/asn.cc +++ b/src/asn.cc @@ -1,6 +1,6 @@ /* - * $Id: asn.cc,v 1.99 2004/08/30 05:12:31 robertc Exp $ + * $Id: asn.cc,v 1.100 2005/04/18 21:52:42 hno Exp $ * * DEBUG: section 53 AS Number handling * AUTHOR: Duane Wessels, Kostas Anagnostakis @@ -130,7 +130,7 @@ static OBJH asnStats; /* PUBLIC */ int -asnMatchIp(List *data, struct in_addr addr) +asnMatchIp(List *data, struct IN_ADDR addr) { unsigned long lh; @@ -393,7 +393,7 @@ asnAddNet(char *as_string, int as_number) List *q = NULL; as_info *asinfo = NULL; - struct in_addr in_a, in_m; + struct IN_ADDR in_a, in_m; long mask, addr; char *t; int bitl; @@ -539,9 +539,9 @@ printRadixNode(struct squid_radix_node *rn, void *_sentry) List *q; as_info *asinfo; - struct in_addr addr; + struct IN_ADDR addr; - struct in_addr mask; + struct IN_ADDR mask; assert(e); assert(e->e_info); (void) get_m_int(addr.s_addr, e->e_addr); @@ -567,7 +567,7 @@ ACLASN::~ACLASN() bool -ACLASN::match(struct in_addr toMatch) +ACLASN::match(struct IN_ADDR toMatch) { return asnMatchIp(data, toMatch); } @@ -606,7 +606,7 @@ ACLASN::parse() } } -ACLData * +ACLData * ACLASN::clone() const { if (data) @@ -617,17 +617,17 @@ ACLASN::clone() const /* explicit template instantiation required for some systems */ -template class ACLStrategised +template class ACLStrategised ; ACL::Prototype ACLASN::SourceRegistryProtoype(&ACLASN::SourceRegistryEntry_, "src_as"); -ACLStrategised ACLASN::SourceRegistryEntry_(new ACLASN, ACLSourceASNStrategy::Instance(), "src_as"); +ACLStrategised ACLASN::SourceRegistryEntry_(new ACLASN, ACLSourceASNStrategy::Instance(), "src_as"); ACL::Prototype ACLASN::DestinationRegistryProtoype(&ACLASN::DestinationRegistryEntry_, "dst_as"); -ACLStrategised ACLASN::DestinationRegistryEntry_(new ACLASN, ACLDestinationASNStrategy::Instance(), "dst_as"); +ACLStrategised ACLASN::DestinationRegistryEntry_(new ACLASN, ACLDestinationASNStrategy::Instance(), "dst_as"); int ACLSourceASNStrategy::match (ACLData * &data, ACLChecklist *checklist) diff --git a/src/auth/digest/auth_digest.cc b/src/auth/digest/auth_digest.cc index 5b26c8c838..8e230b8253 100644 --- a/src/auth/digest/auth_digest.cc +++ b/src/auth/digest/auth_digest.cc @@ -1,6 +1,6 @@ /* - * $Id: auth_digest.cc,v 1.41 2004/12/24 01:03:39 hno Exp $ + * $Id: auth_digest.cc,v 1.42 2005/04/18 21:52:43 hno Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Robert Collins @@ -639,7 +639,7 @@ AuthDigestUserRequest::authenticate(HttpRequest * request, ConnStateData::Pointe } else { const char *useragent = httpHeaderGetStr(&request->header, HDR_USER_AGENT); - static struct in_addr last_broken_addr; + static struct IN_ADDR last_broken_addr; static int seen_broken_client = 0; if (!seen_broken_client) { diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 96b2c6d897..1d10037738 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.468 2005/03/18 17:12:34 hno Exp $ + * $Id: cache_cf.cc,v 1.469 2005/04/18 21:52:42 hno Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -861,14 +861,14 @@ free_acl_access(acl_access ** head) static void -dump_address(StoreEntry * entry, const char *name, struct in_addr addr) +dump_address(StoreEntry * entry, const char *name, struct IN_ADDR addr) { storeAppendPrintf(entry, "%s %s\n", name, inet_ntoa(addr)); } static void -parse_address(struct in_addr *addr) +parse_address(struct IN_ADDR *addr) { const struct hostent *hp; @@ -887,10 +887,10 @@ parse_address(struct in_addr *addr) static void -free_address(struct in_addr *addr) +free_address(struct IN_ADDR *addr) { - memset(addr, '\0', sizeof(struct in_addr)); + memset(addr, '\0', sizeof(struct IN_ADDR)); } CBDATA_TYPE(acl_address); diff --git a/src/cachemgr.cc b/src/cachemgr.cc index 8697dd4e70..7bb171623e 100644 --- a/src/cachemgr.cc +++ b/src/cachemgr.cc @@ -1,6 +1,6 @@ /* - * $Id: cachemgr.cc,v 1.107 2004/12/21 17:28:29 robertc Exp $ + * $Id: cachemgr.cc,v 1.108 2005/04/18 21:52:42 hno Exp $ * * DEBUG: section 0 CGI Cache Manager * AUTHOR: Duane Wessels @@ -162,7 +162,7 @@ static const char *script_name = "/cgi-bin/cachemgr.cgi"; static const char *progname = NULL; static time_t now; -static struct in_addr no_addr; +static struct IN_ADDR no_addr; /* * Function prototypes diff --git a/src/client_db.cc b/src/client_db.cc index 5c96dd2b13..32314b247d 100644 --- a/src/client_db.cc +++ b/src/client_db.cc @@ -1,6 +1,6 @@ /* - * $Id: client_db.cc,v 1.62 2004/12/22 17:37:37 serassio Exp $ + * $Id: client_db.cc,v 1.63 2005/04/18 21:52:42 hno Exp $ * * DEBUG: section 0 Client Database * AUTHOR: Duane Wessels @@ -39,7 +39,7 @@ static hash_table *client_table = NULL; -static ClientInfo *clientdbAdd(struct in_addr addr); +static ClientInfo *clientdbAdd(struct IN_ADDR addr); static FREE clientdbFreeItem; static void clientdbStartGC(void); static void clientdbScheduledGC(void *); @@ -53,7 +53,7 @@ static int cleanup_removed; static ClientInfo * -clientdbAdd(struct in_addr addr) +clientdbAdd(struct IN_ADDR addr) { ClientInfo *c; c = (ClientInfo *)memAllocate(MEM_CLIENT_INFO); @@ -87,7 +87,7 @@ clientdbInit(void) void -clientdbUpdate(struct in_addr addr, log_type ltype, protocol_t p, size_t size) +clientdbUpdate(struct IN_ADDR addr, log_type ltype, protocol_t p, size_t size) { char *key; ClientInfo *c; @@ -135,7 +135,7 @@ clientdbUpdate(struct in_addr addr, log_type ltype, protocol_t p, size_t size) */ int -clientdbEstablished(struct in_addr addr, int delta) +clientdbEstablished(struct IN_ADDR addr, int delta) { char *key; ClientInfo *c; @@ -161,7 +161,7 @@ clientdbEstablished(struct in_addr addr, int delta) #define CUTOFF_SECONDS 3600 int -clientdbCutoffDenied(struct in_addr addr) +clientdbCutoffDenied(struct IN_ADDR addr) { char *key; int NR; @@ -377,9 +377,9 @@ clientdbStartGC(void) #if SQUID_SNMP -struct in_addr * +struct IN_ADDR * - client_entry(struct in_addr *current) + client_entry(struct IN_ADDR *current) { ClientInfo *c = NULL; char *key; diff --git a/src/client_side.h b/src/client_side.h index 775793dc9d..539b129f69 100644 --- a/src/client_side.h +++ b/src/client_side.h @@ -1,6 +1,6 @@ /* - * $Id: client_side.h,v 1.9 2003/08/14 12:15:04 robertc Exp $ + * $Id: client_side.h,v 1.10 2005/04/18 21:52:42 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -182,7 +182,7 @@ public: struct sockaddr_in me; - struct in_addr log_addr; + struct IN_ADDR log_addr; char rfc931[USER_IDENT_SZ]; int nrequests; diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index 2dd3ab4782..5e0c17d7ed 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side_reply.cc,v 1.82 2005/03/09 20:43:38 serassio Exp $ + * $Id: client_side_reply.cc,v 1.83 2005/04/18 21:52:42 hno Exp $ * * DEBUG: section 88 Client-side Reply Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -59,7 +59,7 @@ CBDATA_CLASS_INIT(clientReplyContext); extern "C" CSS clientReplyStatus; extern ErrorState *clientBuildError(err_type, http_status, char const *, - struct in_addr *, HttpRequest *); + struct IN_ADDR *, HttpRequest *); /* privates */ @@ -88,7 +88,7 @@ void clientReplyContext::setReplyToError( err_type err, http_status status, method_t method, char const *uri, - struct in_addr *addr, HttpRequest * failedrequest, char *unparsedrequest, + struct IN_ADDR *addr, HttpRequest * failedrequest, char *unparsedrequest, auth_user_request_t * auth_user_request) { ErrorState *errstate = @@ -2167,7 +2167,7 @@ clientReplyContext::createStoreEntry(method_t m, request_flags flags) ErrorState * clientBuildError(err_type page_id, http_status status, char const *url, - struct in_addr * src_addr, HttpRequest * request) + struct IN_ADDR * src_addr, HttpRequest * request) { ErrorState *err = errorCon(page_id, status); err->src_addr = *src_addr; diff --git a/src/client_side_reply.h b/src/client_side_reply.h index fcde7524e1..93aab8eb80 100644 --- a/src/client_side_reply.h +++ b/src/client_side_reply.h @@ -1,6 +1,6 @@ /* - * $Id: client_side_reply.h,v 1.6 2003/08/10 11:00:42 robertc Exp $ + * $Id: client_side_reply.h,v 1.7 2005/04/18 21:52:42 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -73,7 +73,7 @@ public: int storeOKTransferDone() const; int storeNotOKTransferDone() const; - void setReplyToError(err_type, http_status, method_t, char const *, struct in_addr *, HttpRequest *, char *, auth_user_request_t *); + void setReplyToError(err_type, http_status, method_t, char const *, struct IN_ADDR *, HttpRequest *, char *, auth_user_request_t *); void createStoreEntry(method_t m, request_flags flags); void removeStoreReference(store_client ** scp, StoreEntry ** ep); void removeClientStoreReference(store_client **scp, ClientHttpRequest *http); diff --git a/src/comm.cc b/src/comm.cc index e40e453f5f..488d916dcc 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,6 +1,6 @@ /* - * $Id: comm.cc,v 1.403 2005/04/06 19:01:01 serassio Exp $ + * $Id: comm.cc,v 1.404 2005/04/18 21:52:42 hno Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -66,7 +66,7 @@ public: struct sockaddr_in S; CallBack callback; - struct in_addr in_addr; + struct IN_ADDR in_addr; int fd; int tries; int addrcount; @@ -78,7 +78,7 @@ private: /* STATIC */ -static comm_err_t commBind(int s, struct in_addr, u_short port); +static comm_err_t commBind(int s, struct IN_ADDR, u_short port); static void commSetReuseAddr(int); static void commSetNoLinger(int); static void CommWriteStateCallbackAndFree(int fd, comm_err_t code); @@ -1015,7 +1015,7 @@ comm_local_port(int fd) static comm_err_t -commBind(int s, struct in_addr in_addr, u_short port) +commBind(int s, struct IN_ADDR in_addr, u_short port) { struct sockaddr_in S; @@ -1044,7 +1044,7 @@ int comm_open(int sock_type, int proto, - struct in_addr addr, + struct IN_ADDR addr, u_short port, int flags, const char *note) @@ -1064,7 +1064,7 @@ int comm_openex(int sock_type, int proto, - struct in_addr addr, + struct IN_ADDR addr, u_short port, int flags, unsigned char TOS, diff --git a/src/delay_pools.cc b/src/delay_pools.cc index 2d32f656b1..6a2fb9f2a6 100644 --- a/src/delay_pools.cc +++ b/src/delay_pools.cc @@ -1,6 +1,6 @@ /* - * $Id: delay_pools.cc,v 1.42 2003/08/04 22:14:42 robertc Exp $ + * $Id: delay_pools.cc,v 1.43 2005/04/18 21:52:42 hno Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: Robert Collins @@ -149,7 +149,7 @@ protected: virtual char const *label() const = 0; - virtual unsigned int const makeKey (struct in_addr &src_addr) const = 0; + virtual unsigned int const makeKey (struct IN_ADDR &src_addr) const = 0; DelaySpec spec; @@ -179,7 +179,7 @@ public: protected: virtual char const *label() const {return "Individual";} - virtual unsigned int const makeKey (struct in_addr &src_addr) const; + virtual unsigned int const makeKey (struct IN_ADDR &src_addr) const; }; @@ -193,7 +193,7 @@ public: protected: virtual char const *label() const {return "Network";} - virtual unsigned int const makeKey (struct in_addr &src_addr) const; + virtual unsigned int const makeKey (struct IN_ADDR &src_addr) const; }; /* don't use remote storage for these */ @@ -236,9 +236,9 @@ protected: virtual char const *label() const {return "Individual";} - virtual unsigned int const makeKey (struct in_addr &src_addr) const; + virtual unsigned int const makeKey (struct IN_ADDR &src_addr) const; - unsigned char const makeHostKey (struct in_addr &src_addr) const; + unsigned char const makeHostKey (struct IN_ADDR &src_addr) const; DelaySpec spec; VectorMap buckets; @@ -837,7 +837,7 @@ VectorPool::Id::bytesIn(int qty) unsigned int const -IndividualPool::makeKey (struct in_addr &src_addr) const +IndividualPool::makeKey (struct IN_ADDR &src_addr) const { unsigned int host; host = ntohl(src_addr.s_addr) & 0xff; @@ -860,7 +860,7 @@ ClassCNetPool::operator delete (void *address) unsigned int const -ClassCNetPool::makeKey (struct in_addr &src_addr) const +ClassCNetPool::makeKey (struct IN_ADDR &src_addr) const { unsigned int net; net = (ntohl(src_addr.s_addr) >> 8) & 0xff; @@ -930,7 +930,7 @@ ClassCHostPool::keyAllocated (unsigned char const key) const unsigned char const -ClassCHostPool::makeHostKey (struct in_addr &src_addr) const +ClassCHostPool::makeHostKey (struct IN_ADDR &src_addr) const { unsigned int host; host = ntohl(src_addr.s_addr) & 0xff; @@ -939,7 +939,7 @@ ClassCHostPool::makeHostKey (struct in_addr &src_addr) const unsigned int const -ClassCHostPool::makeKey (struct in_addr &src_addr) const +ClassCHostPool::makeKey (struct IN_ADDR &src_addr) const { unsigned int net; net = (ntohl(src_addr.s_addr) >> 8) & 0xff; diff --git a/src/dns_internal.cc b/src/dns_internal.cc index 2d5ac0b115..3270bb5e12 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.cc,v 1.66 2004/12/20 16:30:35 robertc Exp $ + * $Id: dns_internal.cc,v 1.67 2005/04/18 21:52:42 hno Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -122,7 +122,7 @@ static void idnsAddNameserver(const char *buf) { - struct in_addr A; + struct IN_ADDR A; if (!safe_inet_addr(buf, &A)) { debug(78, 0) ("WARNING: rejecting '%s' as a name server, because it is not a numeric IP address\n", buf); @@ -795,7 +795,7 @@ idnsInit(void) if (DnsSocket < 0) { int port; - struct in_addr addr; + struct IN_ADDR addr; if (Config.Addrs.udp_outgoing.s_addr != no_addr.s_addr) addr = Config.Addrs.udp_outgoing; @@ -933,7 +933,7 @@ idnsALookup(const char *name, IDNSCB * callback, void *data) void -idnsPTRLookup(const struct in_addr addr, IDNSCB * callback, void *data) +idnsPTRLookup(const struct IN_ADDR addr, IDNSCB * callback, void *data) { idns_query *q; diff --git a/src/dnsserver.cc b/src/dnsserver.cc index 0adf260f26..cf1ebd4896 100644 --- a/src/dnsserver.cc +++ b/src/dnsserver.cc @@ -1,6 +1,6 @@ /* - * $Id: dnsserver.cc,v 1.69 2004/12/21 17:28:29 robertc Exp $ + * $Id: dnsserver.cc,v 1.70 2005/04/18 21:52:42 hno Exp $ * * DEBUG: section 0 DNS Resolver * AUTHOR: Harvest Derived @@ -160,7 +160,7 @@ struct hostent *_res_gethostbyname(char *name); #define gethostbyname _res_gethostbyname #endif /* _SQUID_NEXT_ */ -static struct in_addr no_addr; +static struct IN_ADDR no_addr; #ifdef _SQUID_OS2_ @@ -198,7 +198,7 @@ lookup(const char *buf) int retry = 0; int i; - struct in_addr addr; + struct IN_ADDR addr; if (0 == strcmp(buf, "$shutdown")) exit(0); diff --git a/src/fde.h b/src/fde.h index c666a4c0f6..faaf8ee50c 100644 --- a/src/fde.h +++ b/src/fde.h @@ -1,6 +1,6 @@ /* - * $Id: fde.h,v 1.7 2005/03/18 15:17:17 hno Exp $ + * $Id: fde.h,v 1.8 2005/04/18 21:52:42 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -50,7 +50,7 @@ public: u_short local_port; u_short remote_port; - struct in_addr local_addr; + struct IN_ADDR local_addr; unsigned char tos; char ipaddr[16]; /* dotted decimal address of peer */ char desc[FD_DESC_SZ]; diff --git a/src/forward.cc b/src/forward.cc index 679204ad2f..a9ce3e55b4 100644 --- a/src/forward.cc +++ b/src/forward.cc @@ -1,6 +1,6 @@ /* - * $Id: forward.cc,v 1.126 2005/03/18 15:22:05 hno Exp $ + * $Id: forward.cc,v 1.127 2005/04/18 21:52:42 hno Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -484,12 +484,12 @@ fwdConnectTimeout(int fd, void *data) comm_close(fd); } -static struct in_addr +static struct IN_ADDR aclMapAddr(acl_address * head, ACLChecklist * ch) { acl_address *l; - struct in_addr addr; + struct IN_ADDR addr; for (l = head; l; l = l->next) { @@ -514,7 +514,7 @@ aclMapTOS(acl_tos * head, ACLChecklist * ch) return 0; } -struct in_addr +struct IN_ADDR getOutgoingAddr(HttpRequest * request) { ACLChecklist ch; @@ -559,7 +559,7 @@ fwdConnectStart(void *data) int ctimeout; int ftimeout = Config.Timeout.forward - (squid_curtime - fwdState->start); - struct in_addr outgoing; + struct IN_ADDR outgoing; unsigned short tos; assert(fs); assert(fwdState->server_fd == -1); diff --git a/src/fqdncache.cc b/src/fqdncache.cc index aa239a47b7..cc1f323cfd 100644 --- a/src/fqdncache.cc +++ b/src/fqdncache.cc @@ -1,6 +1,6 @@ /* - * $Id: fqdncache.cc,v 1.163 2005/02/13 15:49:50 serassio Exp $ + * $Id: fqdncache.cc,v 1.164 2005/04/18 21:52:42 hno Exp $ * * DEBUG: section 35 FQDN Cache * AUTHOR: Harvest Derived @@ -432,7 +432,7 @@ fqdncacheHandleReply(void *data, rfc1035_rr * answers, int na, const char *error void -fqdncache_nbgethostbyaddr(struct in_addr addr, FQDNH * handler, void *handlerData) +fqdncache_nbgethostbyaddr(struct IN_ADDR addr, FQDNH * handler, void *handlerData) { fqdncache_entry *f = NULL; char *name = inet_ntoa(addr); @@ -531,12 +531,12 @@ fqdncache_init(void) const char * -fqdncache_gethostbyaddr(struct in_addr addr, int flags) +fqdncache_gethostbyaddr(struct IN_ADDR addr, int flags) { char *name = inet_ntoa(addr); fqdncache_entry *f = NULL; - struct in_addr ip; + struct IN_ADDR ip; assert(name); FqdncacheStats.requests++; f = fqdncache_get(name); @@ -636,7 +636,7 @@ dummy_handler(const char *bufnotused, void *datanotused) const char * -fqdnFromAddr(struct in_addr addr) +fqdnFromAddr(struct IN_ADDR addr) { const char *n; static char buf[32]; diff --git a/src/globals.h b/src/globals.h index 006e131f4c..ddb0e7866f 100644 --- a/src/globals.h +++ b/src/globals.h @@ -1,6 +1,6 @@ /* - * $Id: globals.h,v 1.129 2005/03/18 15:47:41 hno Exp $ + * $Id: globals.h,v 1.130 2005/04/18 21:52:42 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -103,15 +103,15 @@ extern iostats IOStats; extern struct _acl_deny_info_list *DenyInfoList; /* NULL */ -extern struct in_addr any_addr; +extern struct IN_ADDR any_addr; -extern struct in_addr local_addr; +extern struct IN_ADDR local_addr; -extern struct in_addr no_addr; +extern struct IN_ADDR no_addr; -extern struct in_addr theOutICPAddr; +extern struct IN_ADDR theOutICPAddr; -extern struct in_addr theOutSNMPAddr; +extern struct IN_ADDR theOutSNMPAddr; extern struct timeval current_time; diff --git a/src/icmp.cc b/src/icmp.cc index 7377d1e0f5..abae766c41 100644 --- a/src/icmp.cc +++ b/src/icmp.cc @@ -1,6 +1,6 @@ /* - * $Id: icmp.cc,v 1.84 2003/06/12 23:54:17 wessels Exp $ + * $Id: icmp.cc,v 1.85 2005/04/18 21:52:42 hno Exp $ * * DEBUG: section 37 ICMP Routines * AUTHOR: Duane Wessels @@ -54,7 +54,7 @@ static void icmpHandleSourcePing(const struct sockaddr_in *from, const char *buf static void -icmpSendEcho(struct in_addr to, int opcode, const char *payload, int len) +icmpSendEcho(struct IN_ADDR to, int opcode, const char *payload, int len) { static pingerEchoData pecho; @@ -179,7 +179,7 @@ icmpHandleSourcePing(const struct sockaddr_in *from, const char *buf) #if ALLOW_SOURCE_PING void -icmpSourcePing(struct in_addr to, const icp_common_t * header, const char *url) +icmpSourcePing(struct IN_ADDR to, const icp_common_t * header, const char *url) { #if USE_ICMP char *payload; @@ -211,7 +211,7 @@ icmpSourcePing(struct in_addr to, const icp_common_t * header, const char *url) void -icmpDomainPing(struct in_addr to, const char *domain) +icmpDomainPing(struct IN_ADDR to, const char *domain) { #if USE_ICMP debug(37, 3) ("icmpDomainPing: '%s'\n", domain); diff --git a/src/icp_v2.cc b/src/icp_v2.cc index b69255e704..f6d2eb5b70 100644 --- a/src/icp_v2.cc +++ b/src/icp_v2.cc @@ -1,6 +1,6 @@ /* - * $Id: icp_v2.cc,v 1.84 2003/09/21 00:30:47 robertc Exp $ + * $Id: icp_v2.cc,v 1.85 2005/04/18 21:52:42 hno Exp $ * * DEBUG: section 12 Internet Cache Protocol * AUTHOR: Duane Wessels @@ -42,7 +42,7 @@ #include "ACL.h" #include "AccessLogEntry.h" -static void icpLogIcp(struct in_addr, log_type, int, const char *, int); +static void icpLogIcp(struct IN_ADDR, log_type, int, const char *, int); static void icpHandleIcpV2(int, struct sockaddr_in, char *, int); static void icpCount(void *, int, size_t, int); @@ -155,7 +155,7 @@ ICP2State::created (StoreEntry *newEntry) static void -icpLogIcp(struct in_addr caddr, log_type logcode, int len, const char *url, int delay) +icpLogIcp(struct IN_ADDR caddr, log_type logcode, int len, const char *url, int delay) { AccessLogEntry al; @@ -566,7 +566,7 @@ static void icpPktDump(icp_common_t * pkt) { - struct in_addr a; + struct IN_ADDR a; debug(12, 9) ("opcode: %3d %s\n", (int) pkt->opcode, @@ -663,7 +663,7 @@ icpConnectionsOpen(void) { u_int16_t port; - struct in_addr addr; + struct IN_ADDR addr; struct sockaddr_in xaddr; int x; @@ -729,7 +729,7 @@ icpConnectionsOpen(void) theOutIcpConnection = theInIcpConnection; } - memset(&theOutICPAddr, '\0', sizeof(struct in_addr)); + memset(&theOutICPAddr, '\0', sizeof(struct IN_ADDR)); len = sizeof(struct sockaddr_in); memset(&xaddr, '\0', len); diff --git a/src/ipcache.cc b/src/ipcache.cc index 7ac28dd8bf..a53c84ccb6 100644 --- a/src/ipcache.cc +++ b/src/ipcache.cc @@ -1,6 +1,6 @@ /* - * $Id: ipcache.cc,v 1.250 2005/02/13 15:49:50 serassio Exp $ + * $Id: ipcache.cc,v 1.251 2005/04/18 21:52:42 hno Exp $ * * DEBUG: section 14 IP Cache * AUTHOR: Harvest Derived @@ -333,7 +333,7 @@ ipcacheParse(ipcache_entry *i, const char *inbuf) if (ipcount > 0) { int j, k; - i->addrs.in_addrs = (struct in_addr *)xcalloc(ipcount, sizeof(struct in_addr)); + i->addrs.in_addrs = (struct IN_ADDR *)xcalloc(ipcount, sizeof(struct IN_ADDR)); i->addrs.bad_mask = (unsigned char *)xcalloc(ipcount, sizeof(unsigned char)); for (j = 0, k = 0; k < ipcount; k++) { @@ -416,7 +416,7 @@ ipcacheParse(ipcache_entry *i, rfc1035_rr * answers, int nr, const char *error_m return 0; } - i->addrs.in_addrs = (struct in_addr *)xcalloc(na, sizeof(struct in_addr)); + i->addrs.in_addrs = (struct IN_ADDR *)xcalloc(na, sizeof(struct IN_ADDR)); i->addrs.bad_mask = (unsigned char *)xcalloc(na, sizeof(unsigned char)); for (j = 0, k = 0; k < nr; k++) { @@ -571,7 +571,7 @@ ipcache_init(void) memset(&static_addrs, '\0', sizeof(ipcache_addrs)); - static_addrs.in_addrs = (struct in_addr *)xcalloc(1, sizeof(struct in_addr)); + static_addrs.in_addrs = (struct IN_ADDR *)xcalloc(1, sizeof(struct IN_ADDR)); static_addrs.bad_mask = (unsigned char *)xcalloc(1, sizeof(unsigned char)); ipcache_high = (long) (((float) Config.ipcache.size * (float) Config.ipcache.high) / (float) 100); @@ -718,7 +718,7 @@ ipcache_addrs * ipcacheCheckNumeric(const char *name) { - struct in_addr ip; + struct IN_ADDR ip; /* check if it's already a IP address in text form. */ if (!safe_inet_addr(name, &ip)) @@ -804,7 +804,7 @@ ipcacheCycleAddr(const char *name, ipcache_addrs * ia) */ void -ipcacheMarkBadAddr(const char *name, struct in_addr addr) +ipcacheMarkBadAddr(const char *name, struct IN_ADDR addr) { ipcache_entry *i; ipcache_addrs *ia; @@ -837,7 +837,7 @@ ipcacheMarkBadAddr(const char *name, struct in_addr addr) void -ipcacheMarkGoodAddr(const char *name, struct in_addr addr) +ipcacheMarkGoodAddr(const char *name, struct IN_ADDR addr) { ipcache_entry *i; ipcache_addrs *ia; @@ -906,7 +906,7 @@ ipcacheAddEntryFromHosts(const char *name, const char *ipaddr) { ipcache_entry *i; - struct in_addr ip; + struct IN_ADDR ip; if (!safe_inet_addr(ipaddr, &ip)) { if (strchr(ipaddr, ':') && strspn(ipaddr, "0123456789abcdefABCDEF:") == strlen(ipaddr)) { @@ -936,7 +936,7 @@ ipcacheAddEntryFromHosts(const char *name, const char *ipaddr) i->addrs.cur = 0; i->addrs.badcount = 0; - i->addrs.in_addrs = (struct in_addr *)xcalloc(1, sizeof(struct in_addr)); + i->addrs.in_addrs = (struct IN_ADDR *)xcalloc(1, sizeof(struct IN_ADDR)); i->addrs.bad_mask = (unsigned char *)xcalloc(1, sizeof(unsigned char)); i->addrs.in_addrs[0].s_addr = ip.s_addr; i->addrs.bad_mask[0] = FALSE; diff --git a/src/main.cc b/src/main.cc index 56c303f63f..0a27228f06 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.407 2005/04/06 18:44:25 serassio Exp $ + * $Id: main.cc,v 1.408 2005/04/18 21:52:42 hno Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -931,15 +931,15 @@ main(int argc, char **argv) if (oldmask) umask(oldmask); - memset(&local_addr, '\0', sizeof(struct in_addr)); + memset(&local_addr, '\0', sizeof(struct IN_ADDR)); safe_inet_addr(localhost, &local_addr); - memset(&any_addr, '\0', sizeof(struct in_addr)); + memset(&any_addr, '\0', sizeof(struct IN_ADDR)); safe_inet_addr("0.0.0.0", &any_addr); - memset(&no_addr, '\0', sizeof(struct in_addr)); + memset(&no_addr, '\0', sizeof(struct IN_ADDR)); safe_inet_addr("255.255.255.255", &no_addr); diff --git a/src/neighbors.cc b/src/neighbors.cc index b0283a3d00..9dbaad15aa 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1,6 +1,6 @@ /* - * $Id: neighbors.cc,v 1.329 2005/03/10 20:22:46 serassio Exp $ + * $Id: neighbors.cc,v 1.330 2005/04/18 21:52:42 hno Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -96,7 +96,7 @@ whichPeer(const struct sockaddr_in * from) int j; u_short port = ntohs(from->sin_port); - struct in_addr ip = from->sin_addr; + struct IN_ADDR ip = from->sin_addr; peer *p = NULL; debug(15, 3) ("whichPeer: from %s port %d\n", inet_ntoa(ip), port); diff --git a/src/net_db.cc b/src/net_db.cc index c916224d1d..cfebca6745 100644 --- a/src/net_db.cc +++ b/src/net_db.cc @@ -1,6 +1,6 @@ /* - * $Id: net_db.cc,v 1.175 2005/01/05 21:59:34 serassio Exp $ + * $Id: net_db.cc,v 1.176 2005/04/18 21:52:42 hno Exp $ * * DEBUG: section 38 Network Measurement Database * AUTHOR: Duane Wessels @@ -79,10 +79,10 @@ netdbExchangeState; static hash_table *addr_table = NULL; static hash_table *host_table = NULL; -static struct in_addr networkFromInaddr(struct in_addr a); +static struct IN_ADDR networkFromInaddr(struct IN_ADDR a); static void netdbRelease(netdbEntry * n); -static void netdbHashInsert(netdbEntry * n, struct in_addr addr); +static void netdbHashInsert(netdbEntry * n, struct IN_ADDR addr); static void netdbHashDelete(const char *key); static void netdbHostInsert(netdbEntry * n, const char *hostname); static void netdbHostDelete(const net_db_name * x); @@ -108,7 +108,7 @@ static wordlist *peer_names = NULL; static void -netdbHashInsert(netdbEntry * n, struct in_addr addr) +netdbHashInsert(netdbEntry * n, struct IN_ADDR addr) { xstrncpy(n->network, inet_ntoa(networkFromInaddr(addr)), 16); n->hash.key = n->network; @@ -245,7 +245,7 @@ netdbPurgeLRU(void) static netdbEntry * -netdbLookupAddr(struct in_addr addr) +netdbLookupAddr(struct IN_ADDR addr) { netdbEntry *n; char *key = inet_ntoa(networkFromInaddr(addr)); @@ -255,7 +255,7 @@ netdbLookupAddr(struct in_addr addr) static netdbEntry * -netdbAdd(struct in_addr addr) +netdbAdd(struct IN_ADDR addr) { netdbEntry *n; @@ -275,7 +275,7 @@ static void netdbSendPing(const ipcache_addrs * ia, void *data) { - struct in_addr addr; + struct IN_ADDR addr; char *hostname = (char *)((generic_cbdata *) data)->data; netdbEntry *n; netdbEntry *na; @@ -341,12 +341,12 @@ netdbSendPing(const ipcache_addrs * ia, void *data) xfree(hostname); } -static struct in_addr +static struct IN_ADDR - networkFromInaddr(struct in_addr a) + networkFromInaddr(struct IN_ADDR a) { - struct in_addr b; + struct IN_ADDR b; b.s_addr = ntohl(a.s_addr); #if USE_CLASSFUL @@ -529,7 +529,7 @@ netdbReloadState(void) netdbEntry *n; netdbEntry N; - struct in_addr addr; + struct IN_ADDR addr; int count = 0; struct timeval start = current_time; @@ -674,7 +674,7 @@ netdbExchangeHandleReply(void *data, StoreIOBuffer recievedData) int rec_sz = 0; off_t o; - struct in_addr addr; + struct IN_ADDR addr; double rtt; double hops; char *p; @@ -974,7 +974,7 @@ netdbFreeMemory(void) int -netdbHops(struct in_addr addr) +netdbHops(struct IN_ADDR addr) { #if USE_ICMP netdbEntry *n = netdbLookupAddr(addr); @@ -1143,7 +1143,7 @@ netdbUpdatePeer(HttpRequest * r, peer * e, int irtt, int ihops) void -netdbExchangeUpdatePeer(struct in_addr addr, peer * e, double rtt, double hops) +netdbExchangeUpdatePeer(struct IN_ADDR addr, peer * e, double rtt, double hops) { #if USE_ICMP netdbEntry *n; @@ -1179,7 +1179,7 @@ netdbExchangeUpdatePeer(struct in_addr addr, peer * e, double rtt, double hops) void -netdbDeleteAddrNetwork(struct in_addr addr) +netdbDeleteAddrNetwork(struct IN_ADDR addr) { #if USE_ICMP netdbEntry *n = netdbLookupAddr(addr); @@ -1206,7 +1206,7 @@ netdbBinaryExchange(StoreEntry * s) int rec_sz; char *buf; - struct in_addr addr; + struct IN_ADDR addr; storeBuffer(s); HttpVersion version(1, 0); httpReplySetHeaders(reply, version, HTTP_OK, "OK", diff --git a/src/pinger.cc b/src/pinger.cc index efdb665e6e..3180942890 100644 --- a/src/pinger.cc +++ b/src/pinger.cc @@ -1,6 +1,6 @@ /* - * $Id: pinger.cc,v 1.53 2004/04/03 14:38:36 hno Exp $ + * $Id: pinger.cc,v 1.54 2005/04/18 21:52:42 hno Exp $ * * DEBUG: section 42 ICMP Pinger program * AUTHOR: Duane Wessels @@ -200,7 +200,7 @@ static const char *icmpPktStr[] = static int in_cksum(unsigned short *ptr, int size); static void pingerRecv(void); -static void pingerLog(struct icmphdr *, struct in_addr, int, int); +static void pingerLog(struct icmphdr *, struct IN_ADDR, int, int); static int ipHops(int ttl); static void pingerSendtoSquid(pingerReplyData * preply); static void pingerOpen(void); @@ -324,7 +324,7 @@ pingerClose(void) static void -pingerSendEcho(struct in_addr to, int opcode, char *payload, int len) +pingerSendEcho(struct IN_ADDR to, int opcode, char *payload, int len) { LOCAL_ARRAY(char, pkt, MAX_PKT_SZ); @@ -502,7 +502,7 @@ in_cksum(unsigned short *ptr, int size) static void -pingerLog(struct icmphdr *icmp, struct in_addr addr, int rtt, int hops) +pingerLog(struct icmphdr *icmp, struct IN_ADDR addr, int rtt, int hops) { debug(42, 2) ("pingerLog: %9d.%06d %-16s %d %-15.15s %dms %d hops\n", (int) current_time.tv_sec, diff --git a/src/protos.h b/src/protos.h index 6d8552834f..8d54ca82c4 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.504 2005/04/06 18:44:25 serassio Exp $ + * $Id: protos.h,v 1.505 2005/04/18 21:52:43 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -96,13 +96,13 @@ SQUIDCEXTERN cbdata_type cbdataInternalAddType(cbdata_type type, const char *lab SQUIDCEXTERN void clientdbInit(void); -SQUIDCEXTERN void clientdbUpdate(struct in_addr, log_type, protocol_t, size_t); +SQUIDCEXTERN void clientdbUpdate(struct IN_ADDR, log_type, protocol_t, size_t); -SQUIDCEXTERN int clientdbCutoffDenied(struct in_addr); +SQUIDCEXTERN int clientdbCutoffDenied(struct IN_ADDR); SQUIDCEXTERN void clientdbDump(StoreEntry *); SQUIDCEXTERN void clientdbFreeMemory(void); -SQUIDCEXTERN int clientdbEstablished(struct in_addr, int); +SQUIDCEXTERN int clientdbEstablished(struct IN_ADDR, int); SQUIDCEXTERN void clientOpenListenSockets(void); SQUIDCEXTERN void clientHttpConnectionsClose(void); SQUIDCEXTERN void clientReadBody(HttpRequest * req, char *buf, size_t size, CBCB * callback, void *data); @@ -130,9 +130,9 @@ SQUIDCEXTERN void commConnectStart(int fd, const char *, u_short, CNCB *, void * SQUIDCEXTERN int comm_connect_addr(int sock, const struct sockaddr_in *); SQUIDCEXTERN void comm_init(void); -SQUIDCEXTERN int comm_open(int, int, struct in_addr, u_short port, int, const char *note); +SQUIDCEXTERN int comm_open(int, int, struct IN_ADDR, u_short port, int, const char *note); -SQUIDCEXTERN int comm_openex(int, int, struct in_addr, u_short, int, unsigned char TOS, const char *); +SQUIDCEXTERN int comm_openex(int, int, struct IN_ADDR, u_short, int, unsigned char TOS, const char *); SQUIDCEXTERN u_short comm_local_port(int fd); SQUIDCEXTERN void commSetSelect(int, unsigned int, PF *, void *, time_t); @@ -229,7 +229,7 @@ SQUIDCEXTERN void idnsInit(void); SQUIDCEXTERN void idnsShutdown(void); SQUIDCEXTERN void idnsALookup(const char *, IDNSCB *, void *); -SQUIDCEXTERN void idnsPTRLookup(const struct in_addr, IDNSCB *, void *); +SQUIDCEXTERN void idnsPTRLookup(const struct IN_ADDR, IDNSCB *, void *); extern void eventAdd(const char *name, EVH * func, void *arg, double when, int, bool cbdata=true); SQUIDCEXTERN void eventAddIsh(const char *name, EVH * func, void *arg, double delta_ish, int); @@ -258,14 +258,14 @@ SQUIDCEXTERN void file_map_bit_reset(fileMap *, int); SQUIDCEXTERN void filemapFreeMemory(fileMap *); -SQUIDCEXTERN void fqdncache_nbgethostbyaddr(struct in_addr, FQDNH *, void *); +SQUIDCEXTERN void fqdncache_nbgethostbyaddr(struct IN_ADDR, FQDNH *, void *); -SQUIDCEXTERN const char *fqdncache_gethostbyaddr(struct in_addr, int flags); +SQUIDCEXTERN const char *fqdncache_gethostbyaddr(struct IN_ADDR, int flags); SQUIDCEXTERN void fqdncache_init(void); SQUIDCEXTERN void fqdnStats(StoreEntry *); SQUIDCEXTERN void fqdncacheReleaseInvalid(const char *); -SQUIDCEXTERN const char *fqdnFromAddr(struct in_addr); +SQUIDCEXTERN const char *fqdnFromAddr(struct IN_ADDR); SQUIDCEXTERN int fqdncacheQueueDrain(void); SQUIDCEXTERN void fqdncacheFreeMemory(void); SQUIDCEXTERN void fqdncache_restart(void); @@ -438,9 +438,9 @@ SQUIDCEXTERN int httpMsgIsolateHeaders(const char **parse_start, const char **bl SQUIDCEXTERN void icmpOpen(void); SQUIDCEXTERN void icmpClose(void); -SQUIDCEXTERN void icmpSourcePing(struct in_addr to, const icp_common_t *, const char *url); +SQUIDCEXTERN void icmpSourcePing(struct IN_ADDR to, const icp_common_t *, const char *url); -SQUIDCEXTERN void icmpDomainPing(struct in_addr to, const char *domain); +SQUIDCEXTERN void icmpDomainPing(struct IN_ADDR to, const char *domain); #ifdef SQUID_SNMP SQUIDCEXTERN PF snmpHandleUdp; @@ -450,11 +450,11 @@ SQUIDCEXTERN void snmpConnectionShutdown(void); SQUIDCEXTERN void snmpConnectionClose(void); SQUIDCEXTERN void snmpDebugOid(int lvl, oid * Name, snint Len); -SQUIDCEXTERN void addr2oid(struct in_addr addr, oid * Dest); +SQUIDCEXTERN void addr2oid(struct IN_ADDR addr, oid * Dest); -SQUIDCEXTERN struct in_addr *oid2addr(oid * id); +SQUIDCEXTERN struct IN_ADDR *oid2addr(oid * id); -SQUIDCEXTERN struct in_addr *client_entry(struct in_addr *current); +SQUIDCEXTERN struct IN_ADDR *client_entry(struct IN_ADDR *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 *); @@ -490,9 +490,9 @@ SQUIDCEXTERN void ipcache_init(void); SQUIDCEXTERN void stat_ipcache_get(StoreEntry *); SQUIDCEXTERN void ipcacheCycleAddr(const char *name, ipcache_addrs *); -SQUIDCEXTERN void ipcacheMarkBadAddr(const char *name, struct in_addr); +SQUIDCEXTERN void ipcacheMarkBadAddr(const char *name, struct IN_ADDR); -SQUIDCEXTERN void ipcacheMarkGoodAddr(const char *name, struct in_addr); +SQUIDCEXTERN void ipcacheMarkGoodAddr(const char *name, struct IN_ADDR); SQUIDCEXTERN void ipcacheFreeMemory(void); SQUIDCEXTERN ipcache_addrs *ipcacheCheckNumeric(const char *name); SQUIDCEXTERN void ipcache_restart(void); @@ -564,17 +564,17 @@ SQUIDCEXTERN void netdbHandlePingReply(const struct sockaddr_in *from, int hops, SQUIDCEXTERN void netdbPingSite(const char *hostname); SQUIDCEXTERN void netdbDump(StoreEntry *); -SQUIDCEXTERN int netdbHops(struct in_addr); +SQUIDCEXTERN int netdbHops(struct IN_ADDR); SQUIDCEXTERN void netdbFreeMemory(void); SQUIDCEXTERN int netdbHostHops(const char *host); SQUIDCEXTERN int netdbHostRtt(const char *host); SQUIDCEXTERN void netdbUpdatePeer(HttpRequest *, peer * e, int rtt, int hops); -SQUIDCEXTERN void netdbDeleteAddrNetwork(struct in_addr addr); +SQUIDCEXTERN void netdbDeleteAddrNetwork(struct IN_ADDR addr); SQUIDCEXTERN void netdbBinaryExchange(StoreEntry *); SQUIDCEXTERN EVH netdbExchangeStart; -SQUIDCEXTERN void netdbExchangeUpdatePeer(struct in_addr, peer *, double, double); +SQUIDCEXTERN void netdbExchangeUpdatePeer(struct IN_ADDR, peer *, double, double); SQUIDCEXTERN peer *netdbClosestParent(HttpRequest *); SQUIDCEXTERN void netdbHostData(const char *host, int *samp, int *rtt, int *hops); @@ -605,7 +605,7 @@ SQUIDCEXTERN void fwdLogRotate(void); SQUIDCEXTERN void fwdStatus(FwdState *, http_status); #endif -SQUIDCEXTERN struct in_addr getOutgoingAddr(HttpRequest * request); +SQUIDCEXTERN struct IN_ADDR getOutgoingAddr(HttpRequest * request); unsigned long getOutgoingTOS(HttpRequest * request); SQUIDCEXTERN void urnStart(HttpRequest *, StoreEntry *); @@ -794,7 +794,7 @@ SQUIDCEXTERN double dpercent(double, double); SQUIDCEXTERN void squid_signal(int sig, SIGHDLR *, int flags); SQUIDCEXTERN pid_t readPidFile(void); -SQUIDCEXTERN struct in_addr inaddrFromHostent(const struct hostent *hp); +SQUIDCEXTERN struct IN_ADDR inaddrFromHostent(const struct hostent *hp); SQUIDCEXTERN int intAverage(int, int, int, int); SQUIDCEXTERN double doubleAverage(double, double, int, int); SQUIDCEXTERN void debug_trap(const char *); diff --git a/src/redirect.cc b/src/redirect.cc index b16e75bddf..e5c431ab96 100644 --- a/src/redirect.cc +++ b/src/redirect.cc @@ -1,6 +1,6 @@ /* - * $Id: redirect.cc,v 1.109 2004/12/20 16:30:36 robertc Exp $ + * $Id: redirect.cc,v 1.110 2005/04/18 21:52:43 hno Exp $ * * DEBUG: section 61 Redirector * AUTHOR: Duane Wessels @@ -46,7 +46,7 @@ typedef struct void *data; char *orig_url; - struct in_addr client_addr; + struct IN_ADDR client_addr; const char *client_ident; const char *method_s; RH *handler; diff --git a/src/snmp_agent.cc b/src/snmp_agent.cc index 16ba1e31fc..96b66be708 100644 --- a/src/snmp_agent.cc +++ b/src/snmp_agent.cc @@ -1,6 +1,6 @@ /* - * $Id: snmp_agent.cc,v 1.90 2005/01/03 16:08:26 robertc Exp $ + * $Id: snmp_agent.cc,v 1.91 2005/04/18 21:52:43 hno Exp $ * * DEBUG: section 49 SNMP Interface * AUTHOR: Kostas Anagnostakis @@ -175,7 +175,7 @@ snmp_meshPtblFn(variable_list * Var, snint * ErrP) { variable_list *Answer = NULL; - struct in_addr *laddr; + struct IN_ADDR *laddr; char *cp = NULL; peer *p = NULL; int cnt = 0; diff --git a/src/snmp_core.cc b/src/snmp_core.cc index b50f5d3a88..7944c9f6c0 100644 --- a/src/snmp_core.cc +++ b/src/snmp_core.cc @@ -1,6 +1,6 @@ /* - * $Id: snmp_core.cc,v 1.65 2003/09/21 00:30:47 robertc Exp $ + * $Id: snmp_core.cc,v 1.66 2005/04/18 21:52:43 hno Exp $ * * DEBUG: section 49 SNMP support * AUTHOR: Glenn Chisholm @@ -406,7 +406,7 @@ snmpConnectionOpen(void) theOutSnmpConnection = theInSnmpConnection; } - memset(&theOutSNMPAddr, '\0', sizeof(struct in_addr)); + memset(&theOutSNMPAddr, '\0', sizeof(struct IN_ADDR)); len = sizeof(struct sockaddr_in); memset(&xaddr, '\0', len); @@ -854,7 +854,7 @@ peer_Inst(oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn) u_char *cp = NULL; peer *peers = Config.peers; - struct in_addr *laddr = NULL; + struct IN_ADDR *laddr = NULL; char *host_addr = NULL, *current_addr = NULL, *last_addr = NULL; if (peers == NULL) { @@ -919,7 +919,7 @@ client_Inst(oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn oid *instance = NULL; u_char *cp = NULL; - struct in_addr *laddr = NULL; + struct IN_ADDR *laddr = NULL; if (*len <= current->len) { instance = (oid *)xmalloc(sizeof(name) * (*len + 4)); @@ -1142,7 +1142,7 @@ snmpSnmplibDebug(int lvl, char *buf) void -addr2oid(struct in_addr addr, oid * Dest) +addr2oid(struct IN_ADDR addr, oid * Dest) { u_char *cp; cp = (u_char *) & (addr.s_addr); @@ -1152,12 +1152,12 @@ addr2oid(struct in_addr addr, oid * Dest) Dest[3] = *cp++; } -struct in_addr +struct IN_ADDR * oid2addr(oid * id) { - static struct in_addr laddr; + static struct IN_ADDR laddr; u_char *cp = (u_char *) & (laddr.s_addr); cp[0] = id[0]; cp[1] = id[1]; diff --git a/src/structs.h b/src/structs.h index 86b21132e1..be50d8cf24 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.515 2005/04/03 18:53:24 serassio Exp $ + * $Id: structs.h,v 1.516 2005/04/18 21:52:43 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -118,7 +118,7 @@ struct _acl_address acl_address *next; acl_list *aclList; - struct in_addr addr; + struct IN_ADDR addr; }; struct _acl_tos @@ -341,11 +341,11 @@ struct _SquidConfig struct { - struct in_addr router; + struct IN_ADDR router; - struct in_addr incoming; + struct IN_ADDR incoming; - struct in_addr outgoing; + struct IN_ADDR outgoing; int version; } @@ -453,17 +453,17 @@ struct _SquidConfig struct { - struct in_addr udp_incoming; + struct IN_ADDR udp_incoming; - struct in_addr udp_outgoing; + struct IN_ADDR udp_outgoing; #if SQUID_SNMP - struct in_addr snmp_incoming; + struct IN_ADDR snmp_incoming; - struct in_addr snmp_outgoing; + struct IN_ADDR snmp_outgoing; #endif - struct in_addr client_netmask; + struct IN_ADDR client_netmask; } Addrs; @@ -682,7 +682,7 @@ struct _SquidConfig struct { - struct in_addr addr; + struct IN_ADDR addr; int ttl; unsigned short port; char *encode_key; @@ -984,7 +984,7 @@ unsigned int request_sent: struct _ipcache_addrs { - struct in_addr *in_addrs; + struct IN_ADDR *in_addrs; unsigned char *bad_mask; unsigned char count; unsigned char cur; @@ -1272,7 +1272,7 @@ unsigned int counting: int tcp_up; /* 0 if a connect() fails */ - struct in_addr addresses[10]; + struct IN_ADDR addresses[10]; int n_addresses; int rr_count; int rr_lastcount; @@ -1352,7 +1352,7 @@ struct _netdbEntry struct _pingerEchoData { - struct in_addr to; + struct IN_ADDR to; unsigned char opcode; int psize; char payload[PINGER_PAYLOAD_SZ]; @@ -1361,7 +1361,7 @@ struct _pingerEchoData struct _pingerReplyData { - struct in_addr from; + struct IN_ADDR from; unsigned char opcode; int rtt; int hops; @@ -1595,7 +1595,7 @@ struct _ErrorState char *dnsserver_msg; time_t ttl; - struct in_addr src_addr; + struct IN_ADDR src_addr; char *redirect_url; ERCB *callback; void *callback_data; @@ -1841,7 +1841,7 @@ struct _ClientInfo { hash_link hash; /* must be first */ - struct in_addr addr; + struct IN_ADDR addr; struct { diff --git a/src/tools.cc b/src/tools.cc index 3c550c3c4a..cbab3aabbc 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1,6 +1,6 @@ /* - * $Id: tools.cc,v 1.253 2005/03/18 15:47:42 hno Exp $ + * $Id: tools.cc,v 1.254 2005/04/18 21:52:43 hno Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -556,7 +556,7 @@ getMyHostname(void) const struct hostent *h = NULL; - struct in_addr sa; + struct IN_ADDR sa; if (Config.visibleHostname != NULL) return Config.visibleHostname; @@ -929,12 +929,12 @@ squid_signal(int sig, SIGHDLR * func, int flags) #endif } -struct in_addr +struct IN_ADDR inaddrFromHostent(const struct hostent *hp) { - struct in_addr s; + struct IN_ADDR s; xmemcpy(&s.s_addr, hp->h_addr, sizeof(s.s_addr)); return s; } diff --git a/src/wccp.cc b/src/wccp.cc index 4bf564a810..1f69e6fa36 100644 --- a/src/wccp.cc +++ b/src/wccp.cc @@ -1,6 +1,6 @@ /* - * $Id: wccp.cc,v 1.38 2005/02/05 21:50:42 serassio Exp $ + * $Id: wccp.cc,v 1.39 2005/04/18 21:52:43 hno Exp $ * * DEBUG: section 80 WCCP Support * AUTHOR: Glenn Chisholm @@ -61,7 +61,7 @@ struct wccp_here_i_am_t struct wccp_cache_entry_t { - struct in_addr ip_addr; + struct IN_ADDR ip_addr; int revision; char hash[WCCP_HASH_SIZE]; int reserved; @@ -96,7 +96,7 @@ static int last_id; static int last_assign_buckets_change; static unsigned int number_caches; -static struct in_addr local_ip; +static struct IN_ADDR local_ip; static PF wccpHandleUdp; static int wccpLowestIP(void);