[Snort-users] ip address format of iphdr in mysql

Luo, Feng (Exchange) fengluo at ...5088...
Fri Mar 22 13:01:11 EST 2002


I will say the simplest way to convert is using calculator,
1, convert the DEC to BIN.
2. divide BIN to 4 octet.
3. convert each octet back to DEC
4. you will get 4-byte ip address.

But thank your guys anyway.

-----Original Message-----
From: Andrew Hutchinson [mailto:andrew.hutchinson at ...758...]
Sent: Friday, March 22, 2002 1:28 PM
To: Luo, Feng (Exchange); snort-users at lists.sourceforge.net
Subject: Re: [Snort-users] ip address format of iphdr in mysql


You can use the built in mysql function 'inet_ntoa' to convert:

select inet_ntoa(iphdr.ip_src), inet_ntoa(iphdr.ip_dst) from iphdr;

You can also use 'inet_aton' to convert the other way.

Hope that helps.

Andrew


On Friday 22 March 2002 10:51 am, Luo, Feng (Exchange) wrote:
> I am searching the ip address from mysql.
> **********************************************************************
> mysql> select * from iphdr;
>
+-----+-----+------------+------------+--------+---------+--------+--------
>+ ----
> ---+----------+--------+--------+----------+---------+
>
> | sid | cid | ip_src     | ip_dst     | ip_ver | ip_hlen | ip_tos | ip_len
> | |
>
> ip_
> id | ip_flags | ip_off | ip_ttl | ip_proto | ip_csum |
>
+-----+-----+------------+------------+--------+---------+--------+--------
>+ ----
> ---+----------+--------+--------+----------+---------+
>
> |   1 | 417 | 2473322920 | 2473281217 |      4 |       5 |      0 |  33361
> | |
>
> 247
> 46 |        0 |      0 |     28 |        1 |   25793 |
>
> |   1 | 416 | 2473322920 | 2473281217 |      4 |       5 |      0 |  33361
> | |
>
> 244
> 90 |        0 |      0 |     28 |        1 |   26049 |
>
> |   1 | 419 | 2473322920 | 2473281217 |      4 |       5 |      0 |  33361
> | |
>
> 255
> 14 |        0 |      0 |     28 |        1 |   25025 |
>
> |   1 | 418 | 2473322920 | 2473281217 |      4 |       5 |      0 |  33361
> | |
>
> 250
> 02 |        0 |      0 |     28 |        1 |   25537 |
>
+-----+-----+------------+------------+--------+---------+--------+--------
>+ ----
> ---+----------+--------+--------+----------+---------+
> 4 rows in set (0.01 sec)
> **********************************************************************
>
> How can I translate 10 integer 2473322920 and 2473281217 to the regular ip
> address?
>
> Feng
>
>
>
> ****************************************************************
> Bear Stearns is not responsible for any recommendation, solicitation,
> offer or agreement or any information about any transaction, customer
> account or account activity contained in this communication.
> ***********************************************************************
>
>
> _______________________________________________
> Snort-users mailing list
> Snort-users at lists.sourceforge.net
> Go to this URL to change user options or unsubscribe:
> https://lists.sourceforge.net/lists/listinfo/snort-users
> Snort-users list archive:
> http://www.geocrawler.com/redir-sf.php3?list=snort-users

-- 
Andrew Hutchinson CNE MCSE
Vanderbilt University Medical Center
Informatics/NCS/Network Security
Voice: (615) 936-2856
andrew.hutchinson at ...758...
There is more to life than increasing its speed.


***********************************************************************
Bear Stearns is not responsible for any recommendation, solicitation, 
offer or agreement or any information about any transaction, customer 
account or account activity contained in this communication.
***********************************************************************





More information about the Snort-users mailing list