Re: perl and network addresses
Ben Scott [EMAIL PROTECTED] writes: The 10.0.32/19 is an interesting beast. The systems which live on it have 2 NICs, the primary eth0, which *always* have a 10.0.32/19 based address (currently restricted to 10.0.33/24 for some reason?!), As far as that restriction goes, I've read of crufty old code which assume everything follows the old classful model, with strict boundaries even for subnets. It might be that. To be honest, I think it's more that we just don't have more 255 hosts on that network... yet. We're about to get 50 more systems in which will bring us up to 251. After that, things may well get interesting :) As for the rest... wow... funky. I do hope all that multi-homing to the same network is for test/simulation procedures. :) Pretty much. It's to simulate how our product actually works. Though, our product uses this type of setup in a very restricted and controlled manner on a backend, completely separate and private network. In theory, one installation of our product could approach 255+ hosts in a single installation, in practice, the number of hosts in a single install is rarely more than 10. Okay, in return for taking the time and effort to explain all that, I took the time to figure out how to get Perl to convert IP addresses. Hopefully the following sample code will help you out: [ code elided ] Is that even close to what you were thinking of? Yes, more or less. Between you and Jason I've been able to come up with exactly what I need. Thanks a lot for all your help. Why I couldn't see this for myself is beyond me. Of course, this week has been full of me missing the details to the point where I somehow managed to mail my taxes to myself from work the other day rather than to my accountant :) So, just in case you wondered, the USPS system is working at peak efficiency ! -- Seeya, Paul ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
Reminder: LinuxWorld next week
A reminder to all that LinuxWorld will be held next week in Boston. There are great chances for all to meet, greet, network, schmooze, get a job, hire a guru, grab free schwag, learn, laugh, study, accomplish, etc NOTE: The conference is NOT at the Hynes. It's at the Boston Convention and Exhibition Center, Summer Street, out on the wharves by the World Trade Center. MBTA Silver Line express busses from South Station will take you right there. Directions and details on the http://linuxworldexpo.com site. Free Birds-of-a-Feather gatherings feature industry luminaries. No charge, though you'd likely want an Expo pass, Schedule here: http://www.linuxworldexpo.com/live/12/events/12BOS06A/conference/special The Linux Professional Institute will be offering their LPI 101 exams FREE to PAID attendees and half-price ($50) for Expo attendess. Keynotes are also free: http://www.linuxworldexpo.com/live/12/events/12BOS06A/keynotes GNHLUG will also be hosting a booth. Volunteers are welcomed. Please sign up at: http://wiki.gnhlug.org/twiki2/bin/view/Organizational/ LWExpo2006BoothSignUpSheet Get your Expo pass in advance, as they'll charge $50 to register at the door. Hope you enjoy! Ted Roche Ted Roche Associates, LLC http://www.tedroche.com ___ gnhlug-announce mailing list gnhlug-announce@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-announce ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
Re: perl and network addresses
Paul Lussier wrote: Yes, more or less. Between you and Jason I've been able to come up with exactly what I need. Thanks a lot for all your help. Why I couldn't see this for myself is beyond me. Of course, this week has been full of me missing the details to the point where I somehow managed to mail my taxes to myself from work the other day rather than to my accountant :) So, just in case you wondered, the USPS system is working at peak efficiency ! You're very welcome to the help, and we all have those weeks. It took me a while to realize what your real question was. Once I figured out your question, it was actually rather interesting: adding network addresses to interpolate between different networks. Trying to answer it allowed me to discover some facts about IPv4 addresses and masks, so I got to learn something, too. The thing that I found most interesting is if you use the one or two digit kind of mask, i.e. /19, you can determine how many addresses are on the network via the following C code: addresses = 1 (32 - n). Where n is the part of the mask after the /. I wish I could find a faster way to blit the bits to make the real mask from the /N style than using a for loop. Only alternative I can think of is to use a switch on the 33 possibilities (0-32).--Of course, anything /8 and /30 doesn't make a real network. Can anyone think of a better way to blit an arbitrary number of bits from 0 to 1? Now, I'm working on a network calculator application that will support IPv6 as well. I should probably do it in JavaScript, uh, sorry, AJAX, so that the Web 2.0 people will notice. ;) Cheers, Jason ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss