Beefy Boxes and Bandwidth Generously Provided by pair Networks chromatic writing perl on a camel
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Challenge Problem: Merging Network Addresses

by fjonckers (Novice)
on Oct 11, 2001 at 21:39 UTC ( [id://118355]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Challenge Problem: Merging Network Addresses

maybe you could translate the addresses first to their binary value.. you can then do calculations with them (bitwise) finally translate back to IP's just a thought.. Filip
  • Comment on Re: Challenge Problem: Merging Network Addresses

Replies are listed 'Best First'.
Re: Re: Challenge Problem: Merging Network Addresses
by hatter (Pilgrim) on Oct 12, 2001 at 08:41 UTC
    I'd thought about doing it similarly, but in a bit more detail:

    o Convert the addresses to binary strings, and remove the bits that represent the network (so a /32 becomes a 32 char long string, a /24 24 bits)
    o For each line, see if there is a matching line, except with opposite LSB - if there is, delete them and replace it with a string one digit shorter.
    o Repeat until you run out of matches.

    the hatter

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://118355]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.