printing src and dst addresses as integers

Carter Bullard carter at qosient.com
Fri Feb 17 00:12:14 EST 2012


Gentle people,
In support of some database guys call to action, I've added format specification
for printable fields.  This will allow you to print things like IP addresses as
dot-notational strings (the default), or numbers in various formats like hex,
signed and unsigned integers.

It seems that doing arithmetic with IP addresses is a bit weird in some databases
if they are inserted as strings, so these formats should be useful.  There is still
a lot of work, as I have only implemented this for IP addresses right now.

Signed and unsigned support for printing IPv6 addresses as integers was a trick,
but its there.  As well as hex and dot-notation strings.  

Interesting, its not until you print these huge numbers do you realize simple
things like ' it takes more chars to print a signed number than it does the
same number as unsigned '.   I'm sure this is obvious to most, but its interesting
to me.  

So here is a link local IPv6 address, (the most common found in LANs) as IPv6, hex, signed and unsigned:

  fe80::a667:6ff:fe4d:16b5
  0xfe80000000000000a66706fffe4d16b5
 -168147341466791857934322153354913715893
  338288524927261089666009457070797821621

You generate these using the new print field format support:

   -s saddr:42
   -s saddr:42:0x%x
   -s saddr:42:%d
   -s saddr:42:%u

This is still early, so any opinions, suggestions, reactions etc is most welcome.
This support is in the new argus-clients-3.0.5.32, which I'm uploading now.

Thanks for all the support !!!!
   
Carter

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist1.pair.net/pipermail/argus/attachments/20120217/2918d9fd/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4367 bytes
Desc: not available
URL: <https://pairlist1.pair.net/pipermail/argus/attachments/20120217/2918d9fd/attachment.bin>


More information about the argus mailing list