Ask Your Question
0

Customize GVCP dissector for custom command

asked 2023-03-17 10:38:17 +0000

GiovaBx gravatar image

updated 2023-03-17 10:39:13 +0000

Hi all,

i'd like to extend the standard GVCP to parse our custom GEV commads, i.e. every command with ID over 0x8000 is device specific and then the standard GVCP dissector is not able to parse them correctly and just said "Unknown command".

Unfortunately I can't find a way to do that.

The GVCP always wins and I can't parse my custom messages with my custom lua script

Is there a standard way to customize a dissector?

Any suggestion or useful reading?

Thanks in advance

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-03-17 13:35:26 +0000

Chuckc gravatar image

updated 2023-03-17 13:42:14 +0000

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)");

edit flag offensive delete link more

Comments

Thanks I will check your suggestion

GiovaBx gravatar imageGiovaBx ( 2023-03-17 14:42:06 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2023-03-17 10:38:17 +0000

Seen: 1,797 times

Last updated: Mar 17 '23