/*
- * $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
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:
/*
- * $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
struct wccp2_router_id_element_t router_id_element;
- struct IN_ADDR router_address;
+ struct in_addr router_address;
uint32_t number_caches;
};
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;
/* 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));
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;
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;
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;
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);
}
}