Ethereal-dev: [Ethereal-dev] calling ICMP dissector

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

From: Ana Rodríguez <ana@xxxxxxxxxxxxxxx>
Date: Tue, 29 Apr 2003 13:46:11 +0200

Hi !!

I'm programming a DSR dissector and I have problems calling next dissector. The question is that I want to call ICMP protocol, because I have ICMP in the packet. The order I want it apears in the Ethereal tree is: Ethernet, IP, DSR and ICMP.
This is the code I made, and it doesn't work:

static dissector_handle_t icmp_handle;

next_tvb=tvb_new_subset(tvb,offset,-1,-1);
call_dissector(icmp_handle,next_tvb,pinfo,dsr_tree);

void proto_reg_handoff_dsr(void)
{
   dissector_handle_t dsr_handle;

   icmp_handle=find_dissector("icmp");

   dsr_handle = create_dissector_handle(dissect_dsr,proto_dsr);
   dissector_add("ip.proto", IP_PROTO_DSR, dsr_handle);
}

If I call 'data' or 'ip' instead of 'icmp' it works. So I supose the problem will be calling ICMP protocol. Could you help me?

Thanks in advanced.

Ana Rodriguez