Ethereal-dev: [Ethereal-dev] How to I do when the same packet is in 3 dissectors?

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

From: didier <dgautheron@xxxxxxxx>
Date: Sat, 12 Oct 2002 15:50:14 +0000
Hi
With afp the packet FPGetSrvInfo is in afp, dsi, and asp dissectors. For now the code is duplicated :
in packet-dsi.c with  hf_dsi_server_flag_...
in packet-atalk.c with hf_asp_server_flag_...
and in packet-afp.c, err, no it's missing.
And it's a pain.
How can I fix it?
Preprocessor gimick hf_ # (dsi|asp|afp) # _server and
#include "var.h" where var.h
  static int hf_ # NAME # _server_flag = -1;
#include "fn.c" where fn.c
static gint
dissect_# NAME #_reply_get_status

#include "decl_re.h" in  hf_register_info... declaration
   { &hf_ # NAME # _server_flag_passwd,

Or use always the same variables eg afp_asp_server... and
#include "decl_re.h"
{ &hf_asp_server_flag_passwd,

Or ...
Insert the right thing to do.

Didier