Skip Menu |

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

Report information
The Basics
Id: 39055
Status: resolved
Worked: 1 hour (62 min)
Priority: 0/
Queue: NetAddr-IP

People
Owner: michael [...] bizsystems.com
Requestors: dhawth [...] bitgravity.com
Cc:
AdminCc:

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



Subject: IPv6 Address formats
Date: Sat, 6 Sep 2008 15:24:07 -0700
To: bug-NetAddr-IP [...] rt.cpan.org
From: David Hawthorne <dhawth [...] bitgravity.com>
Here's what I'm doing: create a NetAddr::IP object out of any address. get back the full address string with $obj->addr(); What I'm getting: 0:0:0:0... What I want: 0000:0000:0000:0000... My workaround: get the $obj->aton(), hand it to my own ipv6_n2x subroutine that simply returns sprintf("%04X:%04X:%04X:%04X:%04X:%04X:%04X:%04X",unpack("n8",$_[0])); Please add an $obj->ipv6full or ->addr_full() or ->full() method to complement the ->short() method you already have. Thanks!
Subject: Re: [rt.cpan.org #39055] IPv6 Address formats
Date: Wed, 10 Sep 2008 10:13:30 -0700
To: bug-NetAddr-IP [...] rt.cpan.org
From: michael [...] insulin-pumpers.org
Show quoted text
> Sat Sep 06 18:24:31 2008: Request 39055 was acted upon. > Transaction: Ticket created by dhawth@bitgravity.com > Queue: NetAddr-IP > Subject: IPv6 Address formats > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: dhawth@bitgravity.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=39055 > > > > Here's what I'm doing: > > create a NetAddr::IP object out of any address. > get back the full address string with $obj->addr(); > > What I'm getting: > > 0:0:0:0... > > What I want: > > 0000:0000:0000:0000... > > My workaround: > > get the $obj->aton(), > hand it to my own ipv6_n2x subroutine that simply returns > sprintf("%04X:%04X:%04X:%04X:%04X:%04X:%04X:%04X",unpack("n8",$_[0])); > > Please add an $obj->ipv6full or ->addr_full() or ->full() method to > complement the ->short() method you already have. > > Thanks!
Sounds reasonable ;-) I'd suggest as a work around *NetAddr::IP::addr_full = \&lcladdrful; sub lcladdrfull { $ip = shift; return sprintf("%04X:%04X:%04X:%04X:%04X:%04X:%04X:%04X", unpack("n8",$ip->{addr})); }; That will allow you to use the object directly. then just use it normally my $full_ipv6_text = $naIPobj->addr_full; Best regards, Michael
Added new methods: $ip->full $ip->full6 plus documentation and tests released to CPAN in version 4.010
Subject: Re: [rt.cpan.org #39055] IPv6 Address formats
Date: Sat, 27 Sep 2008 19:05:10 -0700
To: bug-NetAddr-IP [...] rt.cpan.org
From: David Hawthorne <dhawth [...] bitgravity.com>
sweet, thanks! On Sep 27, 2008, at 5:33 PM, Michael Robinton via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=39055 > > > Added new methods: > > $ip->full > $ip->full6 > > plus documentation and tests > > released to CPAN in version 4.010 >
new features added in releas 4.010, ticket closed