Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To customize the GVCP dissector would require modifying the "C" code.
Since these are "custom GEV commands", it might not benefit others so would be a private branch you would have to maintain.

With lua, you can get in front of the GVCP dissector with lua code, add to the tree, then call() the standard dissector. See the fpm.lua and guacamole.lua on the Wiki page - Contrib.

Or you can run as a post-dissector against all packets and only update the ones that meet your criteria:
How can I write a dissector for a part of the LLDP payload in Lua ?

To customize the GVCP dissector would require modifying the "C" code.
Since these are "custom GEV commands", it might not benefit others so would be a private branch you would have to maintain.

With lua, you can get in front of the GVCP dissector with lua code, add to the tree, then call() the standard dissector. See the fpm.lua and guacamole.lua on the Wiki page - Contrib.

Or you can run as a post-dissector against all packets and only update the ones that meet your criteria:
How can I write a dissector for a part of the LLDP payload in Lua ?

The commands are hard coded in packet-gvcp.c:

/*
Command and acknowledge IDs
*/

#define GVCP_DISCOVERY_CMD (0x0002)
...

static const value_string commandnames[] = {
    { GVCP_DISCOVERY_CMD, "DISCOVERY_CMD" },
...

    /* Is this a command message? */
    if (key_code == 0x42)
    {
        command = tvb_get_ntohs(tvb, offset+2);
        command_string = val_to_str(command, commandnames,"Unknown Command (0x%x)");

To customize the GVCP dissector would require modifying the "C" code.
Since these are "custom GEV commands", it might not benefit others so would be a private branch you would have to maintain.

With lua, you can get in front of the GVCP dissector with lua code, add to the tree, then call() the standard dissector. See the fpm.lua and guacamole.lua on the Wiki page - Contrib.

Or you can run as a post-dissector against all packets and only update the ones that meet your criteria:
How can I write a dissector for a part of the LLDP payload in Lua ?

Notes: The commands are hard coded in packet-gvcp.c:

/*
Command and acknowledge IDs
*/

#define GVCP_DISCOVERY_CMD (0x0002)
...

static const value_string commandnames[] = {
    { GVCP_DISCOVERY_CMD, "DISCOVERY_CMD" },
...

    /* Is this a command message? */
    if (key_code == 0x42)
    {
        command = tvb_get_ntohs(tvb, offset+2);
        command_string = val_to_str(command, commandnames,"Unknown Command (0x%x)");