Ask Your Question
0

how to change COL_PROTOCOL with lua code

asked 2017-12-13 01:53:41 +0000

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

With C code, in the code sample, I guess:

Location at the WSDG 9.3. Dissection the code is

 col_set_str(pinfo->cinfo, COL_PROTOCOL, "FOO");

It will change the the content of PROTOCOL in the Wireshark, my question is, how to do the same thing with lua code.

i can see it in the same doc:

11.5.5.9. pinfo.curr_proto

It should be the VAR for changing it. But, how to use the "pinfo.curr_proto" to change protocol in column of main display pane with lua.

Thanks in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-12-13 11:00:51 +0000

grahamb gravatar image

I've used this:

pinfo.cols['protocol'] = "FOO"

which doesn't seem to be documented anywhere.

edit flag offensive delete link more

Comments

Thank you very much, it works very well.

With the following code, I also change the column of source and destination.

pktinfo.cols['src'] = "FOO_Source"

pktinfo.cols['dst'] = "FOO_destination"

Thank you again!

qutefu gravatar imagequtefu ( 2017-12-15 00:36:42 +0000 )edit

If an answer has solved your issue, for the future benefit of others, please accept the answer by clicking the Checkmark icon by the answer.

grahamb gravatar imagegrahamb ( 2017-12-15 10:34:33 +0000 )edit

You can also use pinfo.cols.protocol, pinfo.cols.info, etc. for changing the columns.

Stig gravatar imageStig ( 2017-12-15 13:28:43 +0000 )edit

Hi Stig, I also try your way, it is working fine. Thanks!

qutefu gravatar imagequtefu ( 2017-12-15 16:45:28 +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: 2017-12-13 01:53:41 +0000

Seen: 797 times

Last updated: Dec 13 '17