The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Acme::RFC4824 - Internet Protocol over Semaphore Flag Signaling System (SFSS)

VERSION

Version 0.01

SYNOPSIS

This module is used to help you implement RFC 4824 - The Transmission of IP Datagrams over the Semaphore Flag Signaling System (SFSS).

It can be used to convert IP datagrams to SFS frames and the other way round. Furthemore, it can be used to display an ASCII art representation of the SFS frame.

    use Acme::RFC4824;

    my $sfss = Acme::RFC4824->new();
    
    # get IP datagram from somewhere (for example Net::Pcap)
    # print a representation of the SFS frame
    print $sfss->encode({
        TYPE   => 'ASCII art',
        PACKET => $datagram, 
    });

    # get an ASCII representation of the SFS frame
    my $sfs_frame = $sfss->encode({
        TYPE   => 'ASCII',
        PACKET => $datagram,
    });

    # get an SFS frame from somewhere
    # (for example from someone signaling you)
    # get an IP datagram from the frame
    my $datagram = $sfss->decode({
        FRAME => $frame,
    });

EXPORT

As this module is supposed to be used in an object oriented fashion, it does not export anything.

FUNCTIONS

BUILD

see new()

new

Constructs a new object for you. Takes the following named parameters:

  • DEFAULT_FRAMESIZE (optional)

    The framesize in bytes that is used whenever the FRAMESIZE paramter is not given for encode. Defaults to 255 bytes (the maximum SFS frame size).

encode

Encodes an IP datagram into one or more SFS frames. Currently, fragmenting is not (yet) supported, so it will always encode into one frame (or complain that the IP packet is too large to encode into one frame).

Takes the following named parameters:

  • TYPE

    Determines the output format. Can either be 'ASCII' or 'ASCII art'. In the first case, a string representation of the SFS frame is returned. In the second case, an ASCII art representation is returned - as an array of ASCII art strings in list context or as the concatenation in scalar context.

  • PACKET

    The IP packet that you want to convert

  • CHECKSUM (optional)

    The checksum algorithm. Only 0 (no checksum) is implemented at the moment.

  • FRAMESIZE (optional)

    The optional maximal frame size of the SFS frame. Will later be used to fragment, currently only limits the size of the packet you can encode.

  • GZIP (optional)

    Not implemented yet, meant to support the gzipped frame variant of RFC 4824.

decode

Decodes one or more SFS frame into an IP datagram.

Takes the following named parameters:

  • FRAME

    An ASCII representation of the SFS frame which you would like to decode into an IP datagram.

ascii2art_map

Read-only accessor for the attribute with the same name. Returns a hash reference that maps SFS ASCII characters to an ASCII art representation of the given character. There is probably no need to use this from the outside.

default_framesize

Read-only accessor for the attribute with the same name. Returns the default SFS framesize. There is probably no need to use this from the outside.

meta

From Moose.pm: This is a method which provides access to the current class's meta-class. Only used internally.

AUTHOR

Alexander Klink, <alech at cpan.org>

BUGS

Please report any bugs or feature requests to bug-acme-rfc4824 at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Acme-RFC4824. 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 Acme::RFC4824

You can also look for information at:

ACKNOWLEDGEMENTS

Thanks to the RFC 4824 authors for letting me use their ASCII art in this module.

COPYRIGHT & LICENSE

Copyright 2007 Alexander Klink, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.