Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Wireshark col_append_sep_str function

From: Graham Bloice <graham.bloice@xxxxxxxxxxxxx>
Date: Fri, 3 Apr 2020 10:28:57 +0100


On Fri, 3 Apr 2020 at 10:22, Peimann, Jannis <jannis.peimann@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Hi together,

 

I want to add information to the Info column for every frame in Wireshark.

This is working fine as long as I only have one PDU in my UDP package.

If I  have more than one PDU, then it overwrites the old Info column string. It is not appending.

 

This is my function:

if (pdu_description != NULL)

{           

col_append_sep_str(pinfo->cinfo, COL_INFO, ",", pdu_description);                        

g_print("Debug Message: frame number [%d] [%s]\n", pinfo->fd->num, pdu_description);/*Debug Console Message */

}

 

This col_append_sep_str function is from column-utils.c

For example the DEBUG Message is called twice, if I have two PDUs. This is working.

 

 

Right now I only have this:

PDU Protocol, Name2

But it should be:

PDU Protocol, Name1, Name2…

 

I think there is a problem with losing the old frame information, because it is writing again PDU Protocol.

Do you guys know what I’m missing?

 

Thanks for your help.

 

 

Mit freundlichen Grüßen/Best regards,

 

Jannis Peimann



Look for col_set_fence in README.dissector

--
Graham Bloice