Re: Ordering IP addresses [Non trivial]

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Thu, 26 May 2005 00:28:32 +0200 (CEST)

On Wed, 25 May 2005, Rafael Martinez Torres wrote:

> NOTES:
> ------
>
> - Solved the masking on IPv6, I cannot compare 128 bits integers, unless
> I define it. (squid128_int_t)
>
> - I can redefine the address ordering to byte-to-byte comparing (memcmp)
> on the two memory areas &A &B , but on IPv4 and i386 boxes§ they would
> invert the actual order, since network order inverts the bytes on host order (ntohl) , so...
>
> - The rest of calling software will not be ready to support this new
> ordering (-1,0,1) --> (1,0,-1) Would be very difficult to change it into
> this new order ?

Either should be fine, as long as you are consistent, but if this is the
only problem then all you need is to return the negated result.

Thinking.. memcmp() will actually compare correctly. memcmp() is the same
as comparing ntohl values as integers thanks to network byte order being
most significant octet first. So the second point above (and my separate
comment) is a non-issue.

> - If not answer available in a short time, given the close date to
> benchmarking IPv6, were can I order Squid to bypass all the ACLIP
> constraints on squid.conf ?

It's all there in ACLIP.cc.

acl_ip_data::NetworkCompare()

but I fail to see why this would be an issue.

Regards
Henrik
Received on Wed May 25 2005 - 16:28:35 MDT

This archive was generated by hypermail pre-2.1.9 : Tue May 31 2005 - 12:00:03 MDT