Ask Your Question
0

how to set 'destination' column to a string with lua plugin?

asked 2021-03-13 10:40:27 +0000

ranjeetsih gravatar image

updated 2021-03-13 10:42:21 +0000

I want to set 'destination' column to a string. I tried following but it did not help.

pinfo.cols.dst = "Hello"

Can it be done?

It works for 'info' column as follows:

pinfo.cols.info = "Hello"
edit retag flag offensive close merge delete

Comments

It should work -- I have a Lua plugin that does it successfully using exactly the code you posted.

Could you try to put together a smallest possible example of what doesn't work?

dd4235 gravatar imagedd4235 ( 2021-04-02 16:09:42 +0000 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-07-01 18:12:43 +0000

Chuckc gravatar image

I think this is a bug. You could open a Gitlab Issue asking that it be looked into. (please add a link back to this question if you do)

For testing, opening a non-IP file (small-system-misc-ping.etl (MS ETL) Various events, ping and browser packets.) from Wiki samples with etwdump allows the field to be set.

For an IP capture, disable the ethernet protocol and see Destination column updated by Lua.

edit flag offensive delete link more

Comments

I think this is caused by epan_dissect_fill_in_columns() which calls col_fill_in().
The Destination column is populated with pinfo.dst which contains the value set by the last dissector to touch it. The column then shows the highest level "destination" address in the protocol stack.

You can test in the Lua script by printing pinfo.cols.dst after changing it:

        pinfo.cols.dst:append("Hello")
        print("dst2=","(",pinfo.cols.dst,")")

It then gets walloped later by epan_dissect_fill_in_columns().

pinfo.dst is an Address object in Lua and there isn't a way to clear it or set it to a string.

Chuckc gravatar imageChuckc ( 2022-07-01 19:59:52 +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: 2021-03-13 10:40:27 +0000

Seen: 315 times

Last updated: Jul 01 '22