view release on metacpan or search on metacpan
libpatricia/patricia.c view on Meta::CPAN
view all matches for this distribution
296297298299300301302303304305306#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 release on metacpan or search on metacpan
lib/Net/Routing.pm view on Meta::CPAN
view all matches for this distribution
28293031323334353637our
$Error
;
view release on metacpan or search on metacpan
424344454647484950515253545556575859606162636465666768697071727374##-----------------------------------------------------------------------------
#/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,
out the error to the user because
// Perl cannot
do
it.
if
( RETVAL < 0 )
90919293949596979899100101102103104105106107# 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;
112113114115116117118119120121122// 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
382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417# 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);
483484485486487488489490491492493494495496497498499500501502503504505506507#
# 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 )
{
547548549550551552553554555556557558559560561562563564565566567568569570# 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)
{
602603604605606607608609610611612613614615616617618619620621622623624625626627# 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)
{
689690691692693694695696697698699700701702703704705706707708709710711712713714715# 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)
{
719720721722723724725726727728729
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 )
{
744745746747748749750751752753754755756757758759760761762763764765766767768769770# 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)
{
774775776777778779780781782783784
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 )
view all matches for this distribution
798799800801802803804805806807808809810811812813814815816817818819# 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 release on metacpan or search on metacpan
docs/ssh-broker-config.txt view on Meta::CPAN
view all matches for this distribution
1024102510261027102810291030103110321033
· 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 release on metacpan or search on metacpan
lib/Net/Server/Proto.pm view on Meta::CPAN
163164165166167168169170171172173}
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
view all matches for this distribution
470471472473474475476477478479480A
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 release on metacpan or search on metacpan
678910111213141516clib/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
view all matches for this distribution
29303132333435363738src/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 release on metacpan or search on metacpan
lib/Net/Telnet.pm view on Meta::CPAN
41424344454647484950}
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
view all matches for this distribution
274027412742274327442745274627472748274927502751275227532754275527562757
! $@;
}
# 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 release on metacpan or search on metacpan
lib/Net/Telnet.pm view on Meta::CPAN
41424344454647484950}
else
{
# perl version < 5.004
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
view all matches for this distribution
272927302731273227332734273527362737273827392740274127422743274427452746
! $@;
}
# 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 release on metacpan or search on metacpan
Traceroute6.pm view on Meta::CPAN
119120121122123124125126127128129#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
351352353354355356357358359360361
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
view all matches for this distribution
470471472473474475476477478479480OSNAMESW: {
# 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 release on metacpan or search on metacpan
lib/Net/Whois/IANA.pm view on Meta::CPAN
3536373839404142434445@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
324325326327328329330331332333334335336337338339
|| (
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
369370371372373374375376377378379next
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
396397398399400401402403404405406407408409410
|| (
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
view all matches for this distribution
547548549550551552553554555556557558559560561562563
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 release on metacpan or search on metacpan
lib/Net/Whois/Generic.pm view on Meta::CPAN
view all matches for this distribution
602603604605606607608609610611612=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 release on metacpan or search on metacpan
lib/Net/Write/Layer.pm view on Meta::CPAN
7980818283848586878889
$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
{
Socket->
import
(
qw(AF_INET6)
);
lib/Net/Write/Layer.pm view on Meta::CPAN
view all matches for this distribution
237238239240241242243244245246247
_setIpProtoIpConstant();
_setIpProtoIpv6Constant();
_setIpProtoRawConstant();
_setIpHdrInclConstant();
_setAfinet6Constant();
_setInetPtonSub();
_setGetaddrinfoSub();
}
no
strict
'vars'
;
view release on metacpan or search on metacpan
Lite/MANIFEST view on Meta::CPAN
view all matches for this distribution
919293949596979899100101Util/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 release on metacpan or search on metacpan
lib/NetInfoExtractor/Interface.pm view on Meta::CPAN
view all matches for this distribution
93949596979899100101102103
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 release on metacpan or search on metacpan
src/core/ngx_inet.c view on Meta::CPAN
910111213141516171819#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
58596061626364656667#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
218219220221222223224225226227228if
(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
272273274275276277278279280281282
- 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
285286287288289290291292293294#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
391392393394395396397398399400401
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
487488489490491492493494495496497
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
535536537538539540541542543544
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
816817818819820821822823824825826
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
view all matches for this distribution
892893894895896897898899900901902}
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 release on metacpan or search on metacpan
lib/OSLV/Monitor/Backends/FreeBSD.pm view on Meta::CPAN
view all matches for this distribution
208209210211212213214215216217218219220221my
$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 release on metacpan or search on metacpan
lib/POE/Wheel/SocketFactory.pm view on Meta::CPAN
view all matches for this distribution
93949596979899100101102103# 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 release on metacpan or search on metacpan
t/43_network.t view on Meta::CPAN
1718192021222324252627my
$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
view all matches for this distribution
303132333435363738394041424344454647my
$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 release on metacpan or search on metacpan
share/ip-samples/addr-show-old-eth.txt view on Meta::CPAN
view all matches for this distribution
1234567891011121: 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 release on metacpan or search on metacpan
t/scan/heredoc.t view on Meta::CPAN
454455456457458459460461462463464465
$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
view all matches for this distribution
480481482483484485486487488489490491
$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 release on metacpan or search on metacpan
local/lib/perl5/IO/Socket/SSL.pm view on Meta::CPAN
view all matches for this distribution
545546547548549550551552553554555556557558559560561562563564565566
}
}
# 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 release on metacpan or search on metacpan
lib/Protocol/CassandraCQL/Frame.pm view on Meta::CPAN
242243244245246247248249250251252253254255256257258=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
view all matches for this distribution
260261262263264265266267268269270271272sub
_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 release on metacpan or search on metacpan
lib/Provision/Unix/Utility.pm view on Meta::CPAN
view all matches for this distribution
915916917918919920921922923924925
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 release on metacpan or search on metacpan
exercises/compile-tcsh/tcsh-6.10.00/Fixes view on Meta::CPAN
view all matches for this distribution
323334353637383940414231. 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 release on metacpan or search on metacpan
lib/Rex/Hardware/Network/Solaris.pm view on Meta::CPAN
view all matches for this distribution
122123124125126127128129130131132}
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 release on metacpan or search on metacpan
view all matches for this distribution
307308309310311312313314315316317=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 release on metacpan or search on metacpan
lib/Sendmail/PMilter.pm view on Meta::CPAN
466467468469470471472473474475476An 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
view all matches for this distribution
545546547548549550551552553554555
ReuseAddr
=> 1,
Listen
=>
$backlog
,
LocalPort
=> $2,
LocalAddr
=> $3
);
}
elsif
($1 eq
'inet6'
) {
$socket
= IO::Socket::IP->new(
Proto
=>
'tcp'
,
ReuseAddr
=> 1,
view release on metacpan or search on metacpan
examples/inet6_nonblocking.pl view on Meta::CPAN
view all matches for this distribution
15161718192021222324252627282930313233our
$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;