This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

code understanding

0

what this code does. win which file the COL_INFO is defined. if (check_col(pinfo->cinfo, COL_INFO)) { col_add_fstr(pinfo->cinfo, COL_INFO, "%d > %d Info Type:[%s]", pinfo->srcport, pinfo->destport, val_to_str(type, packettypenames, "Unknown Type:0x%02x")); }

asked 07 Jun '11, 01:56

sagu072's gravatar image

sagu072
35232428
accept rate: 0%


One Answer:

1

In which file the COL_INFO is defined

That's what your search function is for.

The code itself is meant to fill the Information column in the packet list of the Wireshark window and Tshark output.

The call to check_col() is deprecated, but can be used to see if the column is visible. The call to col_add_fstr() is to set the text.

answered 07 Jun '11, 02:01

Jaap's gravatar image

Jaap ♦
11.7k16101
accept rate: 14%