Wireshark-dev: Re: [Wireshark-dev] Problems to fill COL_INFO in a new dissector
Date: Fri, 13 Feb 2009 14:22:03 +0100
Thank you for this code snippet.
It helped me a lot to understand the way the code in the CNF is inserted in the generated code of the dissector.

Regards,
Xavier.

-----Message d'origine-----
De : wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] De la part de Anders Broman
Envoyé : vendredi 13 février 2009 14:12
À : Developer support list for Wireshark
Objet : Re: [Wireshark-dev] Problems to fill COL_INFO in a new dissector

Hi,
I'm still not sure what you are trying to do but here's a code snippet from the GSM MAP dissector:

This is the genertaed code:
--------- Snip ------
static int
dissect_gsm_old_GSMMAPOperationLocalvalue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 151 "gsmmap.cnf"

  offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
                                                &opcode);
 
  if (check_col(actx->pinfo->cinfo, COL_INFO)){
    col_append_str(actx->pinfo->cinfo, COL_INFO, gsm_map_opr_code(opcode));
    col_append_fstr(actx->pinfo->cinfo, COL_INFO, " ");
  }



  return offset;
}
--------- Snip ------
And the corresponding stuff in .cnf
#.FN_PARS  GSMMAPOperationLocalvalue

  VAL_PTR = &opcode

#.FN_BODY  GSMMAPOperationLocalvalue

%(DEFAULT_BODY)s
  if (check_col(actx->pinfo->cinfo, COL_INFO)){
    col_append_str(actx->pinfo->cinfo, COL_INFO, gsm_map_opr_code(opcode));
    col_append_fstr(actx->pinfo->cinfo, COL_INFO, " ");
  }

Regards
Anders
 

-----Original Message-----
From: wireshark-dev-bounces@xxxxxxxxxxxxx
[mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of xourciere.ext@xxxxxxxxxxxxxxxxxx
Sent: den 13 februari 2009 11:27
To: wireshark-dev@xxxxxxxxxxxxx
Subject: [Wireshark-dev] Problems to fill COL_INFO in a new dissector

Hi Anders,

I am not familiar with the CNF file, I used an almost empty one during my tests but I will try to have a deeper look at the advanced conf.

In the meantime I think that I can get the info I need directly from the generated "tree" filled by the dissector.

So is there some predefined funcs to read the tree items ?

Regards,
Xavier.
________________________________________________________________________
___
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
 
mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe