ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] Calling C++ files from C dissector

Date: Mon, 2 Feb 2009 11:24:54 -0600
Sorry, a bit over my head. so declare the functions i'm going to use in the library with extern? what if i can't change anything in the library, i was hoping that i could create a third file that i could use. So my dissector -> third file -> library. would i use extern in the third file and then not need it in the library functions? and what do you mean by linking it to my code? Sorry, like i said, not very experienced

Greg

--------------------------------------------------
You need to declare your function to use C calling convention using extern "C" declaration and then you can link it into your code.

-----Original Message-----
From: wireshark-dev-bounces@xxxxxxxxxxxxx
[mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of gogrady@xxxxxxxxx
Sent: Monday, February 02, 2009 12:09 PM
To: wireshark-dev@xxxxxxxxxxxxx
Subject: [Wireshark-dev] Calling C++ files from C dissector

Hello,

So i'm writing a custom dissector. I have a library for a custom protocol which has functions i need to call. What i want to do is take the raw data, send it to the library, and the library will send back the useful information for output. I've written the dissector code for getting the raw data, but now i don't know how to call the library. I want to create a proxy, or another file that i will use to call the library so my dissector isnt interacting directly with the library. I'm not sure how i even start to do this. any help would be greatly appreciated, i'm new to C/C++.

Thank,
Greg
___________________________________________________________________________
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