[Snort-devel] snort alerts in mysql

Jeff Nathan jeff at ...835...
Wed Aug 14 09:40:02 EDT 2002


--On Monday, August 12, 2002 13:57:52 -0400 Roman Danyliw 
<roman at ...49...> wrote:

[...]

> i dont know what is the mapping function to convert this interger value to
> actual ip addresses,if some one know abt this please tell me

I don't really write anything in PHP, but to manually convert an unsigned 
integer value foo into an IP address you would use a bit shift and a mask 
in the form:

foo & 0xff, (foo >> 8) & 0xff, (foo >> 16) & 0xff, (foo >> 24) & 0xff

Of course this is in C but perhaps it's roughly appropriate for PHP.

-Jeff

--
http://www.snort.org/~jeff       (pgp key available)
"Great spirits have always encountered violent opposition from mediocre
minds."
- Albert Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
URL: <https://lists.snort.org/pipermail/snort-devel/attachments/20020814/595e5c35/attachment.sig>


More information about the Snort-devel mailing list