Ethereal-dev: [Ethereal-dev] Translating an arbitrary field to a string?

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Jason House <jhouse@xxxxxxxxx>
Date: Wed, 18 Jun 2003 13:10:56 -0400
I'm trying to figure out the best way to translate an arbitrary value of a filterable field to a string... Both raw format as well as a more understandable format... like tcp.port being both "80" and "http"

I found proto_item_fill_label()...
I'm not sure if that gives exactly what I'm looking for or not.

Items that I know give exactly what I want are almost exceptions to any general function:
  ip.proto uses ipprototostr()
  udp.port, udp.srcport, and udp.dstport use get_udp_port()
  tcp.port, tcp.srcport, and tcp.dstport use get_tcp_port()
  ...



Is any better way than checking a handful of known special cases and then defaulting to proto_item_fill_label?
If that is the best way, is there any way to find the special cases?