Wireshark-dev: [Wireshark-dev] Question in wireshark plugin development, how to solve the confi

From: "li yang" <bitliyang@xxxxxxxxx>
Date: Mon, 14 May 2007 10:18:08 +0800
Our protocol is based on UDP broadcast, some bytes in the data packet
indicate the type of protocol. And data is sending with random port.

In my implementation,we using
heur_dissector_add("udp",dissect_XXX_heur,proto_XXX); to filter all
UDP packet
and code like followed:
static gboolean dissect_xxx_heur(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree)
{
    guint8 packet_type = 0;
    packet_type       = tvb_get_guint8(tvb, 0);
    if( packet_type != 0x01 && packet_type != 0x02 ) {
         return FALSE;
    else{
        dissect_xxx(tvb,pinfo,tree);
        return TRUE;
    }
}

But I found if we use the port (already registered by other protocol)
in our protocol,the data can not be parsed correctly.
eg,if we send the data in port 4000, it will confict with ICQ.That's
to say, the data will be parsed as ICQ data not our portocol. :(

You know, our protocol using random port to send data. Do you have any
solution on that?

Thanks in advance!