view release on metacpan or search on metacpan
t/01.config.t view on Meta::CPAN
my $dummy_data = {
ip_addr_show =><<'EOF',
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:01:c0:08:3e:38 brd ff:ff:ff:ff:ff:ff
inet 191.3.88.152/27 brd 255.255.255.255 scope global eth0
inet6 fe80::201:c0ff:fe08:3e38/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:01:c0:08:3e:39 brd ff:ff:ff:ff:ff:ff
inet 192.168.10.1/24 brd 192.168.10.255 scope global eth1
inet6 fe80::201:c0ff:fe08:3e39/64 scope link
valid_lft forever preferred_lft forever
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 48:f8:b3:2e:f6:b2 brd ff:ff:ff:ff:ff:ff
inet 192.168.11.11/24 brd 192.168.11.255 scope global eth2
inet6 fe80::4af8:b3ff:fe2e:f6b2/64 scope link
valid_lft forever preferred_lft forever
5: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 00:0d:f0:63:95:61 brd ff:ff:ff:ff:ff:ff
6: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 48:f8:b3:2e:f6:b2 brd ff:ff:ff:ff:ff:ff
inet 192.168.12.1/24 brd 192.168.12.255 scope global eth3
inet 192.168.13.1/24 brd 192.168.13.255 scope global eth3:0
inet6 fe80::4af8:b3ff:fe2e:f6b2/64 scope link
valid_lft forever preferred_lft forever
7: eth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 48:f8:b3:2e:f6:b2 brd ff:ff:ff:ff:ff:ff
inet6 fe80::4af8:b3ff:fe2e:f6b2/64 scope link
valid_lft forever preferred_lft forever
8: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1492 qdisc pfifo_fast state UNKNOWN qlen 3
link/ppp
inet 11.120.199.108 peer 112.211.154.198/32 scope global ppp0
9: eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 48:f8:b3:2e:f6:b4 brd ff:ff:ff:ff:ff:ff
inet 192.168.20.1/24 brd 192.168.20.255 scope global eth5
inet6 fe80::4af8:b3ff:fe2e:f6b2/64 scope link
valid_lft forever preferred_lft forever
31: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 100
link/none
inet 10.8.0.1 peer 10.8.0.2/32 scope global tun0
EOF
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/Inspect/L3/IP.pm view on Meta::CPAN
use base 'Net::Inspect::Flow';
use fields qw(frag frag_timeout);
use Net::Inspect::Debug;
use Socket;
my $inet6_ntop;
BEGIN {
$inet6_ntop = eval {
Socket->VERSION(1.95);
Socket::inet_ntop( AF_INET6(),"\x0"x16)
&& sub { Socket::inet_ntop(AF_INET6(),shift) };
} || eval {
require Socket6;
Socket6::inet_ntop( Socket6::AF_INET6(),"\x0"x16)
&& sub { Socket6::inet_ntop(Socket6::AF_INET6(),shift) };
};
*pktin6 = $inet6_ntop ? \&_pktin6 : \&_pktin6_unsupported;
}
# field frag: hash indexed by {ip.id,saddr,daddr} with values
# [ $pos, \@fragments, $expire ]
lib/Net/Inspect/L3/IP.pm view on Meta::CPAN
substr($data,0,$len+8,''); # skip extension header
}
return $self->{upper_flow}->pktin( $data, {
time => $time,
saddr => $inet6_ntop->($saddr),
daddr => $inet6_ntop->($daddr),
proto => $proto,
ttl => $ttl,
qos => $tclass,
flowlabel => $flowlabel,
ver => 6,
view all matches for this distribution
view release on metacpan or search on metacpan
Interface.pm view on Meta::CPAN
# provide AF family data for use in this module
my $AF_inet = eval { 0 + AF_INET() } || 0;
my $AF_inet6 = eval { 0 + AF_INET6() } || 0;
sub af_inet { return $AF_inet; }
sub af_inet6 { return $AF_inet6; }
sub net_symbols() {
no strict;
my %sym;
my $max = AF_MAX();
Interface.pm view on Meta::CPAN
unless ($f) { # if the family is missing
if (exists $if->{args}->{&af_inet}) {
$fam = &af_inet; # select default, AF_INET
}
else {
$fam = &af_inet6; # or AF_INET6 if present
}
}
if (! exists $if->{args}->{$fam} || # there is no such family
$idx < 0 || $idx > $#{$if->{args}->{$fam}->{addr}}) { # or the index is out of range
return () if wantarray; # PUNT!
Interface.pm view on Meta::CPAN
metric => $metric,
flags => $flags,
mac => $mac,
index => $index,
};
my $af_inet6 = eval { &af_inet6 } || 0;
foreach(&af_inet,$af_inet6) {
next unless $_;
if (exists $if->{args}->{$_}) {
$info->{$_}->{size} = $if->{args}->{$_}->{size};
$info->{$_}->{number} = @{$if->{args}->{$_}->{addr}};
}
Interface.pm view on Meta::CPAN
my $len = length($_[0]);
if ($len == 4) {
return &af_inet;
}
elsif ($len == 16) {
return &af_inet6;
}
return 0;
}
=head1 FUNCTIONS
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/Libdnet6.pm view on Meta::CPAN
sub _get_routes_other { return; }
sub _get_routes_linux {
return unless $_pathNetstat;
my $buf = `$_pathNetstat -rnA inet6 2> /dev/null`;
return unless $buf;
my @ifRoutes = ();
my %devIps;
for (split('\n', $buf)) {
lib/Net/Libdnet6.pm view on Meta::CPAN
}
sub _get_routes_bsd {
return unless $_pathNetstat;
my $buf = `$_pathNetstat -rnf inet6 2> /dev/null`;
return unless $buf;
my @ifRoutes = ();
my %devIps;
for (split('\n', $buf)) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/OpenSSH/More/Linux.pm view on Meta::CPAN
sub get_remote_ips {
my ( $self, $interface ) = @_;
return (
'v4' => [ $get_addrs_for_iface->( $self, $interface, 'inet' ) ],
'v6' => [ $get_addrs_for_iface->( $self, $interface, 'inet6' ) ],
);
}
sub get_local_ips {
my ( $self, $interface ) = @_;
return (
'v4' => [ $get_addrs_for_iface->( $self, $interface, 'inet', 1 ) ],
'v6' => [ $get_addrs_for_iface->( $self, $interface, 'inet6', 1 ) ],
);
}
sub copy {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/Packet/IPv6.pm view on Meta::CPAN
require Net::Packet::Layer3;
our @ISA = qw(Net::Packet::Layer3);
use Net::Packet::Env qw($Env);
use Net::Packet::Utils qw(unpackIntFromNet packIntToNet
inet6Aton inet6Ntoa);
use Net::Packet::Consts qw(:ipv6 :layer);
BEGIN {
*protocol = \&nextHeader;
}
lib/Net/Packet/IPv6.pm view on Meta::CPAN
$self->[$__raw] = $self->SUPER::pack('NnCCa*a*',
$v32->to_Dec,
$self->[$__payloadLength],
$self->[$__nextHeader],
$self->[$__hopLimit],
inet6Aton($self->[$__src]),
inet6Aton($self->[$__dst]),
) or return undef;
1;
}
lib/Net/Packet/IPv6.pm view on Meta::CPAN
$self->[$__trafficClass] = $v32->Chunk_Read( 8, 20);
$self->[$__version] = $v32->Chunk_Read( 4, 28);
$self->[$__payloadLength] = $pl;
$self->[$__nextHeader] = $nh;
$self->[$__hopLimit] = $hl;
$self->[$__src] = inet6Ntoa($sa);
$self->[$__dst] = inet6Ntoa($da);
$self->[$__payload] = $payload;
1;
}
view all matches for this distribution
view release on metacpan or search on metacpan
libpatricia/patricia.c view on Meta::CPAN
#ifdef HAVE_IPV6
else if (family == AF_INET6) {
// Get rid of this with next IPv6 upgrade
#if defined(NT) && !defined(HAVE_INET_NTOP)
inet6_addr(string, &sin6);
return (New_Prefix (AF_INET6, &sin6, bitlen));
#else
if ((result = inet_pton (AF_INET6, string, &sin6)) <= 0)
return (NULL);
#endif /* NT */
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/Routing.pm view on Meta::CPAN
our $Error;
use constant NR_TARGET_ALL => 'all';
use constant NR_TARGET_DEFAULT => 'default';
use constant NR_FAMILY_INET4 => 'inet4';
use constant NR_FAMILY_INET6 => 'inet6';
use constant NR_DEFAULT_ROUTE4 => '0.0.0.0/0';
use constant NR_DEFAULT_ROUTE6 => '::/0';
use constant NR_LOCAL_ROUTE4 => '0.0.0.0';
use constant NR_LOCAL_ROUTE6 => '::';
view all matches for this distribution
view release on metacpan or search on metacpan
##-----------------------------------------------------------------------------
#/Start Subroutine : _socket
#
# Purpose : Create a socket
# Params : b_inet6, b_many
# Returns : 0 on success -1 on failure
# b_inet6 : determines what version of ip to use for the
# for the socket.
# b_many : determines whether to socket
# is using the new style one to many (if true) socket
# or the old style (if false)
int
_socket(b_inet6, b_many)
bool b_inet6
bool b_many
CODE:
// AF_INET for IPv4, b_inet6 = false
// AF_INET6 for IPv6, b_inet6 = true
// SOCK_SEQPACKET for one to many, b_many = true
// SOCK_STREAM for one to one, b_many = false
// Set our return value equal to the function
// call so we can return that to perl
RETVAL = socket(((b_inet6) ? AF_INET6 : AF_INET),
((b_many) ? SOCK_SEQPACKET : SOCK_STREAM) , IPPROTO_SCTP);
// RETVAL was a failure, print out the error to the user because
// Perl cannot do it.
if( RETVAL < 0 )
# Purpose : bind an address with a socket
# Returns : 0 on success -1 on failure
# i_sd : The socket descriptor to bind to.
# i_port : The port to bind to.
# sz_ip : The ip to bind to
# b_inet6 : Whether the connection is v6 or v4
int
_bind( i_sd, i_port, sz_ip, b_inet6)
int i_sd
int i_port
char* sz_ip
bool b_inet6
PREINIT:
// The structure that the addresses need to be inside of when passed to the
// actual sctp function.
struct sockaddr_in t_addr;
// AF_INET for IPv4, b_inet is false
// AF_INET6 for IPv6, b_inet is true
// Build the structure to pass into the sctp function
t_addr.sin_family = ( (b_inet6) ? AF_INET6 : AF_INET );
t_addr.sin_port = htons(i_port);
t_addr.sin_addr.s_addr = inet_addr(sz_ip);
// Set our return value equal to the function
// call so we can return that to perl
# Purpose : send a message to someone over sctp
# i_sd : The socket descriptor of the sender
# sz_msg : The message to be sent
# i_port : The port to send the message over
# sz_ip : The ip address to send the message to
# b_inet6 : ipv6 is true, ipv4 is false
# i_ppid : NYI
# i_flags : NYI
# i_stream : NYI
# i_pr_value : NYI
# i_context : NYI
int
_sctp_sendmsg( i_sd, sz_msg, i_msg_len, i_port, sz_ip, b_inet6, i_ppid = 0, i_flags = 0, i_stream = 0, i_pr_value = 0, i_pr_value = 0, i_context = 0 )
int i_sd
char* sz_msg
int i_msg_len
int i_port
char* sz_ip
bool b_inet6
int i_ppid
int i_flags
int i_stream
int i_pr_value
int i_context
PREINIT:
struct sockaddr_in t_addr = {0};
CODE:
// AF_INET for IPv4
// AF_INET6 for IPv6
t_addr.sin_family = ( (b_inet6) ? AF_INET6 : AF_INET );
t_addr.sin_port = htons(i_port);
t_addr.sin_addr.s_addr = inet_addr( sz_ip );
RETVAL = sctp_sendmsg( i_sd, (const void *)sz_msg, i_msg_len, (struct sockaddr *)&t_addr, sizeof(struct sockaddr_in), htonl(i_ppid), i_flags, i_stream /*stream 0*/, i_pr_value, i_context);
#
# Purpose : send a message to someone over sctp
# i_sd : The socket descriptor of the client who is connecting
# i_port : The port to connect to
# sz_ip : The ip address to connect to
# b_inet6 : The version of ip we are using, true for v6 false for v4
int
_connect( i_sd, i_port, sz_ip, b_inet6 )
int i_sd
int i_port
char* sz_ip
bool b_inet6
PREINIT:
struct sockaddr_in servaddr;
CODE:
bzero( (void *)&servaddr, sizeof(struct sockaddr_in) );
// AF_INET for IPv4
// AF_INET6 for IPv6
servaddr.sin_family = ( (b_inet6) ? AF_INET6 : AF_INET );
servaddr.sin_port = htons(i_port);
servaddr.sin_addr.s_addr = inet_addr( sz_ip );
RETVAL=connect( i_sd, (struct sockaddr *)&servaddr, sizeof(struct sockaddr_in) );
if( RETVAL )
{
# Purpose : Bind the server ti multiple connections
# Returns : Success(0) or failure(-1)
# i_sd : The socket descriptor of the server
# i_port : The port of the server
# av_sz_ip : The array of ips to bind to
# av_b_inet6 : The array of ip versions created for the user in perl
# i_flags : 1 is add these addresses 2 is remove them
int
_sctp_bindx(i_sd, i_port, av_sz_ip, av_b_inet6, i_flags)
int i_sd
int i_port
SV* av_sz_ip
SV* av_b_inet6
int i_flags
PREINIT:
int i = 0;
int i_addr_cnt;
CODE:
AV* array_length = (AV *) SvRV (av_b_inet6);
i_addr_cnt = av_len(array_length);
struct sockaddr_in t_addrs[i_addr_cnt];
while(i <= i_addr_cnt)
{
# Purpose : Attempts to connect to a server using multiple addresses
# Returns : Success(0) or failure(-1)
# i_sd : The socket descriptor of the client
# i_port : The port of the server
# av_sz_ip : The array of ips to connect to
# av_b_inet6 : The array of ip versions created for the user in perl
# i_id : The association id to give the association that is
# being set up
int
_sctp_connectx(i_sd, i_port, av_sz_ip, av_b_inet6, i_id = 0)
int i_sd
int i_port
SV* av_sz_ip
SV* av_b_inet6
int i_id;
PREINIT:
int i = 0;
int i_addr_cnt;
CODE:
AV* array_length = (AV *) SvRV (av_b_inet6);
i_addr_cnt = av_len(array_length);
struct sockaddr_in t_addrs[i_addr_cnt];
while(i <= i_addr_cnt)
{
# Purpose : Returns all peer addresses in an association
# Returns : Fills out the arrays passed with peer addresses
# i_sd : The socket descriptor of the client
# i_port : The port to be filled
# av_sz_ip : The array of ips to to be filled
# av_b_inet6 : The array of ip versions to be filled
# i_id : The association id to get the addresses from
# : Automatically calls sctp_freepaddrs
int
_sctp_getpaddrs(i_sd, i_id, av_sz_ip,av_i_port, av_b_inet6)
int i_sd
int i_id
SV* av_sz_ip
SV* av_i_port
SV* av_b_inet6
PREINIT:
struct sockaddr_in * t_addrs;
int i = 0;
AV* array_ip = (AV *) SvRV (av_sz_ip);
AV* array_port = (AV *) SvRV (av_i_port);
AV* array_inet6 = (AV *) SvRV (av_b_inet6);
CODE:
RETVAL = sctp_getladdrs(i_sd, i_id, (struct sockaddr **)&t_addrs);
while(i < RETVAL)
{
SV* temp_port = newSViv(t_addrs[i].sin_port);
av_push(array_port, temp_port);
SV* temp_family = newSViv(t_addrs[i].sin_family);
av_push(array_inet6, temp_family);
++i;
}
sctp_freepaddrs((struct sockaddr *)&t_addrs);
if( RETVAL < 0 )
{
# Purpose : Returns all local addresses in an association
# Returns : Fills out the arrays passed with local addresses
# i_sd : The socket descriptor of the client
# i_port : The port to be filled
# av_sz_ip : The array of ips to to be filled
# av_b_inet6 : The array of ip versions to be filled
# i_id : The association id to get the addresses from
# Automatically calls sctp_freeladdrs
int
_sctp_getladdrs(i_sd, i_id, av_sz_ip, av_i_port, av_b_inet6)
int i_sd
int i_id
SV* av_sz_ip
SV* av_i_port
SV* av_b_inet6
PREINIT:
struct sockaddr_in * t_addrs;
int i = 0;
AV* array_ip = (AV *) SvRV (av_sz_ip);
AV* array_port = (AV *) SvRV (av_i_port);
AV* array_inet6 = (AV *) SvRV (av_b_inet6);
CODE:
RETVAL = sctp_getladdrs(i_sd, i_id, (struct sockaddr **)&t_addrs);
while(i < RETVAL)
{
SV* temp_port = newSViv(t_addrs[i].sin_port);
av_push(array_port, temp_port);
SV* temp_family = newSViv(t_addrs[i].sin_family);
av_push(array_inet6, temp_family);
++i;
}
sctp_freeladdrs((struct sockaddr *)&t_addrs);
if( RETVAL < 0 )
# SCTP_SENDX
#
# i_ppid -- message_id so chunks can be put together (OPTIONAL)
# i_stream -- 0 = out | 1 = input | 2 = error
#int
#_sctp_sendx( i_sd, sz_msg, i_port, av_sz_ip, av_b_inet6, i_flags = 0)
# int i_sd
# char* sz_msg
# int i_port
# SV* av_sz_ip
# SV* av_b_inet6
# int i_flags
# PREINIT:
# int i_addr_cnt = 0;
# int i = 0;
# CODE:
# AV* array_length = (AV *) SvRV (av_b_inet6);
# i_addr_cnt = av_len(array_length);
# struct sockaddr_in t_addrs[i_addr_cnt];
#
#
# while(i <= i_addr_cnt)
view all matches for this distribution
view release on metacpan or search on metacpan
docs/ssh-broker-config.txt view on Meta::CPAN
· environment value
· command line arguments.
address-family
The address-family element defines the IP address family for this profile. The broker will operate using IPv4 (inet) addressing, IPv6 (inet6), or both (any). The default is any.
THE profiles ELEMENT
The profiles element defines the connection profiles for connecting to the specified servers. Element profiles can contain multiple profile elements. Each profile defines the connection rules to one server. The settings in the profile elemen...
default connection settings.
view all matches for this distribution
view release on metacpan or search on metacpan
t/15_TCP_ipv4v6.t
t/16_TCP_StackIPV.t
t/17_TCP_DoublePort.t
t/20_IPv6_bogus.t
t/21_IPv6_socketip.t
t/22_IPv6_socketinet6.t
t/23_IPv6_recurse.t
t/24_IPvA_socketip.t
t/25_IPvA_socketinet6.t
t/26_IPv6_socketip_Only.t
t/27_IPv6_socketinet6_Only.t
t/28_IPvA_socketip_Only.t
t/29_IPvA_socketinet6_Only.t
t/Options.t
t/Options.t.conf
t/Port_Configuration.t
t/self_signed.crt
t/self_signed.key
view all matches for this distribution
view release on metacpan or search on metacpan
clib/src/panda/net/pton.impl
clib/src/panda/net/sockaddr.cc
clib/src/panda/net/sockaddr.h
clib/tests/base.cc
clib/tests/inet4.cc
clib/tests/inet6.cc
clib/tests/lib/test.cc
clib/tests/lib/test.h
clib/tests/main.cc
clib/tests/unix.cc
INSTALL.SKIP
src/xs/net/sockaddr.cc
src/xs/net/sockaddr.h
t/base.t
t/constants.t
t/inet4.t
t/inet6.t
t/lib/MyTest.pm
t/unix.t
META.yml Module YAML meta-data (added by MakeMaker)
META.json Module JSON meta-data (added by MakeMaker)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/Telnet.pm view on Meta::CPAN
}
else { # perl version < 5.004
&_import_filehandle;
push @ISA, "FileHandle";
}
my $AF_INET6 = &_import_af_inet6();
my $AF_UNSPEC = &_import_af_unspec() || 0;
my $AI_ADDRCONFIG = &_import_ai_addrconfig() || 0;
my $EAI_BADFLAGS = &_import_eai_badflags() || -1;
my $EINTR = &_import_eintr();
lib/Net/Telnet.pm view on Meta::CPAN
! $@;
} # end sub _have_alarm
sub _import_af_inet6 {
local $@;
eval {
local $SIG{"__DIE__"} = "DEFAULT";
Socket::AF_INET6();
};
} # end sub _import_af_inet6
sub _import_af_unspec {
local $@;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/Telnet.pm view on Meta::CPAN
}
else { # perl version < 5.004
require FileHandle;
push @ISA, "FileHandle";
}
my $AF_INET6 = &_import_af_inet6();
my $AF_UNSPEC = &_import_af_unspec() || 0;
my $AI_ADDRCONFIG = &_import_ai_addrconfig() || 0;
my $EAI_BADFLAGS = &_import_eai_badflags() || -1;
my $EINTR = &_import_eintr();
lib/Net/Telnet.pm view on Meta::CPAN
! $@;
} # end sub _have_alarm
sub _import_af_inet6 {
local $@;
eval {
local $SIG{"__DIE__"} = "DEFAULT";
Socket::AF_INET6();
};
} # end sub _import_af_inet6
sub _import_af_unspec {
local $@;
view all matches for this distribution
view release on metacpan or search on metacpan
Traceroute6.pm view on Meta::CPAN
#real address family if you specify PF_UNSPEC
my $real_af = -1;
# check whether we have IPv6 support;
my $inet6 = defined(eval 'PF_INET6');
###
# Public methods
# Constructor
Traceroute6.pm view on Meta::CPAN
my $old = $self->{$elem};
if (@_) {
$self->{$elem} = PF_UNSPEC if ($_[0]== PF_UNSPEC) ;
$self->{$elem} = PF_INET if ($_[0]== PF_INET) ;
$self->{$elem} = PF_INET6 if ($inet6 && ($_[0] == PF_INET6));
}
return $old;
}
# Accessor for status of this traceroute object. Externally read only
Traceroute6.pm view on Meta::CPAN
OSNAMESW: {
# here comes Solaris
if ($os = ~ /solaris/) {
push (@args, "traceroute");
push (@args, "-A");
$prg_sw = ($self->af == PF_INET6) ? "inet6" : "inet";
push (@args, $prg_sw);
last OSNAMESW;
}
# here comes AIX
#
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/Whois/IANA.pm view on Meta::CPAN
@IANA = sort keys %IANA;
# accessors
# do not use AUTOLOAD - only accept lowercase function name
# define accessors at compile time
my @accessors = qw{country netname descr status source server inetnum inet6num cidr abuse fullinfo};
foreach my $accessor (@accessors) {
no strict 'refs';
*$accessor = sub {
my ($self) = @_;
lib/Net/Whois/IANA.pm view on Meta::CPAN
|| ( defined $query{country}
&& $query{country} =~ /world wide/ )
) {
return ();
}
elsif ( !$query{inet6num} && !$query{inetnum} ) {
return ();
}
else {
$query{permission} = 'allowed';
$query{cidr} = [ Net::CIDR::range2cidr( uc( $query{inet6num} || $query{inetnum} ) ) ];
}
return %query;
}
sub ripe_query ($$) {
lib/Net/Whois/IANA.pm view on Meta::CPAN
next if $skip_block;
next if ( !/\:/ );
s/\s+$//;
my ( $field, $value ) = split( /:/, $_, 2 );
$value =~ s/^\s+//;
if ( $field =~ /^inet6?num$/ ) {
next if $value =~ m{0\.0\.0\.0\s+};
%tmp = %query;
%query = ();
$query{fullinfo} = $tmp{fullinfo};
}
lib/Net/Whois/IANA.pm view on Meta::CPAN
|| ( defined $query{descr}
&& $query{descr} =~ /not allocated to|by APNIC|placeholder reference/i )
) {
return ();
}
elsif ( !$query{inet6num} && !$query{inetnum} ) {
return ();
}
else {
$query{permission} = 'allowed';
$query{cidr} = [ Net::CIDR::range2cidr( uc( $query{inet6num} || $query{inetnum} ) ) ];
}
return %query;
}
lib/Net/Whois/IANA.pm view on Meta::CPAN
return ()
if defined $query{remarks} && $query{remarks} =~ /country is really worldwide/
or defined $query{descr} && $query{descr} =~ /Here for in-addr\.arpa authentication/;
if ( !$query{inet6num} && !$query{inetnum} ) {
return ();
}
$query{permission} = 'allowed';
$query{cidr} =
[ Net::CIDR::range2cidr( uc( $query{inet6num} || $query{inetnum} ) ) ];
return %query;
}
sub afrinic_query ($$) {
my ( $sock, $ip ) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/Whois/Generic.pm view on Meta::CPAN
=head2 B<object_types()>
Return a list of known object types from the RIPE Database.
RIPE currently returns 21 types (Limerik have been removed):
as-block as-set aut-num domain filter-set inet6num inetnum inet-rtr irt
key-cert mntner organisation peering-set person poem poetic-form role route
route6 route-set rtr-set
Due to some strange mis-behaviour in the protocol (or documentation?) the RIPE
Database server won't allow a keep-alive token with this query, meaning the
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/Write/Layer.pm view on Meta::CPAN
$val = 0x1002;
}
eval "use constant NW_IP_HDRINCL => $val;";
}
sub _setAfinet6Constant {
my $val = 10; # Default value, in case we don't know.
# This is the value from a Ubuntu 14.10 system.
eval {
require Socket;
Socket->import(qw(AF_INET6));
lib/Net/Write/Layer.pm view on Meta::CPAN
_setIpProtoIpConstant();
_setIpProtoIpv6Constant();
_setIpProtoRawConstant();
_setIpHdrInclConstant();
_setAfinet6Constant();
_setInetPtonSub();
_setGetaddrinfoSub();
}
no strict 'vars';
view all matches for this distribution
view release on metacpan or search on metacpan
Lite/MANIFEST view on Meta::CPAN
Util/Makefile.PL
Util/README
Util/t/4to6.t
Util/t/add128.t
Util/t/addconst.t
Util/t/af_inet6.t
Util/t/anyto6.t
Util/t/badd.t
Util/t/bcd2bin.t
Util/t/bcdn2bin.t
Util/t/bin.t
view all matches for this distribution
view release on metacpan or search on metacpan
lib/NetInfoExtractor/Interface.pm view on Meta::CPAN
return $ipv4;
}
sub parse_ipv6_address {
my $ifconfig_output = shift;
my ($ipv6) = $ifconfig_output =~ m/inet6\saddr:\s(.*)\//g;
return $ipv6;
}
sub read_mac_address_file {
my $file = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
src/core/ngx_inet.c view on Meta::CPAN
#include <ngx_core.h>
static ngx_int_t ngx_parse_unix_domain_url(ngx_pool_t *pool, ngx_url_t *u);
static ngx_int_t ngx_parse_inet_url(ngx_pool_t *pool, ngx_url_t *u);
static ngx_int_t ngx_parse_inet6_url(ngx_pool_t *pool, ngx_url_t *u);
in_addr_t
ngx_inet_addr(u_char *text, size_t len)
{
src/core/ngx_inet.c view on Meta::CPAN
#if (NGX_HAVE_INET6)
ngx_int_t
ngx_inet6_addr(u_char *p, size_t len, u_char *addr)
{
u_char c, *zero, *digit, *s, *d;
size_t len4;
ngx_uint_t n, nibbles, word;
src/core/ngx_inet.c view on Meta::CPAN
if (port) {
text[n++] = '[';
}
n = ngx_inet6_ntop(sin6->sin6_addr.s6_addr, &text[n], len);
if (port) {
n = ngx_sprintf(&text[1 + n], "]:%d",
ntohs(sin6->sin6_port)) - text;
}
src/core/ngx_inet.c view on Meta::CPAN
- text;
#if (NGX_HAVE_INET6)
case AF_INET6:
return ngx_inet6_ntop(addr, text, len);
#endif
default:
return 0;
src/core/ngx_inet.c view on Meta::CPAN
#if (NGX_HAVE_INET6)
size_t
ngx_inet6_ntop(u_char *p, u_char *text, size_t len)
{
u_char *dst;
size_t max, n;
ngx_uint_t i, zero, last;
src/core/ngx_inet.c view on Meta::CPAN
cidr->u.in.mask = 0xffffffff;
return NGX_OK;
}
#if (NGX_HAVE_INET6)
} else if (ngx_inet6_addr(addr, len, cidr->u.in6.addr.s6_addr) == NGX_OK) {
cidr->family = AF_INET6;
if (mask == NULL) {
ngx_memset(cidr->u.in6.mask.s6_addr, 0xff, 16);
return NGX_OK;
src/core/ngx_inet.c view on Meta::CPAN
if (inaddr != INADDR_NONE) {
family = AF_INET;
len = sizeof(struct sockaddr_in);
#if (NGX_HAVE_INET6)
} else if (ngx_inet6_addr(text, len, inaddr6.s6_addr) == NGX_OK) {
family = AF_INET6;
len = sizeof(struct sockaddr_in6);
#endif
} else {
src/core/ngx_inet.c view on Meta::CPAN
if (ngx_strncasecmp(p, (u_char *) "unix:", 5) == 0) {
return ngx_parse_unix_domain_url(pool, u);
}
if (p[0] == '[') {
return ngx_parse_inet6_url(pool, u);
}
return ngx_parse_inet_url(pool, u);
}
src/core/ngx_inet.c view on Meta::CPAN
return NGX_OK;
}
static ngx_int_t
ngx_parse_inet6_url(ngx_pool_t *pool, ngx_url_t *u)
{
#if (NGX_HAVE_INET6)
u_char *p, *host, *port, *last, *uri;
size_t len;
ngx_int_t n;
src/core/ngx_inet.c view on Meta::CPAN
}
u->host.len = len + 2;
u->host.data = host - 1;
if (ngx_inet6_addr(host, len, sin6->sin6_addr.s6_addr) != NGX_OK) {
u->err = "invalid IPv6 address";
return NGX_ERROR;
}
if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/OSLV/Monitor/Backends/FreeBSD.pm view on Meta::CPAN
my $interface;
foreach my $line (@output_split) {
if ( $line =~ /^[a-zA-Z].*\:[\ \t]+flags\=/ ) {
$interface = $line;
$interface =~ s/\:[\ \t]+flags.*//;
} elsif ( $line =~ /^[\ \t]+inet6 /
&& defined($interface) )
{
$line =~ s/^[\ \t]+inet6 //;
$line =~ s/\ .*$//;
$line =~ s/\%.*$//;
$found_IPv6{$line} = $interface;
} elsif ( $line =~ /^[\ \t]+inet /
&& defined($interface) )
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Wheel/SocketFactory.pm view on Meta::CPAN
# same operations, it seems, and this is a way to add new ones with a
# minimum of additional code.
sub DOM_UNIX () { 'unix' } # UNIX domain socket
sub DOM_INET () { 'inet' } # INET domain socket
sub DOM_INET6 () { 'inet6' } # INET v6 domain socket
# AF_XYZ and PF_XYZ may be different.
my %map_family_to_domain = (
AF_UNIX, DOM_UNIX, PF_UNIX, DOM_UNIX,
AF_INET, DOM_INET, PF_INET, DOM_INET,
view all matches for this distribution
view release on metacpan or search on metacpan
t/43_network.t view on Meta::CPAN
my $sendmail =
'... [IPv6:1111:2222:3333:4444:5555:6666:7777:8888] did not issue MAIL/EXPN/VRFY/ETRN during connection ...';
my $ifconfig = << '__EOF__';
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:199412 errors:0 dropped:0 overruns:0 frame:0
TX packets:199412 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:90311250 (86.1 MiB) TX bytes:90311250 (86.1 MiB)
t/43_network.t view on Meta::CPAN
my $iproute = << '__EOF__';
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
link/ether 00:d0:f9:6a:cd:d0 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:12:a8:ff:0e:a1 brd ff:ff:ff:ff:ff:ff
inet 192.168.2.156/24 brd 192.168.2.255 scope global wlan0
inet6 fe80::212:a8ff:feff:0ea1/64 scope link
valid_lft forever preferred_lft forever
__EOF__
ok( ipInNetworks( '127.0.0.1', '127.0.0.0/8' ), 'ipInNetworks 1' );
ok( ipInNetworks( '127.0.0.1', '127.0.0.0/255.0.0.0' ), 'ipInNetworks 2' );
view all matches for this distribution
view release on metacpan or search on metacpan
share/ip-samples/addr-show-old-eth.txt view on Meta::CPAN
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:15:30:44:5c:61 brd ff:ff:ff:ff:ff:ff
inet 102.38.45.59/25 brd 102.38.45.127 scope global eth0
inet6 f180::235:40ff:fe54:6cb1/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 00:15:20:34:5c:60 brd ff:ff:ff:ff:ff:ff
view all matches for this distribution
view release on metacpan or search on metacpan
t/scan/heredoc.t view on Meta::CPAN
$frame->l3->getPayloadLength,
) or return undef;
}
elsif ($frame->l3->isIpv6) {
$phpkt = $self->SUPER::pack('a*a*NnCC',
inet6Aton($frame->l3->src),
inet6Aton($frame->l3->dst),
$frame->l3->payloadLength,
0,
0,
$frame->l3->nextHeader,
) or return undef;
t/scan/heredoc.t view on Meta::CPAN
$totalLength,
) or return undef;
}
elsif ($env->desc->isFamilyIpv6) {
$phpkt = $self->SUPER::pack('a*a*NnCC',
inet6Aton($env->ip6),
inet6Aton($env->desc->target),
$totalLength,
0,
0,
$env->desc->protocol,
) or return undef;
view all matches for this distribution
view release on metacpan or search on metacpan
local/lib/perl5/IO/Socket/SSL.pm view on Meta::CPAN
}
}
# Export some stuff
# inet4|inet6|debug will be handled by myself, everything
# else will be handled the Exporter way
sub import {
my $class = shift;
my @export;
foreach (@_) {
if ( /^inet4$/i ) {
# explicitly fall back to inet4
@ISA = 'IO::Socket::INET';
@caller_force_inet4 = caller(); # save for warnings for 'inet6' case
} elsif ( /^inet6$/i ) {
# check if we have already ipv6 as base
if ( ! UNIVERSAL::isa( $class, 'IO::Socket::INET6')
and ! UNIVERSAL::isa( $class, 'IO::Socket::IP' )) {
# either we don't support it or we disabled it by explicitly
# loading it with 'inet4'. In this case re-enable but warn
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Protocol/CassandraCQL/Frame.pm view on Meta::CPAN
=cut
sub pack_inet { my ( $self, $v ) = @_;
my $family = Socket::sockaddr_family($v);
if ( $family == AF_INET ) { $$self .= "\x04"; $self->_pack_inet4( $v ) }
elsif( $family == AF_INET6 ) { $$self .= "\x10"; $self->_pack_inet6( $v ) }
else { croak "Expected AF_INET or AF_INET6 address" }
$self }
sub unpack_inet { my ( $self ) = @_;
my $addrlen = unpack "C", substr $$self, 0, 1, "";
if ( $addrlen == 4 ) { $self->_unpack_inet4 }
elsif( $addrlen == 16 ) { $self->_unpack_inet6 }
else { croak "Expected address length 4 or 16" } }
# AF_INET
sub _pack_inet4 { my ( $self, $v ) = @_;
my ( $port, $addr ) = Socket::unpack_sockaddr_in( $v );
lib/Protocol/CassandraCQL/Frame.pm view on Meta::CPAN
sub _unpack_inet4 { my ( $self ) = @_;
my $addr = substr $$self, 0, 4, "";
Socket::pack_sockaddr_in( $self->unpack_int, $addr ) }
# AF_INET6
sub _pack_inet6 { my ( $self, $v ) = @_;
my ( $port, $addr ) = Socket::unpack_sockaddr_in6( $v );
$$self .= $addr; $self->pack_int( $port ) }
sub _unpack_inet6 { my ( $self ) = @_;
my $addr = substr $$self, 0, 16, "";
Socket::pack_sockaddr_in6( $self->unpack_int, $addr ) }
=head2 $frame->pack_string_map( $v )
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Provision/Unix/Utility.pm view on Meta::CPAN
my $once = 0;
TRY:
my @ips = grep {/inet/} `$ifconfig`; chomp @ips;
@ips = grep {!/inet6/} @ips if $p{exclude_ipv6};
@ips = grep {!/inet 127\.0\.0/} @ips if $p{exclude_localhost};
@ips = grep {!/inet (192\.168\.|10\.|172\.16\.|169\.254\.)/} @ips
if $p{exclude_internals};
# this keeps us from failing if the box has only internal IPs
view all matches for this distribution