NAME

Net::Canopy::BAM - Identifies, assembles, and disassembles Canopy BAM packets.

SYNOPSIS

  use Net::Canopy::BAM;

DESCRIPTION

Common Packet Assembly, Disassembly, and Identification for the JungleAuth (http://code.google.com/p/jungleauth/) implementation of Canopy BAM.

Also provides a BAM test client.

METHODS

new

        my $ncb = Net::Canopy::BAM->new();
        

Instantiates Net::Canopy::BAM.

buildQstr

        my $QoSstr = $ncb->buildQstr(
                upspeed => 512,         # Upload speed in Kbps
                downspeed => 1024,      # Download speed in Kbps
                upbucket => 320000,   # Upload bucket size in Kb
                downbucket => 5120000 # Download bucket size in Kb
        );
        

Builds a QoS string.

parseQstr

        my $QoShash = $ncb->parseQstr(qstr => $qosstring);

Reads a QoS string and returns its component values as a hashref

idPacket

        my $packetID = $ncb->idPacket(packet => $packet);
        

Returns the type of BAM packet.

mkAcceptPacket

        my $packet = $ncb->mkAcceptPacket(
                seq => $sequenceNumber.
                mac => $smMAC,
                qos => $QoSstr
        );
        

Returns a authentication acceptance packet

mkRejectPacket

        my $packet = $ncb->mkRejectPacket(
                seq => $sequenceNumber,
                mac => $smMAC
        );

Returns a rejection response packet.

parsePacket

        my $parsedPacket = $ncb->parsePacket(packet => $packet);

Identify packet and parse out data. Returns packet type and data as hashref

SEE ALSO

Canopy BAM User Guide, Issue 4/BAM 1.1

See http://code.google.com/p/jungleauth/ for wiki, bug reports, svn, etc.

AUTHOR

Jonathan Auer, <jda@tapodi.net>

COPYRIGHT AND LICENSE

  Copyright (C) 2008 by Jonathan Auer

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.