Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

linux-ipsec: another revolting hack

From: Henry Spencer <henry(at)spsystems.net>
Date: Tue Oct 13 1998 - 18:59:03 EDT


Having noted that things like /proc/net/route display addresses etc. in host-order hex (gag, choke, retch), I added a format to atoaddr() and friends: a hex address with a 0h prefix rather than a 0x prefix is taken to be in host order.

(The logic of which is host and which is network order gets a bit twisty
here, but I believe I ended up with the right answer: 0x01020304 is always 1.2.3.4, while 0h01020304 is 1.2.3.4 or 4.3.2.1 depending on the host's biases.)

(For those who have forgotten the manual page, atoaddr() accepts hex not
because it is a desirable format, but because it avoids hand conversions when dealing with perverse programs which show addresses in hex.)

                                                          Henry Spencer
                                                       henry@spsystems.net
                                                     (henry@zoo.toronto.edu)
Received on Tue Oct 13 20:10:55 1998

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 12:59:03 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library