Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Packet parsing module in perl

by balakrishnan (Monk)
on Feb 27, 2009 at 03:00 UTC ( #746740=note: print w/replies, xml ) Need Help??


in reply to Re: Packet parsing module in perl
in thread Packet parsing module in perl

How do i can extract the packet arrival time from a packet?

Replies are listed 'Best First'.
Re^3: Packet parsing module in perl
by jettero (Monsignor) on Feb 27, 2009 at 12:07 UTC
    I don't think the actual packets have timestamps -- could be wrong -- but I know the libpcap files do contain them. I think your best bet (as mentioned above) is to use the Net::Pcap library to read the source file and get the timestamps from there. It seems it does have a pcap_open_offline method, which I don't know how to use, that probably reads the file in.

    How to get the actual timestamps from the packets:

    sub process_packet { my($user_data, $header, $packet) = @_; print "time: $header->{tv_sec}\n"; } # The header information is a reference to a hash containing the fol +lowing fields. # # * "len" - the total length of the packet. # * "caplen" - the actual captured length of the packet # * "tv_sec" - seconds value of the packet timestamp. # * "tv_usec" - microseconds value of the packet timestamp.

    -Paul

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://746740]
help
Chatterbox?
[Corion]: ambrus: Well, for mathematical notation, I find blackboard much more convenient than a computer. But when inserting text or moving text around, the computer wins obviously
[ambrus]: But either of these is a big problem in practice, so I'd need to spend like thirty years of my life to solve (a) and five more years to solve (b)
[ambrus]: Corion: yes, CURRENTLY the blackboard is more convenient
[ambrus]: and it's not like I want to ban blackboards anyway
[ambrus]: you already have blackboards and a canvas for projector or overhead transparencies (or positive film slide projector, not used for maths) canvas in the same lecture halls today, and switch in a few minutes between presentations,
[ambrus]: they're only difficult to use together.
[ambrus]: overhead transparencies are a nice convenience by the way that mix the two slides, because you can write them in advance and edit them during the presentation easily. but they're not very much in fasion these days.
[ambrus]: you can even print them.
[Discipulus]: ambrus i'm trying out MremoteNG which wrap putty and rdp and many other things..
[Corion]: ambrus: Yes, ideally you would have the ease of overhead projection transparencies and pens drawing on them, combined with the computer generated slide text...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (11)
As of 2017-09-26 10:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (293 votes). Check out past polls.

    Notices?