First time here? Check out the FAQ!

Ask Your Question
0

Customize GVCP dissector for custom command

asked Mar 17 '3

GiovaBx gravatar image

updated Mar 17 '3

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

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered Mar 17 '3

Chuckc gravatar image

updated Mar 17 '3

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

Preview: (hide)
link

Comments

Thanks I will check your suggestion

GiovaBx gravatar imageGiovaBx ( Mar 17 '3 )

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: Mar 17 '3

Seen: 1,821 times

Last updated: Mar 17 '23