Skip Menu |

This queue is for tickets about the NetAddr-IP CPAN distribution.

Report information
The Basics
Id: 62123
Status: resolved
Priority: 0/
Queue: NetAddr-IP

People
Owner: Nobody in particular
Requestors: SILASMONK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Can you parse "parse address<space>netmask"
This is to forward on a request from a Debian user. a typically formatting of ip addresses with netmasks in the cisco world is address<space>netmask. NetAddr::IP already knows about address and netmask seperated by "/" so seperating by " " should be straight forward. something like this solves it although i have no idea about the implications ... Havent run the testsuite ... --- NetAddr/IP/Lite.pm.orig 2008-12-15 11:18:53.000000000 +0100 +++ NetAddr/IP/Lite.pm 2008-12-15 11:19:00.000000000 +0100 @@ -516,7 +516,7 @@ while (1) { unless (@_) { - if ($ip =~ m!^(.+)/(.+)$!) { + if ($ip =~ m!^(.+)[/ ](.+)$!) { $ip = $1; $mask = $2; } elsif (grep($ip eq $_,qw(default any broadcast loopback unspecified))) { perl -e 'use NetAddr::IP; $i=new NetAddr::IP "10.0.0.1 255.255.255.0" or die; print $i->addr . "\n"' 10.0.0.1 The bug report is at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508775
On Thu Oct 14 07:53:21 2010, SILASMONK wrote: Show quoted text
> This is to forward on a request from a Debian user. > > > a typically formatting of ip addresses with netmasks in the cisco world > is address<space>netmask. NetAddr::IP already knows about > address and netmask seperated by "/" so seperating by " " should > be straight forward. > > something like this solves it although i have no idea about the > implications ... Havent run the testsuite ... > > --- NetAddr/IP/Lite.pm.orig 2008-12-15 11:18:53.000000000 +0100 > +++ NetAddr/IP/Lite.pm 2008-12-15 11:19:00.000000000 +0100 > @@ -516,7 +516,7 @@ > > while (1) { > unless (@_) { > - if ($ip =~ m!^(.+)/(.+)$!) { > + if ($ip =~ m!^(.+)[/ ](.+)$!) { > $ip = $1; > $mask = $2; > } elsif (grep($ip eq $_,qw(default any broadcast loopback > unspecified))) { > > > > perl -e 'use NetAddr::IP; $i=new NetAddr::IP "10.0.0.1 255.255.255.0" or > die; print $i->addr . "\n"' > 10.0.0.1 > > > > The bug report is at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508775 see added methods "new_cis" and "new_cis6" in release 4.035
I have updated NetAddr::IP v4.038 to include the Cisco syntax in the "new" series of methods. Calls to "new_cis" and "new_cis6" are now DEPRECATED and unneeded. On Thu Oct 28 19:11:11 2010, MIKER wrote: Show quoted text
> On Thu Oct 14 07:53:21 2010, SILASMONK wrote:
> > This is to forward on a request from a Debian user. > > > > > > a typically formatting of ip addresses with netmasks in the cisco world > > is address<space>netmask. NetAddr::IP already knows about > > address and netmask seperated by "/" so seperating by " " should > > be straight forward. > > > > something like this solves it although i have no idea about the > > implications ... Havent run the testsuite ... > > > > --- NetAddr/IP/Lite.pm.orig 2008-12-15 11:18:53.000000000 +0100 > > +++ NetAddr/IP/Lite.pm 2008-12-15 11:19:00.000000000 +0100 > > @@ -516,7 +516,7 @@ > > > > while (1) { > > unless (@_) { > > - if ($ip =~ m!^(.+)/(.+)$!) { > > + if ($ip =~ m!^(.+)[/ ](.+)$!) { > > $ip = $1; > > $mask = $2; > > } elsif (grep($ip eq $_,qw(default any broadcast loopback > > unspecified))) { > > > > > > > > perl -e 'use NetAddr::IP; $i=new NetAddr::IP "10.0.0.1 255.255.255.0" or > > die; print $i->addr . "\n"' > > 10.0.0.1 > > > > > > > > The bug report is at
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508775 > > > see added methods "new_cis" and "new_cis6" in release 4.035
On Fri Dec 17 21:25:54 2010, MIKER wrote: Show quoted text
> I have updated NetAddr::IP v4.038 to include the Cisco syntax in the > "new" series of methods. Calls to "new_cis" and "new_cis6" are now > DEPRECATED and unneeded. > > On Thu Oct 28 19:11:11 2010, MIKER wrote:
> > On Thu Oct 14 07:53:21 2010, SILASMONK wrote:
> > > This is to forward on a request from a Debian user. > > > > > > > > > a typically formatting of ip addresses with netmasks in the cisco
world Show quoted text
> > > is address<space>netmask. NetAddr::IP already knows about > > > address and netmask seperated by "/" so seperating by " " should > > > be straight forward. > > > > > > something like this solves it although i have no idea about the > > > implications ... Havent run the testsuite ... > > > > > > --- NetAddr/IP/Lite.pm.orig 2008-12-15 11:18:53.000000000 +0100 > > > +++ NetAddr/IP/Lite.pm 2008-12-15 11:19:00.000000000 +0100 > > > @@ -516,7 +516,7 @@ > > > > > > while (1) { > > > unless (@_) { > > > - if ($ip =~ m!^(.+)/(.+)$!) { > > > + if ($ip =~ m!^(.+)[/ ](.+)$!) { > > > $ip = $1; > > > $mask = $2; > > > } elsif (grep($ip eq $_,qw(default any broadcast loopback > > > unspecified))) { > > > > > > > > > > > > perl -e 'use NetAddr::IP; $i=new NetAddr::IP "10.0.0.1
255.255.255.0" or Show quoted text
> > > die; print $i->addr . "\n"' > > > 10.0.0.1 > > > > > > > > > > > > The bug report is at
> > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508775 > > > > > > see added methods "new_cis" and "new_cis6" in release 4.035
> >