DOCSIS::ConfigFile - Decodes and encodes DOCSIS config-files
0.5901
use DOCSIS::ConfigFile; use YAML; my $obj = DOCSIS::ConfigFile->new( shared_secret => '', # default advanced_output => 0, # default ); $obj->shared_secret("foobar"); my $encoded = $obj->encode([ {...}, {...}, ... ]); my $decoded = $obj->decode($filename); $obj->advanced_output(1); my $dec_adv = $obj->decode(\$encoded); print YAML::Dump($decoded); # see simple config in YAML format print YAML::Dump($dec_adv); # see advanced config in YAML format
Object constructor.
Arguments can be:
shared_secret => Shared secret in encoded cm config file advanced_output => Advanced decoded config format mibs => will set $ENV{MIBS} to load custom mibs log => Custom logger
Decodes a binary config-file. Needs only one of these arguments: Filehandle, path to file or reference to a binary string.
Returns an array-ref of hashes, containing the config as a perl data structure.
Encodes an array of hashes, containing the DOCSIS config-file settings. Takes only on argument: An array-ref of hashes.
Returns a binary string.
Sets or gets the shared secret.
Sets weither advanced output should be enabled. Takes 0 or 1 as argument. Advanced output is off (0) by default.
Retrieves the errors if encode() or decode() fails.
Returns DOCSIS::ConfigFile::Decode.
Returns DOCSIS::ConfigFile::Encode.
Returns DOCSIS::ConfigFile::Syminfo.
Jan Henning Thorsen, <pm at flodhest.net>
<pm at flodhest.net>
Please report any bugs or feature requests to bug-docsis-perl at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=DOCSIS-ConfigFile. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-docsis-perl at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc DOCSIS::ConfigFile
You can also look for information at http://search.cpan.org/dist/DOCSIS-ConfigFile
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Copyright (c) 2007 Jan Henning Thorsen
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
DOCSIS is a registered trademark of Cablelabs, http://www.cablelabs.com
This module got its inspiration from the program docsis, http://docsis.sf.net.
To install DOCSIS::ConfigFile, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DOCSIS::ConfigFile
CPAN shell
perl -MCPAN -e shell install DOCSIS::ConfigFile
For more information on module installation, please visit the detailed CPAN module installation guide.