Net::Analysis::Packet - wrapper for our own view of a packet.
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);
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. "184.108.40.206: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
Does some setup on the bare data passed in; mostly creating a time object.
Returns the Net::Analysis::Time object associated with the packet.
Adam B. Worrall, <email@example.com>
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.