Last active
December 28, 2016 07:13
-
-
Save preaction/730efcd79576246636b47464d7aa9511 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v5.014; | |
use NetAddr::IP::Util qw( inet_aton ipv6_ntoa ); | |
my $ipv4 = "192.168.125.2"; | |
my $v4n = inet_aton( $ipv4 ); | |
my $proxy_addr = pack( 'H4', 2002 ) . $v4n . pack( 'H20', 0 ); | |
say unpack( 'H*', $proxy_addr ); | |
my $ipv6 = ipv6_ntoa( $proxy_addr ); | |
say $ipv6; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v5.014; | |
use NetAddr::IP::Util qw( ipv4to6 ipv6to4 inet_aton ipv6_ntoa ); | |
my $ipv4 = "192.168.125.2"; | |
my $v4n = inet_aton( $ipv4 ); | |
my $v6n = ipv4to6( $v4n ); | |
my $ipv6 = ipv6_ntoa( $v6n ); | |
say $ipv6; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment