NAME

Symantec::PCAnywhere::Profile::CHF - Encodes and decodes Symantec pcAnywhere connection profiles

SYNOPSIS

use Symantec::PCAnywhere::Profile::CHF;

# Load CHF file from file
my $chf = new Symantec::PCAnywhere::Profile::CHF(filename => $filename);

# Load CHF data directly
my $chf = new Symantec::PCAnywhere::Profile::CHF(data => $data);

my $results = $chf->get_attrs(
	Location,
	Password,
	Hostname,
	DataPort
);
while (my ($attr, $value) = each (%$results)) {
	print "$attr\t= $value\n";
}

# Create an empty CHF
my $chf = new Symantec::PCAnywhere::Profile::CHF;
$chf->set_attrs(
	PhoneNumber	=> 7652314,
	AreaCode	=> 999,
	IPAddress	=> '10.10.128.99',
	ControlPort	=> 5900
);

# Print the binary CHF file
print $chf->encode;

DESCRIPTION

This module is responsible for decoding of a pcAnywhere .CHF file that describes a remote system the client wishes to connect to. CHF files seem to always be the same size (3308 bytes), which is helpful for decoding.

See this module's base class for more information on the decoding mechanism.

EXPORT

None.

METHODS

Here is the public API; see this module's base class documentation for more information on the inner workings of the encoding and decoding process, as well as additional useful methods.

new

my $chf = new Symantec::PCAnywhere::Profile::CHF;
my $chf = new Symantec::PCAnywhere::Profile::CHF(-filename => $filename);
my $chf = new Symantec::PCAnywhere::Profile::CHF(filename => $filename);
my $chf = new Symantec::PCAnywhere::Profile::CHF(-data => $chfdata);
my $chf = new Symantec::PCAnywhere::Profile::CHF(data => $chfdata);

The "new" constructor takes any number of arguments and sets the appropriate flags internally before returning a new object. The arguments are considered as a list of key-value pairs which are inserted into the object data.

decode

$chf->decode;
$chf->decode($chfdata);

Decodes the currently-loaded data or new data passed in.

encode

$chf->encode;

Returns an encoded representation of the CHF file, constructed from the attributes previously set by set_attrs or existing from a constructor or load_from_file() call.

SEE ALSO

This module is based very heavily on the work of Stephen Friedl at http://www.unixwiz.net/tools/pcainfo.html.

TO DO

Very early in the file is a "description" field that we are not quite decoding properly.

The "hostname" and "IP Address" fields seem to be redundant, and this requires more research.

There are still plenty of big unused fields in the .CHF file, and we ought to find out what they are used for. Try looking at the other protocols (ISDN, SPX, NETBIOS, etc.)

Based on http://www.cpan.org/modules/00modlist.long.html#ID2_Guidelinesf, refactor code to pass references to lists instead of lists.

BUGS / CAVEATS

They're in there somewhere. Let me know what you find.

AUTHOR

Darren Kulp, <kulp@thekulp.com>, based on code from Stephen J. Friedl, (http://unixwiz.net/)

COPYRIGHT AND LICENSE

Copyright (C) 2006 by Darren Kulp

Contains code placed in the public domain 2002 by Stephen Friedl

"Symantec" and "pcAnywhere" are trademarks of Symantec Corp.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.