NAME
    DOCSIS::ConfigFile - Decodes and encodes DOCSIS config-files for
    cable-modems

VERSION
    Version 0.1

SYNOPSIS
        use DOCSIS::ConfigFile;

        my $obj     = DOCSIS::ConfigFile->new(
                          filehandle => $glob,
                          read_file  => $filename,
                          binstring  => $data,

                          config        => $decoded,
                          shared_secret => '',
                      );
        my $decoded = $obj->decode;
        my $encoded = $obj->encode;
 
METHODS
  new
    Object constructor. Takes any of the arguments "decode" or "encode"
    takes.

  decode
    Decodes the config-file. Constructor needs only one of these arguments:

     * filehandle => reference to an open file.
     * read_file  => path to a file to read.
     * binstring  => a string containing the binary config.

    Returns:

     * On error: undef.
     * On success: an array of hashes containing the config.

  encode
    Encodes the config-file settings. Arguments to pass on to the
    constructor:

     * config        => array of hashes reference.
     * shared_secret => a string containing the shared secret to match in the
                        CMTS.

    Returns:

     * On error: undef
     * On success: a binary string

  log
    Returns a log-handler. Log::Log4perl by default.

  calculate_eod_and_pad
    Returns the EOD and padding for the config-file. Called automatically
    from inside encode().

  calculate_cm_mic
    Returns the CM MIC. Called automatically from inside encode().

  calculate_cmts_mic
    Returns the CMTS MIC. Called automatically from inside encode().

AUTHOR
    Jan Henning Thorsen, "<pm at flodhest.net>"

BUGS
    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.

SUPPORT
    You can find documentation for this module with the perldoc command.

        perldoc DOCSIS::ConfigFile

    You can also look for information at:

    * AnnoCPAN: Annotated CPAN documentation
        <http://annocpan.org/dist/DOCSIS-ConfigFile>

    * CPAN Ratings
        <http://cpanratings.perl.org/d/DOCSIS-ConfigFile>

    * RT: CPAN's request tracker
        <http://rt.cpan.org/NoAuth/Bugs.html?Dist=DOCSIS-ConfigFile>

    * Search CPAN
        <http://search.cpan.org/dist/DOCSIS-ConfigFile>

ACKNOWLEDGEMENTS
COPYRIGHT & LICENSE
    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.

