Wireshark

  • Riverbed Technology
  • WinPcap
the world's foremost network protocol analyzer
  • Wireshark
    • About
    • Download
    • Blog
  • Get Help
    • Ask a Question
    • FAQs
    • Documentation
    • Mailing Lists
    • Online Tools
    • Wiki
    • Bug Tracker
  • Develop
    • Get Involved
    • Developer's Guide
    • Browse the Code
    • Latest Builds

Wireshark-dev: Re: [Wireshark-dev] about udp dissector

Date Index Thread Index Other Months All Mailing Lists
Date Prev Date Next Thread Prev Thread Next


From: "ronnie sahlberg" <ronniesahlberg@xxxxxxxxx>
Date: Fri, 2 Feb 2007 08:50:57 +0000

It was a technique we used previously to rotate between different
buffers without having to use g_malloc/g_free buffers.
Since there might be multiple UDP layers within one and the same
packet (UDP over UDP) we used this as a cheap method to make sure that
two or more consecutive calls to the UDP dissector would use different
buffers.

I have changed the udp dissector now to use the "modern" way to manage
short lived buffers that need not be explicitely freed using
ep_alloc() instead.





On 2/2/07, Vladimir Zherdenovsky <Vladimir.Zherdenovsky@xxxxxxxxxxxxxx> wrote:
Hello,



I just want to understand how the udp dissector works and have
misunderstanding of following codes lines:



  static e_udphdr udphstruct[4], *udph;
  static int udph_count=0;

  udph_count++;
  if(udph_count>=4){
     udph_count=0;
  }
  udph=&udphstruct[udph_count];



Could anybody explain why 4 and how it works?

Thanks,

vladimir





  • References:
    • [Wireshark-dev] about udp dissector
      • From: Vladimir Zherdenovsky
  • Prev by Date: [Wireshark-dev] about udp dissector
  • Next by Date: [Wireshark-dev] protocol decoding module
  • Previous by thread: [Wireshark-dev] about udp dissector
  • Next by thread: [Wireshark-dev] protocol decoding module
  • Index(es):
    • Date
    • Thread

Wireshark and the "fin" logo are registered trademarks of the Wireshark Foundation