Wireshark tcap dissector inside my program - c

I'm working on SS7 project and reached a point where I need to create my tcap dissector/parser, So I was wondering to using wireshark dev files inside my source.
Is that possible? if yes? how can I do it? is there any tutorial available?

http://www.tcpdump.org/ has all needed information.
You'll need to use libpcap as described here: http://www.tcpdump.org/pcap3_man.html
I guess pcap_open_offline is a good start, you can then use the related functions to get the structured data contained in the dump file. Using the same library, you could also capturing directly from your application.
On a related note, wireshark and tshark allow to export a pcap file to xml, you could also use this format instead of the binary pcap if you'd like to.

Like most things to do with software it is possible. However a more valid question might be what use can you make of the Wireshark source code?
Some disadvantages of using Wireshark are:
it is a general purpose tool built for all protocols. All implemented protocol dissectors plug into its general framework. So if you want to reuse just a particular protocol you need some way of implementing or stubbing out the framework code.
it is designed only for dissecting and describing protocol components. It has no encoding functionality.
it is licensed using the copy left GPL license. This means that any software you build from Wireshark must also be licensed in this way.
Having said that it can be invaluable to just browse the source code to get a starting point. The main tcap dissecting source file is at epan/dissectors/packet-tcap.c. Wireshark uses a ASN.1 decompiler to parse the TCAP message. The definition file it uses can be found in asn1/tcap/tcap.asn.

Related

How are C files included in freeSwitch (kind of framework for calls)?

Today I downloaded Freeswitch that (based on what I read) allows me to have a messaging (audio and video calls) server in my computer. I am not very good in programming. When analysing the files contained in its .zip file, I noticed that almost all the files were written in C++.
However based on my knowledge, C files need to be compiled before they can be used (maybe I am wrong). If so, Why C files??
I ask this question because I was building some kind of web messaging app. I implemented text chat, send image, audio, attachment. I did it using simply HTML, JAVASCRIPT, PHP, SQL and a little XML. When it comes to audio call and Video call, I cannot start (because I found it more complex). So I tried to find an easy alternative that took me to freeswitch.
I do not know if it is up to me to compile them or not.
Note: I did not install it.
Thank you!!
FreeSwitch is an open-source software-based PBX written in C. So yes, it needs to be compiled. However, the FreeSwitch website provides precompiled binaries if you just want to use the FreeSwitch software as-is:
https://freeswitch.org/confluence/display/FREESWITCH/Installation
You don't need the source code unless you are planning on modifying it, in which case you will then have to compile it for any changes to take effect.
FreeSwitch is open-source tool written in C. FreeSwitch uses many libraries. So to compile FreeSwitch you have to first install all dependency of FreeSwitch then you have to configure and make, make install the FreeSwitch Source.
I have wrote many custom module in FreeSwitch using C for Callcenter, conference, class4-switch, class5-switch, class4/5 switch.

encrypting c source files

I´m searching for a way to encrypt my C source files. That way, I can handle it to some project partners. I don´t want them to see my code but I want them to use the functions I implemented so they can flash it on a microcontroller.
Is it even possible to encrypt a source file so J-Link can flash it?
I got told to look up for DLL but I don´t know if a DLL would help in this situation.
For software, I use Dave v4 as IDE and FreeRTOS as firmware. For Hardware I use a XMC4700 Relax Kit.
DLLs won't help,
because your platform (presumably) lacks a dynamic loader. It might be possible to create one, but it doesn't worth the trouble, because you can just
ship the object files.
For that to work, you need a copy of your partner's compiler. Compile your sources exactly as they'd do it (with the same compiler options), and ship the resulting object files along with the headers needed to use it.
This appears to be an XY problem. You want to protect your intellectual property, and you think you can use encryption to do that. You asked about encryption, when you should have asked about protecting your intellectual property.
Encryption isn't very useful for protecting intellectual property. If your clients machine can decrypt the code to run it then your client can decrypt the code. If your client can't decrypt the code the client can't run it. Either way, problems are introduced...
The solution to your problem is the legal system. Use that to protect your intellectual property, instead.

finite state machine compiler for C to simulate network protocols

I was looking for a good state machine compiler so as to test some custom networking protocols. I looked at a few tools already such as Yakindu, Ragel(compiler), SCXML(language) but I was not sure if any of them could be used for networking protocols.
SCXML(language) looks good but I could not find any compilers specifically for C (scxmlcc is for C++). Does anyone know a compiler for C based on SCXML?
Yakindu tool looks promising, but I am not sure if network protocols like BGP/OSPF could be tested. Can anyone please give any pointers on this?
Ragel also looks good, but again I am not sure if complex network protocol clients can be generated using this compiler.
The reason I mentioned network protocols specifically is that I also want to be able to perform custom routines such as packet_create/packet_send (with custom packet sizes) etc as part of 'actions' after an 'event' occurs.
Do I need to always generate code from the state graph or Is there a way to directly interact with the states?
I am very new to FSMs, any help/advice/suggestion/links will be greatly appreciated.
The default Yakindu SCT C code generator generates plain C code that is agnostic of the concrete execution environment. This means you get a piece of standard C code that you can integrate into you own application manually. This manual integration means mapping events, operations, and variables between your application and the state machine. Additionally you have to trigger the state machine execution properly.
You can find some information on that in the user guide. You could also customize the code generators in order to match your needs but that makes only sense if the integration into the application always look the same and you want to integrate more than one or two state machines.
So if you provide some more information about the application side API that i could provide some hints how to integrate with the state machine.
We just finished our SCXML -> ANSI C transformation. Currently, it does everything but invocations. Here is a sample of generated ANSI C code, with user-supplied callbacks and the general scaffolding here. Performance measurements for a single microstep on a late 2015 MacBook Pro#3.1GHz are here.
Note that the scaffolding is in C++98 as we had to connect to a data-model implementation to pass the SCXML IRP tests. Generated source is ANSI C though. If you want to transform a SCXML state-chart you can use uscxml-transform as:
$ uscxml-transform -tc -i FILE_OR_URL -o GENERATED_HERE
For example, to print the generated C code for test144 from the SCXML IRP suite on STDOUT:
$ uscxml-transform -tc -i https://raw.githubusercontent.com/tklab-tud/uscxml/master/test/w3c/ecma/test144.scxml
Generated ANSI-C code passes all SCXML IRP tests but those for invocations and custom I/O processors.
LOKI is a new application designed to provide an easy way for programmers and system admistrators to interact with BGP networks. Use it to test your OSPF/BGP connections as well

Is there simple way to play an rtp video/audio stream in WPF?

I need to create a WPF control that will play an rtp stream with the requirement that the latency needs to be as low as possible.
I've looked at the following two projects:
http://vlcdotnet.codeplex.com/
http://wpfmediakit.codeplex.com/
As far as I know, I can't use VLC because we're shipping a commercial application with a more restrictive license than GPL (i.e. we can't ship our source).
Wpf media kit is nice, but I can't seem to find a good/free rtp directshow source filter and I wanted to ask if there is a simpler solution out there that I'm missing before I jump into writing my own.
Any ideas?
VLC uses the LIVE555 library for the RTP/RTSP side of things so perhaps that will be useful to you, it's licensed under LGPL. It is a C++ library so you'd have to get out pinvoke and since I haven't ever used the library I can't say how difficult that would be.
There is pjsip.net but looks like it's GPL since that's what the underlying pjsip and pjmedia are.
Here's a handy list of RTP stacks.
There's not simple solution that I've come across. I have made RTSP filter's in the past using LIVE555, but I don't think that falls into the realm of "easy".
I did see this on source forge, but I read comments questioning if it even works.

Good portable wiimote library with sound support?

I'm lookin for a portable wiimote library. I want to use the wiimote for the hardware it has (but I don't need to access any data stored on it).
Required features:
access to all the buttons (as an exception, no use of the power button is OK)
make the wiimote play sound
talk to nunchuks and classic controllers
preferably: make the wiimote rumble.
interface with C. Preferably native C. Bonus points for bindings with Haskell or python.
The library should port to Linux, Windows and OS X (in order of importance) and should be agnostic with respect to CPU architecture.
Anyone got a good suggestion?
Haven't use it (I've only read about the managed Wiimote library really), but you may want to check out wiiuse. It seems like the most complete of the native libararies.
Others include:
GlovePIE
WiiYourself
You can use my WiiMouse program to do this (which is based on the wiimotelib open source project), it allows you to connect via named pipes and play PCM sounds and use all the attachments including the MotionPlus, it even calculates the MotionPLus vectors for you, you can get it here:
http://home.exetel.com.au/amurgshere/wiimouse.phtml
See the download for an example on how to connect to a wiimote via named pipes and play sounds and stuff.

Resources