Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

hello monks, I have a cap file which contains bunch of udp files using perl(but no modules, no pcap or any other modules) and want to just deal in lowlevel. But(and this might not be a perl question but since there are so many all around programmars here) what i cannot figure out is, when i open the cap file, how to tell where one udp packet starts and where it ends..(i am trying to just count bytes but not sure where to stop counting)..

Replies are listed 'Best First'.
Re: opening udp file
by moritz (Cardinal) on Nov 17, 2009 at 18:44 UTC

    I could imagine that reading the pcap file format description and reading the files according tot the headers might help.

    Perl 6 - links to (nearly) everything that is Perl 6.
Re: opening udp file
by dHarry (Abbot) on Nov 18, 2009 at 11:02 UTC

    Maybe RFC768 - User Datagram Protocol can be of use to you. Are you sure you want to do this manually?!. I wonder why you insist on not using modules. I mean you can always "borrow" code if for some reason/restriction you cannot install a module;)

    Cheers,

    Harry