You have no idea how much this has helped me. Thank you so much for spreading your wisdom to a perl newbie. One more thing, the $header variable in this case is a reference to a hash?? I believe that it contians references to packet recv time, len, etc. How can I view that information??
sub process_rtp_packets { my ($user_data, $header, $packet) = @_; for my $key ( keys %header ) { my $value = $header{$key}; print "$key => $value\n"; } my $eth_obj = NetPacket::Ethernet->decode($packet); my $ether_data = NetPacket::Ethernet::strip($packet); my $ip_obj = NetPacket::IP->decode($ether_data); my $ip_data = NetPacket::IP::strip($ether_data); my $udp_obj = NetPacket::UDP->decode($ip_data); my $RTP_data = $udp_obj->{data}; my( $bits, $type, $seq, $time )= unpack "C C n N", $RTP_data; print "$bits\n"; print "$type\n"; print "$seq\n"; print "$time\n"; }

In reply to Re^2: Binary conversion, RTP header (unpack) by adamtistler
in thread Binary conversion, RTP header by atistler

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.