NAME
Net::SixXS::TIC::Client - Tunnel Information and Control protocol client
SYNOPSIS
use Net::SixXS::TIC::Client;
my $tic = Net::SixXS::TIC::Client->new(username = 'me', password = 'none');
$tic->connect;
say for sort map $_->name, values %{$tic->tunnels};
DESCRIPTION
The Net::SixXS::TIC::Client
class provides an interface to the Tunnel Information and Control protocol used by SixXS to configure IPv6-over-IPv4 tunnels using the AYIYA (Anything-In-Anything) protocol. A Net:SixXS::TIC::Client
object takes care of connecting to the TIC server, authenticating using a challenge/response scheme, then retrieving information about the tunnels managed by the authenticated user account.
ATTRIBUTES
The operation of the Net::SixXS::TIC::Client
object is controlled by the following attributes:
username
-
The username of the account to authenticate with.
password
-
The password of the account to authenticate with.
server
-
The hostname or address of the TIC server to connect to; defaults to "tic.sixxs.net".
tic_socket
-
After the
connect()
method has been successfully invoked, this is the IO::Socket::INET object representing the connection to the TIC server. client_name
-
The text identifier of the TIC client; defaults to "Net-SixXS".
client_version
-
The text string representing the TIC client's version; defaults to the version of the
Net-SixXS
distribution. client_osname
-
The name of the operating system that the TIC client is running on; defaults to the system name and the release name separated by a slash, e.g. "FreeBSD/11.0-CURRENT".
diag
-
The Net::SixXS::Diag object to send diagnostic messages to; defaults to the one provided by the
diag()
function of the Net::SixXS class.Note that the
Net::SixXS::TIC::Client
object obtains the default value fordiag
when it is constructed; thus, a program would usually set theNet::SixXS:diag()
logger early, before creating any actual objects from theNet::SixXS
hierarchy.
METHODS
The Net::SixXS::TIC::Client
class defines the following methods:
- connect ()
-
Connects to the TIC server specified by the
server
attribute, issues a "client" command identifying the client using the values of theclient_name
,client_version
, andclient_osname
attributes, then authenticates using an MD5 challenge/response with theusername
andpassword
attributes. Dies if the connection cannot be established or the authentication fails. On success, setstic_socket
to the new connection. - disconnect ()
-
If
tic_socket
is set, breaks a previously established connection. - tunnels ()
-
Obtains a list of the short identifiers (e.g. "T22928") of the tunnels managed by the authenticated user account. Returns a reference to a hash with the tunnel identifiers as keys and a brief text representation of the tunnel information as values; detailed information is obtained by invoking the
tunnel_info()
method. - tunnel_info (tunnelid)
-
Obtains detailed information about the tunnel with the specified identifier and returns a Net::SixXS::Data::Tunnel object.
- tic_resp_parse (line)
-
Internal method; parse a text line received by the TIC server into a status code, a success flag, and a text message.
- tic_command (command)
-
Internal method; issues a command over the connection to the TIC server, reads a possibly multiline response, and dies if the TIC server does not return a success response.
- debug (message)
-
Internal method; sends the message to the object's
diag
logger if the latter is set.
SEE ALSO
Net::SixXS::Data::Tunnel, Net::SixXS::Diag, Net::SixXS::TIC::Server
LICENSE
Copyright (C) 2015 Peter Pentchev <roam@ringlet.net>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
Peter Pentchev <roam@ringlet.net>