Wireshark-dev: Re: [Wireshark-dev] Including ASN.1 format coding in a C dissector
From: "Anders Broman \(AL/EAB\)" <[email protected]>
Date: Tue, 24 Apr 2007 11:16:43 +0200
Hi,
I was refering to the ranap.cnf file. But I suspect that the problem is that you have built your dissector as a plugin and
need to have the ranap functions exported trough libethereal.def, try to add them there possibly you need yo add export
in the ranap.h file like:
 
#line 1 "packet-ranap-exp.h"
extern const value_string ranap_Service_Handover_vals[];
extern const value_string ranap_TargetID_vals[];
extern int dissect_ranap_ResetAcknowledge(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
extern int dissect_ranap_ResetResource(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
extern int dissect_ranap_EncryptionInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
extern int dissect_ranap_IntegrityProtectionInformation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
extern int dissect_ranap_Service_Handover(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
extern int dissect_ranap_TargetID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
you'll ned to do this by hand as asn2wrs does not do this automatically.
 
You are probably better off building your dissector as a "normal" dissector avoiding this kind of problems. As you are changing the main code to make your
plugin to work you need to disrtribute a complete Wireshark package any way not only the Plugin. Note that any one that gets this package
can request the source code under the GPL license.
Best regards
Anders


From: [email protected] [mailto:[email protected]] On Behalf Of [email protected]
Sent: den 24 april 2007 10:44
To: [email protected]
Subject: Re: [Wireshark-dev] Including ASN.1 format coding in a C dissector

Hi ,

 

Can you specify which  .cnf  file, because we don’t have a .cnf file in my plugin directory..

Also , do we need to make any changes in makefie.am, makefile.common etc??

 

Regards,

Tarani

 


From: [email protected] [mailto:[email protected]] On Behalf Of Anders Broman (AL/EAB)
Sent: Tuesday, April 24, 2007 1:49 PM
To: Developer support list for Wireshark
Subject: Re: [Wireshark-dev] Including ASN.1 format coding in a C dissector

 

Hi,

Can you send me your .cnf file?

 

Best regards

Anders

 


From: [email protected] [mailto:[email protected]] On Behalf Of [email protected]
Sent: den 24 april 2007 08:57
To: [email protected]
Subject: Re: [Wireshark-dev] Including ASN.1 format coding in a C dissector

Hi ,

 

The ID of your packet-ranap-template.h file:

$Id: packet-ranap-template.h 18228 2006-05-27 22:09:07Z etxrab $ *

Also packet-ranap-exp.h is included in the file packet-ranap-template.h.

 

I am unable to find the cause for the error.

 

Please help..

 

Regards,

Tarani

 

 


From: Taraniteja Vishwanatha (WT01 - IP-Multimedia Carrier & Ent Networks)
Sent: Monday, April 23, 2007 12:10 PM
To: '[email protected]'
Subject: RE: Including ASN.1 format coding in a C dissector

 

Hi ,

 

I had to include some RANAP messages  in my dissector.

I have included in the following way:

 

dissect_xxx_msg(tvbuff_t *tvb,int offset,proto_tree *macic_tree,packet_info *pinfo)

{

guint8 *buf = ep_alloc(10240);

tvbuff_t *ranap_tvb;

int i;

asn1_ctx_t actx;

 

offset = add_IE_indicator(tvb, offset, macic_tree); /* To add IE Indicator */

offset = add_IE_length(tvb, offset, macic_tree);    /* To add IE length    */

 

ranap_tvb = tvb_new_real_data(buf,i,i);

tvb_set_child_real_data_tvbuff(tvb,ranap_tvb);

add_new_data_source(pinfo, ranap_tvb, "RANAP OVER MACIC");

asn1_ctx_init(&actx, ASN1_ENC_PER, TRUE, pinfo);

offset= dissect_ranap_ResetAcknowledge(ranap_tvb, offset, &actx, macic_tree, hf_macic_ranap_resetAcknowledge);

…………….

………

Remaining part of the msg continues..

}

I have included the appropriate headers : packet_ranap.h, packet_per.h, packet_ber.h etc etc…

I am getting a run-time error mentioned below:

 

undefined symbol: dissect_ranap_ResetResource

 

Any other place that I have to declare the functions ????

Please help…..

 

Regards,

Tarani


From: Taraniteja Vishwanatha (WT01 - IP-Multimedia Carrier & Ent Networks)
Sent: Friday, April 13, 2007 12:52 PM
To: '[email protected]'
Subject: RE: Including ASN.1 format coding in a C dissector

 

Hi Anders,

 

To include the RANAP messages in my dissector, I have done the following:

 

1.In ranap.cnf under #.EXPORTS, I have added the message id s which I want to export.

2.In packet-ranap.h, I have included the corresponding functions of the messages which I want to add.

3.In my dissector , I have included packet-ranap.h , packet-per.h and called the functions appropriately.

 

But I am getting errors due to some linking problems.

 

error: `actx' undeclared (first use in this function)

error: (Each undeclared identifier is reported only once

 

I have not defined asn1_ctx_t *actx in my dissector as I have included the appropriate headers.

 

Can you please help???

 

Regards,

Tarani

 


From: Taraniteja Vishwanatha (WT01 - IP-Multimedia Carrier & Ent Networks)
Sent: Thursday, April 12, 2007 11:32 AM
To: '[email protected]'
Subject: RE: Including ASN.1 format coding in a C dissector

 

Hi Anders,

 

Thanks for the information. The dissector is propreitary , hence I cant include it in Wireshark.

 

I will include RANAP messages in the way you have mentioned.

But then , I will have a tough time forming packets for testing . Any clue how can I form the packets.

 

Thanks in advance.

 

Regards,

Tarani

 


From: Taraniteja Vishwanatha (WT01 - IP-Multimedia Carrier & Ent Networks)
Sent: Wednesday, April 11, 2007 5:40 PM
To: '[email protected]'
Subject: Including ASN.1 format coding in a C dissector

 

Hi ,

 

I have written  a dissector for a protocol which has a coding standard of Tag-Length-Value. Now in this dissector , I have to add some messages of RANAP protocol which has a coding standard in ASN.1 format.Already the dissector for RANAP is available in the wireshark. Now:

 

1.Can I call the existing dissector for those particular messages??? If so how do I do that??

2. If I want to include it normally in my dissector, how can I convert the ASN.1 format to obtain the tag and lengths of  individual parameters??

 

Can anybody please help??

 

//Tarani


The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com

 


The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com