Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Boolean logic with IP addresses

by azatoth (Curate)
on May 17, 2001 at 17:43 UTC ( [id://81229]=note: print w/replies, xml ) Need Help??


in reply to Boolean logic with IP addresses

The method to use is thus :

IP a.b.c.d => convert to 32-bit int => d + (c * 256) + (b * 256 * 256) + (a * 256 * 256 *256) ----------------------- = 32-bit representation of IP Address.


This shouldn't be too hard to do in Perl, give me a bit of time to work it out :)

UPDATE: Nevermind, alfie's done it above.

Azatoth a.k.a Captain Whiplash

Make Your Die Messages Full of Wisdom!
Get YOUR PerlMonks Stagename here!
Want to speak like a Londoner?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://81229]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 09:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found