From: amosjeffries <> Date: Wed, 6 Feb 2008 05:39:42 +0000 (+0000) Subject: Remove last remains of IN_ADDR ANY_ADDR and NO_ADDR from Squid X-Git-Tag: BASIC_TPROXY4~144 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2adffc6f757f642a0bab93348c120e4ce0e2c5e7;p=thirdparty%2Fsquid.git Remove last remains of IN_ADDR ANY_ADDR and NO_ADDR from Squid - Uses of struct in_addr do remain at places where IPv4 is forced. - This just removes the glue macros no longer needed. --- diff --git a/include/IPAddress.h b/include/IPAddress.h index 0f0ccb04cf..713281c643 100644 --- a/include/IPAddress.h +++ b/include/IPAddress.h @@ -1,5 +1,5 @@ /* - * $Id: IPAddress.h,v 1.2 2008/01/20 20:35:41 serassio Exp $ + * $Id: IPAddress.h,v 1.3 2008/02/05 22:39:42 amosjeffries Exp $ * * DEBUG: section 14 IP Storage and Handling * AUTHOR: Amos Jeffries @@ -410,14 +410,7 @@ operator << (std::ostream &os, const IPAddress &ipa) return os; } - -// Macros for Old IPv4-Only code that still needs to use IN_ADDR -#define ANY_ADDR (struct in_addr)0x00000000 -#define NO_ADDR (struct_in_addr)0xFFFFFFFF -#define IN_ADDR in_addr - // WAS _sockaddr_in_list in an earlier incarnation -/* INET6 : this could possibly be an addrinfo structure now IFF it needs to be in a generic raw form. */ class IPAddress_list { public: diff --git a/src/wccp2.cc b/src/wccp2.cc index 3eb84bee3a..491ac92e53 100644 --- a/src/wccp2.cc +++ b/src/wccp2.cc @@ -1,6 +1,6 @@ /* - * $Id: wccp2.cc,v 1.21 2007/12/26 21:58:02 hno Exp $ + * $Id: wccp2.cc,v 1.22 2008/02/05 22:39:42 amosjeffries Exp $ * * DEBUG: section 80 WCCP Support * AUTHOR: Steven Wilton @@ -362,7 +362,7 @@ struct router_identity_info_t struct wccp2_router_id_element_t router_id_element; - struct IN_ADDR router_address; + struct in_addr router_address; uint32_t number_caches; }; @@ -1155,7 +1155,7 @@ wccp2HandleUdp(int sock, void *not_used) struct sockaddr_in from; - struct IN_ADDR cache_address; + struct in_addr cache_address; int len, found; short int data_length, offset; uint32_t tmp; @@ -1407,7 +1407,7 @@ wccp2HandleUdp(int sock, void *not_used) /* skip the number plus all the ip's */ - ptr += sizeof(tmp) + (ntohl(tmp) * sizeof(struct IN_ADDR)); + ptr += sizeof(tmp) + (ntohl(tmp) * sizeof(struct in_addr)); /* Then read the number of caches */ memcpy(&tmp, ptr, sizeof(tmp)); @@ -1427,7 +1427,7 @@ wccp2HandleUdp(int sock, void *not_used) ptr += sizeof(struct wccp2_cache_identity_info_t); - memcpy(&cache_address, &cache_identity->addr, sizeof(struct IN_ADDR)); + memcpy(&cache_address, &cache_identity->addr, sizeof(struct in_addr)); cache_list_ptr->weight = ntohs(cache_identity->weight); break; @@ -1444,12 +1444,12 @@ wccp2HandleUdp(int sock, void *not_used) ptr += sizeof(struct wccp2_cache_mask_identity_info_t); - memcpy(&cache_address, &cache_mask_identity->addr, sizeof(struct IN_ADDR)); + memcpy(&cache_address, &cache_mask_identity->addr, sizeof(struct in_addr)); } else { ptr += sizeof(struct cache_mask_info_t); - memcpy(&cache_address, &cache_mask_info->addr, sizeof(struct IN_ADDR)); + memcpy(&cache_address, &cache_mask_info->addr, sizeof(struct in_addr)); } cache_list_ptr->weight = 0; @@ -1633,7 +1633,7 @@ wccp2AssignBuckets(void *voidnotused) struct wccp2_router_assign_element_t *router_assign; /* number of caches */ - struct IN_ADDR *cache_address; + struct in_addr *cache_address; /* Alternative assignement mask/values */ int num_maskval; @@ -1785,13 +1785,13 @@ wccp2AssignBuckets(void *voidnotused) for (cache = 0, cache_list_ptr = &router_list_ptr->cache_list_head; cache_list_ptr->next; cache_list_ptr = cache_list_ptr->next, cache++) { /* add caches */ - cache_address = (struct IN_ADDR *) &wccp_packet[offset]; + cache_address = (struct in_addr *) &wccp_packet[offset]; - xmemcpy(cache_address, &cache_list_ptr->cache_ip, sizeof(struct IN_ADDR)); + xmemcpy(cache_address, &cache_list_ptr->cache_ip, sizeof(struct in_addr)); total_weight += cache_list_ptr->weight << 12; weight[cache] = cache_list_ptr->weight << 12; - offset += sizeof(struct IN_ADDR); + offset += sizeof(struct in_addr); } }