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
lib/Net/Server/Proto.pm view on Meta::CPAN
}
sub _bindv6only {
my $class = shift;
my $val = $class->_sysctl('net.ipv6.bindv6only'); # linux
$val = $class->_sysctl('net.inet6.ip6.v6only') if ! length($val); # bsd
return $val;
}
sub _sysctl {
my ($class, $key) = @_;
lib/Net/Server/Proto.pm view on Meta::CPAN
A socket protocol family PF_INET or PF_INET6 is derived from a specified
address family of the binding address. A PF_INET socket can only accept
IPv4 connections. A PF_INET6 socket accepts IPv6 connections, but may also
accept IPv4 connections, depending on OS and its settings. For example,
on FreeBSD systems setting a sysctl net.inet6.ip6.v6only to 0 will allow
IPv4 connections to a PF_INET6 socket. By default on linux, binding to
host [::] will accept IPv4 or IPv6 connections.
The Net::Server::Proto::object method returns a list of objects corresponding
to created sockets. For Unix and INET sockets the list typically contains
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
view release on metacpan or search on metacpan
exercises/compile-tcsh/tcsh-6.10.00/Fixes view on Meta::CPAN
31. V6.09.02 - 20000704
30. lots more completions (George Cox)
29. change FILSIZ to BUFSIZE [now that BUFSIZE >> MAXPATHLEN] and
avoid a potential buffer overflow in sh.dir.c (Volker Schmidt)
28. _MINIX_VMD port (Martijn van Buul)
27. inet6 handling for remotehost and configure (Hajimu UMEMOTO)
26. aix-4 does not need gethostname (Darren Reed)
25. IBM OS/390 Unix Systems Services support (Peter Prymmer)
24. Fix prompt formatting (Andrey A. Chernov)
23. Use HostType from Imakefile correctly (Kjetil Torgrim Homme)
22. Handle long and expanded history lines better (Boleslaw Ciesielski)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Rex/Hardware/Network/Solaris.pm view on Meta::CPAN
}
sub netstat {
my @ret;
my @netstat = i_run "netstat -na -f inet -f inet6", fail_ok => 1;
if ( $? != 0 ) {
die("Error running netstat");
}
my ( $proto, $udp_v4, $udp_v6, $tcp_v4, $tcp_v6, $sctp );
view all matches for this distribution
view release on metacpan or search on metacpan
=item setconn CONNECTION_INFO
Sets the connection information string for the filter. The format of this
string is identical to that found in the Milter documentation. Some examples
are C<local:/var/run/f1.sock>, C<inet6:999@localhost>, C<inet:3333@localhost>.
This function returns nonzero upon success, the undefined value otherwise.
=item auto_setconn NAME [, SENDMAIL_CF_FILENAME]
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Sendmail/PMilter.pm view on Meta::CPAN
An IPv4 socket, bound to address HOST (default INADDR_ANY), on port PORT.
It is not recommended to open milter engines to the world, so the @HOST part
should be specified.
=item inet6:PORT[@HOST]
An IPv6 socket, bound to address HOST (default INADDR_ANY), on port PORT.
This requires IPv6 support and the Perl IO::Socket::IP package to be installed.
It is not recommended to open milter engines to the world, so the @HOST part
SHOULD be specified.
lib/Sendmail/PMilter.pm view on Meta::CPAN
ReuseAddr => 1,
Listen => $backlog,
LocalPort => $2,
LocalAddr => $3
);
} elsif ($1 eq 'inet6') {
require IO::Socket::IP;
$socket = IO::Socket::IP->new(
Proto => 'tcp',
ReuseAddr => 1,
view all matches for this distribution
view release on metacpan or search on metacpan
examples/inet6_nonblocking.pl view on Meta::CPAN
our $RUNNING : shared = 1;
$o = select STDOUT; $| = 1; select $o;
$server = Socket::Class->new(
'domain' => 'inet6',
'local_addr' => '::1',
'listen' => 5,
'blocking' => 0,
) or die Socket::Class->error;
threads->create( \&server_thread, $server );
$client = Socket::Class->new(
'domain' => 'inet6',
'remote_addr' => '::1',
'remote_port' => $server->local_port,
'blocking' => 0,
) or die Socket::Class->error;
view all matches for this distribution