Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

IPv6 to IPv4 conversion

1 view
Skip to first unread message

dk

unread,
Oct 20, 2001, 11:46:29 AM10/20/01
to
I was previously informed that the IP logging (in MS-Access thru ODBC)
stores IPs in the v6 format. I don't know how to match those up to the IPs
I'm used to seeing (v4). Is there a way for me to (in order of preference)

a) have them stored in v4 format
b) convert them with a mathematical formula
c) convert them as required with a piece of software
d) convert them as required on a website

thanks

david


Jarle Aase

unread,
Oct 20, 2001, 2:05:32 PM10/20/01
to
nos...@spam.com (dk) wrote in
<MXgA7.16049$W61.2...@news20.bellglobal.com>:

>I was previously informed that the IP logging (in MS-Access thru ODBC)
>stores IPs in the v6 format.

The IP number in the .dbo.FromDomain row is an ipv4 address stored as a 32
bit integer (same as "struct in_addr.s_addr" in C).

Jarle
--
Jarle Aase http://www.jgaa.com
mailto:jg...@jgaa.com http://www.fuck-the-law.org

<<< no need to argue - just kill'em all! >>>

dk

unread,
Oct 21, 2001, 12:57:48 AM10/21/01
to
How do I convert it from 32 bit integer? (I'm not a programmer)
thanks
"Jarle Aase" <jg...@jgaa.com> wrote in message
news:9140C9...@195.0.200.200...

Jarle Aase

unread,
Oct 21, 2001, 1:30:15 AM10/21/01
to
nos...@spam.com (dk) wrote in
<gBsA7.302082$j65.79...@news4.rdc1.on.home.com>:

>How do I convert it from 32 bit integer? (I'm not a programmer)

Well, the 32 bit integer contains 4 8 bit numbers, each corresponding to
one of the four number in a ipv4 address.

32 bit representation of 127.0.0.1: 16777343
If you view this as a hexadecimal number, 0100007F, you'll see that each of
the four numbers correspond to two hex dights, and that the order is
reversed (7f hex is 127 dec).

How you convert this number into a IP address will depend on the tool you
use :) If you can use "shift right" and "and", it's simple:

b1 = 16777343 & 255 = 127
b2 = (16777343 >> 8) & 255 = 0
b3 = (16777343 >> 16) & 255 = 0
b4 = (16777343 >> 24) & 255 = 1

DevilsPGD

unread,
Oct 21, 2001, 8:31:51 PM10/21/01
to
In message <<91414E...@195.0.200.200>> jg...@jgaa.com (Jarle Aase)
did so spew forth:

>>How do I convert it from 32 bit integer? (I'm not a programmer)
>
>Well, the 32 bit integer contains 4 8 bit numbers, each corresponding to
>one of the four number in a ipv4 address.

If you want a quick and dirty end user solution, ping the 32bit integer
from the command prompt, and it will reply back with the correct IP and
proceed to ping.


--
The nice thing about standards, there is enough for everyone to have their own.

0 new messages