NAME

Convert::TLI - Encoding and decoding of TLI style strings TLI is Transport Layer Interface

subase/interfaces file:

    my_server
    master tli tcp /dev/tcp 0x0002333337f00001
    query tli tcp /dev/tcp 0x0002333337f00001

SYNOPSIS

        use Convert::TLI;
        my $tli = Convert::TLI->new();
        my ($ip, $port) = $tli->decode_tli('0x0002333337f00001');
        print "Server $ip @ $port";
        my $decoded =  $tli->encode_tli($ip,$port);
        print "Got encoded: $decoded";
  

DESCRIPTION

This module provides functions to convert strings to/from the TLI style encoding as described infocenter.sybase.com

FUNCTIONS

  • new

        my $encoded = Convert::TLI->new();
    
        Create Convert::TLI object.
        
        Possible options:
        C<prefix> and C<nulls> 
         It will be the prefix and suffix for encripted line only
         
         my $encoded = Convert::TLI->new( prefix=>'XXXX', nulls=>'000' );
         my $decoded =  $tli_decoded->encode_tli($ip,$port);
         print "Got encoded: $decoded";
         XXXX....000
  • encode_tli

        my $encoded = encode_tli("192.168.0.1", "3100");

    Encode a string of bytes into its TLI representation.

  • decode_tli

        my  ( $ip, $port ) = decode_tli("0x0002333337f00001");

    Decode a TLI string into a string of bytes.

  • detect_tli

        my $decoded = ( detect_tli("0x0002333337f00001") ) 
                        ? 'You have TLI style' 
                        : 'Regular IP style';

    Detect is string TLI styled

AUTHOR

Alex Mazur (aka NEONOX) <alex@emuwebmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2014 by Oleksandr Mazur

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