Wireshark-dev: Re: [Wireshark-dev] ASN2WRS does not create PDU (which is specified in .cnf file

From: "Kukosa, Tomas" <tomas.kukosa@xxxxxxxxx>
Date: Tue, 16 Sep 2014 09:46:16 +0000

Hi,

 

I do not know your ASN.1 source but looking to ETSI repository it shows that neither CAM.asn nor ITS-Container.asn contains any MESSAGE type assignment.

It seems that top level type is the CAM and it should be used as PDU type.

 

Regards,

  Tomas

 

From: wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of Christina Obermaier
Sent: Tuesday, September 16, 2014 11:27
To: Pascal Quantin; Developer support list for Wireshark
Subject: Re: [Wireshark-dev] ASN2WRS does not create PDU (which is specified in .cnf file)

 

Thanks for your help, but the problem still exisits.

I tried to change the code like you told:

 

Part of my packet-toyasn1-template.c:

 

#include "packet-toyasn1-fn.c"
static void
dissect_toyasn1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)

{
    proto_item      *toyasn1_item = NULL;
    proto_tree      *toyasn1_tree = NULL;

    /* make entry in the Protocol column on summary display */
    col_set_str(pinfo->cinfo, COL_PROTOCOL, PNAME);

    /* create the toyasn1 protocol tree */
    if (tree) {
        toyasn1_item = proto_tree_add_item(tree, proto_toyasn1, tvb, 0, -1, FALSE);
        toyasn1_tree = proto_item_add_subtree(toyasn1_item, ett_toyasn1);
        dissect_MESSAGE_PDU(tvb, pinfo, toyasn1_tree);
    }
}

 

part of my toyasn1.cnf:

# toyasn1.cnf
# TOYASN1 conformation file
# $Id$
#.MODULE_IMPORT
#.EXPORTS
#.PDU
MESSAGE

#.NO_EMIT
#.TYPE_RENAME
#.FIELD_RENAME
#.END

 

 

The error still exists:

Couldn't load module /home/obermaierc/Schreibtisch/wireshark-1.12.0/plugins/toyasn1/.libs/toyasn1.so: /home/obermaierc/Schreibtisch/wireshark-1.12.0/plugins/toyasn1/.libs/toyasn1.so: undefined symbol: dissect_MESSAGE_PDU

 

 

I dont know where the error comes from.

 

 

Pascal Quantin <pascal.quantin@xxxxxxxxx> schrieb am 11:15 Dienstag, 16.September 2014:

 


Le 16 sept. 2014 10:55, "Christina Obermaier" <christina.obermaier@xxxxxxxx> a écrit :
>
> Hi,
>
> I have a question according to the creation of an asn1 dissector plugin.
>
> I used the Toyasn1 sample to create my own dissector.
> The only thing i changes were the .asn files. There i used my own files (CAM.asn and ITS-Container.asn) which i specified in the makefile.
>
> Then i tryed to compile the plugin. I think this works very well, only a few wunused-function warnings are appearing.
> So i started Wireshark and get the error: undefined Symbol: dissect_TOYASN1_MESSAGE_PDU
>
> In the .cnf file is specified:
> .#PDU
> TOYASN1-MESSAGE
>
> So now i dont know what i have to do, to solve the error.
>
> I hope someone can help me..
> Greetings Christina
>

Hi,

You need to replace this line with the name of the top level PPU in your ASN.1 file. For example if you look at the files in asn1/c1222, you will see that the c1222.cnf file contains:


#.PDU
MESSAGE

where MESSAGE is the top PDU in the c1222.asn file.

Then you need to edit the .c file to put the corresponding function name that will be generated by asn2wrs (for c1222 dissector it is dissect_MESSAGE_PDU).

Regards,
Pascal.