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] Problems with regenerating lppe dissector

From: Pascal Quantin <pascal.quantin@xxxxxxxxx>
Date: Mon, 10 Sep 2012 16:26:26 +0200
2012/9/10 Pascal Quantin <pascal.quantin@xxxxxxxxx>
2012/9/10 Jakub Zawadzki <darkjames-ws@xxxxxxxxxxxx>
Hi,

I'm trying to regenerate packet-lppe.c from asn1/lppe using command:
  ../../tools/asn2wrs.py -p lppe -c ./lppe.cnf -s ./packet-lppe-template -D . -O ../../epan/dissectors LPPe.asn

Regenerated version doesn't compiles:

../../asn1/lppe/packet-lppe-fn.c:868:77: error: use of undeclared identifier 'dissect_LPP_PDU_Definitions_GNSS_ID_Bitmap'
  { &hf_lppe_gnssTimeReference, ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_LPP_PDU_Definitions_GNSS_ID_Bitmap },
../../asn1/lppe/packet-lppe-fn.c:1153:75: error: use of undeclared identifier 'dissect_LPP_PDU_Definitions_GNSS_ID'
  { &hf_lppe_gnss_ID        , ASN1_EXTENSION_ROOT    , ASN1_NOT_OPTIONAL, dissect_LPP_PDU_Definitions_GNSS_ID },
...

Looking at diff, I have lot of identifier renames, like:
-  { &hf_lppe_gnssTimeReference, ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_lpp_GNSS_ID_Bitmap },
+  { &hf_lppe_gnssTimeReference, ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_LPP_PDU_Definitions_GNSS_ID_Bitmap },
-  { &hf_lppe_ccpAssistanceSuppport, ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_lpp_GNSS_SignalIDs },
+  { &hf_lppe_ccpAssistanceSuppport, ASN1_EXTENSION_ROOT    , ASN1_OPTIONAL    , dissect_LPP_PDU_Definitions_GNSS_SignalIDs },
...

and hf types changes:
       { "eARFCN", "lppe.eARFCN",
-        FT_UINT32, BASE_DEC, NULL, 0,
+        FT_NONE, BASE_NONE, NULL, 0,
       { "dl-CarrierFreq", "lppe.dl_CarrierFreq",
-        FT_UINT32, BASE_DEC, NULL, 0,
+        FT_NONE, BASE_NONE, NULL, 0,
...

I really need to change only one line:

-static int dissect_OMA_LPPe_MessageExtension_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
+static int dissect_OMA_LPPe_MessageExtension_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {

So I'll commit only this line change, but it'd be great if someone could look at it.

Hi Jakub,

I'll take care of it later today (as I added both LPP and LPPe dissectors to the tree, I hope I will be able to figure out what's happening ;) ).

Regards,
Pascal.

Hi Jakub,

LPPe dissector has a dependency to LPP dissector. To generate it, you must first generate lpp-exp.cnf file. This is handled in the Makefile.common file found in asn1/lppe:

EXTRA_CNF = \
    $(builddir)/../lpp/lpp-exp.cnf

$(builddir)/../lpp/lpp-exp.cnf:
    (cd $(builddir)/../lpp && $(MAKE_CNF_EXPORT))

Using make instead of executing the asn2wrs.py script directly should allow you to generate the dissector without errors.

Regards,
Pascal.