ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: [Wireshark-dev] address to string optimization

Date: Fri, 16 Jan 2015 09:04:07 -0500
A few weeks ago I stumbled across the following comment in address_to_str.c:
 
/*XXX FIXME the code below may be called very very frequently in the future.
  optimize it for speed and get rid of the slow sprintfs */
/* XXX - perhaps we should have individual address types register
   a table of routines to do operations such as address-to-name translation,
   address-to-string translation, and the like, and have this call them,
   and also have an address-to-string-with-a-name routine */
/* XXX - use this, and that future address-to-string-with-a-name routine,
   in "col_set_addr()"; it might also be useful to have address types
   export the names of the source and destination address fields, so
   that "col_set_addr()" need know nothing whatsoever about particular
   address types */
/* convert an address struct into a printable string */
 
 
This all sounded like a very good idea (mostly the removal of the sprintfs), but there was a lot of "prep" work involved to make "address registering" easier to create (the "to string" function were a bit scattered/haphazard).  I believe the "prep" work is now complete.  The problem I have is that I can't quite get my head around what's needed for "address registering".  I assume it would be modeled loosely after field type registration.
 
If the author of the comment is still around, I would gladly work with them to try to come up with address registering.  Mostly what I'm volunteering for is "filling out the tables" once a few address types have been figured out/added.  This also seems to be a preferred solution to the current USB addressing (compare) issues.
 
If anyone besides the author of the comment wants to work on this, feel free to contact me as well.