network packet creation/parsing library? [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm looking for a library that helps with network packet creation/parsing. Something as Python dpkg library. I need to change IP addresses, to check ports and to analyze payload of TCP/UDP packets which I have as Ethernet frames.
I know this can be done manually, e.g. as is presented in WinPcap docs or libpcap docs. Are there any library for this?
C++ on Windows.

Take a look to libcrafter. It's a library for creation and decoding of network packets very similar to Scapy. Not sure if it can work on Windows but you can try.

I know it's been a while this answer but you should try libtins. It is a really versatile, object-oriented and efficient library.
Disclaimer: I was one of the creators of the library and it is actively maintained by Matias Fontanini.

Have a look at the plugins and API for for Wireshark.

Related

Simple SSL socket in C++, Windows [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I have two C++ projects, which communicate via a socket using winsock2. Now, I want to encrypt the communication using SSL (this is the easiest and fastest way, right?).
I tried to find any library or good tutorial, but I did not find a good one that worked for me (e.g. this sounds simple, but I wasn't able to include the header file without errors).
Do you have any suggestion / good tutorial /good library for encrypting winsock2-sockets fast?
When dealing with a low level language like C++, SSL/TLS is not simple. You have to deal with learning one of the many SSL/TLS libraries. Additionally, while some of the samples for these libraries may seem simple, the nuances of SSL/TLS are not.
I can point you to several libraries that work on Windows, as well as their tags in Stackoverflow.
Boost (tag)
GnuTLS (tag)
OpenSSL (tag)
Schannel (tag)
libressl (tag)

Find available network interfaces in C/C++? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
Does anyone know a C/C++ code for finding the network interfaces available?
I've been looking for some code, but most times they are quite complex. Is there a simple way to do this?
See the getifaddrs man page. There is an example program towards the end.
If you're looking for this in context of a desktop application, and you want to be notified of changes (e.g. interfaces connecting/disconnecting), consider using DBus to monitor NetworkManager.
http://projects.gnome.org/NetworkManager/developers/api/09/spec.html
You can enumerate interfaces, as well as interface-specific things (like available and connected WiFi access points, configured-but-not-dialed PPP links, and so forth), and if anything changes, you'll receive a notification over the DBus.
(If this is for something more like a server program, where you expect the network configuration to remain more stable, then things like getifaddrs are possibly more appropriate.)

Library for C++ File Upload/Download? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
Is there a C++ library that provides functions for uploading/downloading files over http without having to deal with sockets etc?
Not quite C++, but libcurl is a very popular and widely used HTTP client library.
Try cURLpp (formerly cURL++), the official C++ binding to libcurl. Here's an example of downloading from a URL and outputting to standard out.
Please have a look at https://code.google.com/p/ffead-cpp/, it has lovely REST-full support for uploading single/multiple files. An example can be found at https://code.google.com/p/ffead-cpp/wiki/ExampleRestController.
Yes, cURL:
http://curl.haxx.se/libcurl/
Look at SFML. It is very easy to use and it has support for both HTTP and FTP connections.
► http://www.sfml-dev.org/
It's mainly intended for game development, but it can be used for other things as well.

Could anyone suggest a good packet sniffer class for c++? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
Could anyone suggest a good packet sniffer class for c++? Looking for a easy insertable class I can use in my c++ program, nothing complicated.
You will never be able to intercept network traffic just by inserting a class into your project. Packet capture functionality requires kernel mode support, hence you will at the very least need to have your application require or install libpcap/WinPcap, as Will Dean pointed out.
Most modern Unix-like distributions include libpcap out of the box, in which case you could take a look at this very simple example: http://www.tcpdump.org/pcap.htm
If you're using Windows, you're more or less on your own, although WinPcap programming is extremely similar to libpcap programming (unsurprisingly, since it's a libpcap port to Win32.) The SDK can be found here: http://www.winpcap.org/devel.htm
At any rate, no matter the operating system, you will need root / Administrator access to actually perform a capture. Just using the library to replay or analyze precaptured data doesn't require any special privilege, of course.
You'll need to say something about your platform, as this is a platform rather than a language thing.
But assuming you're on something common, look into pcap or winpcap.
Microsoft Network Monitor has a packet capture and analysis API, see the netmon blog for some basic info.

Easy to use SNMP client library for c++? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
What's an easy to use SNMP client library for c++?
SNMP++ is also a nice and open source library for C++ developers.
http://www.agentpp.com/api/cpp/snmp_pp.html
Probably the best choice is net-snmp. Note that the library has "C" linkage but will work just fine with C++.
I have found that Net-SNMP does not support multi-threading with v3 type queries. So if you are writing an SNMP monitoring tool that will be polling multiple hosts then you will need to take this into consideration.
OpenSNMP contains a complete multi-threaded implementation of SNMPv3 that is done in C++ (complete with classes, etc). It's not heavily used and maintained though.
Net-SNMP with v3 over TLS/DTLS is likely to be threadsafe as it's really SNMPv3/USM that contains threading issues. I think.