[Snort-users] Database Question

Kreimendahl, Chad J Chad.Kreimendahl at ...4716...
Wed Mar 13 13:49:04 EST 2002

A simple few line piece of perl code that will do this easily... $ip =
decimal form of ip... $output = dotted form.

                for (my $i=3;$i>=0;$i--){
                        my $t1 = sprintf ("%d",($ip / (256 ** $i)));
                        $output .= $t1.".";
                        $ip = $ip - ($t1 * (256 ** $i))

-----Original Message-----
From: Dean Scott [mailto:ScottD at ...801...]
Sent: Wednesday, March 13, 2002 2:34 PM
To: snort-users at lists.sourceforge.net
Subject: [Snort-users] Database Question

I am sending Snort logs to a Postgresql database.  The output for the data
section is in hex but the source and destination ip's are always 10 digit
numbers.  How do I convert these to dotted decimal ip addresses?  Is there a
way for Snort to do this for me?


Snort-users mailing list
Snort-users at lists.sourceforge.net
Go to this URL to change user options or unsubscribe:
Snort-users list archive:

More information about the Snort-users mailing list