Wireshark-dev: [Wireshark-dev] Need help with dissector

From: Yan Burman <yanb@xxxxxxxxxxxx>
Date: Mon, 19 May 2014 13:50:44 +0000
Hi,

I am trying to write a dissector for iSER (iSCSI extenstions for RDMA).
I need to be able to at least do "decode as" iser for data in a certain connection.
I started by writing a simple skeleton based on wireshark documentation, and I see the plugin I compiled in the info page when starting wireshark.
The problem is that I do not see it in the "decode as" list. (I don't see iSCSI as well).
Please tell me what am I doing wrong (or at least point me at the relevant documentation for that?

My code is extremely simple at this point:

#include "config.h"

#include <epan/packet.h>

static int proto_iser = -1;

static void
dissect_iser(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "iSER");
    /* Clear out stuff in the info column */
    col_clear(pinfo->cinfo, COL_INFO);
}

void
proto_reg_handoff_iser(void)
{
    static dissector_handle_t iser_handle;

    iser_handle = create_dissector_handle(dissect_iser, proto_iser);
}

void
proto_register_iser(void)
{
    proto_iser = proto_register_protocol (
        "iSCSI Extensions for RDMA", /* name       */
        "iSER",      /* short name */
        "iser"       /* abbrev     */
        );
}


Thanks a lot,
Yan