Wireshark-bugs: [Wireshark-bugs] [Bug 8461] HPFEED dissector enhanced

Date: Sat, 23 Mar 2013 13:10:25 +0000

Comment # 14 on bug 8461 from
You can already do this with currently available routines, using the strstr
functions.

static const string_string chan_lookup_table[] = {
    { "dionaea.capture", GINT_TO_POINTER(CH_DIONAEA_CAPTURE) },
    { "dionaea.dcerpcrequests", GINT_TO_POINTER(CH_DIONAEA_DCE) },
    ....
    { "glastopf.events", GINT_TO_POINTER(CH_GLASTOPF_EVENTS) },
    { NULL, 0 }
};

static gint8 lookup_channel_string(char* str)
{
    gint idx;
    const gchar *match = match_strstr_idx(str, chan_lookup_table, &idx);

    if (idx >= 0)
        return GPOINTER_TO_INT(match);

    return CH_EINVAL;
}


You are receiving this mail because:
  • You are watching all bug changes.