Net::Analysis::Packet - wrapper for our own view of a packet.


NAME

Net::Analysis::Packet - wrapper for our own view of a packet.


SYNOPSIS

  use Net::Analysis::Packet qw(:pktslots :func);
  my $p = [...]; # See code in Net::Analysis::EventLoop
  pkt_init($p);
  my $packet_data = $p->[PKT_SLOT_DATA];
  print "My packet:-\n".pkt_as_string($p);
  print "Pretty hex dump of payload:-\n".pkt_as_string($p,'verbose');
  my $net_analysis_time = pkt_time($pkt);


DESCRIPTION

Internal module for abstracting the underlying packet representation.

It is just an array, not an object; there is no OO magic at all. You can use the following constants to exctract these fields from the array:

 PKT_SLOT_TO         - ip:port (e.g. "192.0.0.200:8080")
 PKT_SLOT_FROM       - ip:port (e.g. "10.0.0.1:13211")
 PKT_SLOT_FLAGS      - byte of TCP flags (see Net::Analysis::Constants)
 PKT_SLOT_DATA       - packet payload (may be empty)
 PKT_SLOT_SEQNUM     - the SEQ number of the packet
 PKT_SLOT_ACKNUM     - the ACK number of the packet
 PKT_SLOT_PKT_NUMBER - packets are numbered from zero as we read them in
 PKT_SLOT_SOCKETPAIR_KEY -  the unique key for the TCP session


FUNCTIONS

pkt_init ($p)

Does some setup on the bare data passed in; mostly creating a time object.

pkt_time ($p)

Returns the Net::Analysis::Time object associated with the packet.


SEE ALSO

the Net::Analysis manpage, the Net::Analysis::EventLoop manpage, the Net::Analysis::Time manpage, the Net::Analysis::Constants manpage.


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.

 Net::Analysis::Packet - wrapper for our own view of a packet.