Net-SCTP
view release on metacpan or search on metacpan
lib/Net/SCTP.pm view on Meta::CPAN
$ERRNO = 109;
return 0;
}
# Does the IP address finish with : ?
if ($ip =~ m/[^:]:$/)
{
$ERROR = "Invalid address $ip (ends with :)";
$ERRNO = 110;
return 0;
}
# Does the IP address have more than one '::' pattern ?
if ($ip =~ s/:(?=:)/:/g > 1)
{
$ERROR = "Invalid address $ip (More than one :: pattern)";
$ERRNO = 111;
return 0;
}
# number of octets
if ($n != 7 && $ip !~ /::/)
{
$ERROR = "Invalid number of octets $ip";
$ERRNO = 112;
return 0;
}
# valid IPv6 address
return 1;
}
#\End Subroutine : ip_is_ipv6
##-----------------------------------------------------------------------------
###############################################################################
# END OF CREDIT! #
###############################################################################
1;
__END__
=head1 NAME
Net::SCTP - A Stream Control Transmission Protocol(SCTP) module for Perl
=head1 USE
use Net::SCTP;
=head1 REQUIRED INSTALL
lksctp-tools
lksctp-tools-devel
=head1 DESCRIPTION
An SCTP (Stream Control Transport Protocol) module created for Perl using XS
with the Net extension because it is a net module.
SCTP is a streaming protocol of things like UDP and TCP. It is used in new
technologies like LTE for phones. It streams data from multiple or one source
to multiple or one source. If one connection is lost the data is not lost because
it will continue to buffer until it gets the connection back and gets the rest of
the message. It is also backwards compatible with TCP.
We used the draft 11 of the SCTP architecture for this module. A link is
listed in the SEE ALSO section.
Tested on CentOS 5.2 with an i686 architecture using
lksctp-tools-1.0.6-1.el5.1.i386 with IPv4.
This module has not been tested with IPv6, although the features are available.
=head2 CURRENT STATE
=over 4
Currently setsockopt is not fully working and has not been implemented.
getsockopt is not implemented. sctp_peeloff has not been tested.
Finally we have no support for sctp_opt_info. Eventually all of these will
be supported, but for now you should be able to work without them.
Currently send(), recv(), sendto(), recvfrom(),
read(), write(), and sctp_send() are not supported; however,
may eventually be supported.
sctp_sendmsg & sctp_recvmsg do not currently support the
use of parameters other than what you need to get them working.
=back
=head2 UNSUPPORTED
=over 4
Although there may be some code for the following functions they
have not been tested. Furthermore they were not supported in our
version of lksctp-tools so we had no way to implement them.
Functions:
sctp_send, sctp_sendx, sctp_sendv, sctp_recvv
=back
=head1 SAMPLE CODE
=head2 SERVER EXAMPLE
=over 4
A server example can be seen in the directory with the program.
One is also included here for good measure but the one in the
directory is more extensive and has comments.
use Net::SCTP;
my $port = 5556;
my $message = 'I am the Server!!';
my $listen = 1;
my $many = 1;
( run in 0.611 second using v1.01-cache-2.11-cpan-39bf76dae61 )