Adam Worrall > Net-Analysis-0.41 > Net::Analysis::TCPSession

Download:
Net-Analysis-0.41.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  2
View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Net::Analysis::TCPSession - represent a TCP session (with two endpoints)

SYNOPSIS ^

  use Net::Analysis::TCPSession qw(:const);

  my $sesh = Net::Analysis::TCPSession->new ();

  foreach my $pkt (@packets) {
    my $ret = $sesh->process_packet ($pkt);
    ($ret) || die "broken session: ".$sesh->errstr();
    print " >> $sesh <<\n";

    if      ($ret == PKT_ESTABLISHED_SESSION) {
      print "new session established\n";

    } elsif ($ret == PKT_TERMINATED_SESSION) {
      print "session torn down\n";

    } elsif ($ret == PKT_FLIPPED_DIR) {
      print "monologue generated\n----\n".$sesh->previous_monologue();
    }
  }

  if ($sesh->has_current_monologue()) {
    print "final monologue\n----\n".$sesh->current_monologue();
  }

DESCRIPTION ^

Processes a packet in the context of an existing TCP session. This is the module that does the bulk of the stream management; SYNs, ACKs, dropping duplicates and storing out-of-sequence packets.

A packet, once placed in order, is considered to do just one of four things:

EXPORT

None by default.

SEE ALSO ^

AUTHOR ^

Adam B. Worrall, <worrall@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright (C) 2004 by Adam B. Worrall

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

syntax highlighting: