https://github.com/stealth/libusipp
unix socket interface for C++ raw IP/IP6/UDP/TCP, Layer2 etc. framework
https://github.com/stealth/libusipp
arp icmp ip ipv4 ipv6 libpcap pcap raw-sockets sockets tcp udp
Last synced: 7 months ago
JSON representation
unix socket interface for C++ raw IP/IP6/UDP/TCP, Layer2 etc. framework
- Host: GitHub
- URL: https://github.com/stealth/libusipp
- Owner: stealth
- License: other
- Created: 2012-03-21T14:34:58.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T18:19:10.000Z (over 2 years ago)
- Last Synced: 2023-03-14T04:05:15.773Z (over 2 years ago)
- Topics: arp, icmp, ip, ipv4, ipv6, libpcap, pcap, raw-sockets, sockets, tcp, udp
- Language: C++
- Homepage: http://c-skills.blogspot.com
- Size: 302 KB
- Stars: 38
- Watchers: 3
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
USI++ README
============[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9MVF8BRMX2CWA)
0. About
--------usi++ (UNIX Socket Interface) is a low-level network-library for sending/receiving
IP, IP6, ARP etc. packets directly on RAW or PACKET sockets. It can also be used for
network-monitoring and rapid development of pentesting tools. It requires `libpcap`
and `libdnet` if you want the Layer2 DNET provider.1. License
----------usi++ comes under the GPL. See file COPYING for more
details.A data-file for ethernet-MAC's is included. It was taken from
arpwatch.Since USI++ is GPL there is ABSOLUTELY NO WARRANTY. YOU USE IT AT YOUR OWN RISK.
2. Install
----------$ cd src
$ autoconf
$ ./configure
$ make
# make installPlease note, if you have multiple `libpcap` installs for testing, the generated `Makefile` is
just a proposal. The configure script actually cannot know which include or lib path
you prefer. In such case, you have to edit the generated `Makefile` to point to it exactly,
as well as setting/unsetting the defines you need in `config.h`.Having more than one libpcap install is not uncommon, since various functions such
as `pcap_set_immediate_mode()` or mmapped packet sockets just appeared recently.3. Compiling the examples
-------------------------Usually like this:
# c++ -std=c++11 foo.cc -lusi++ -lpcap -L/usr/local/lib -I/usr/local/include
If you compiled usi++ with _dnet_ support, which allows you to also
send packets at the datalink layer (not just RAW sockets), you also need to
link against `-ldnet`. Newer _libpcap_ may already contain `pcap_inject()` so
you can also build usi++ without _libdnet_, as this function also
provides a portable way to send datalink frames.4. Function-description
-----------------------Please look at the HTML-documentation (generated via doxygen) of `libusi++` or at the samples.
5. Supported Platforms
----------------------Linux, BSD, OSX.
6. BUGS/TODO
------------None.
7. Background for Layer 2
-------------------------The linklevel handling has changed. Now all classes are derived from
Layer2 {} which contains a RX and a TX object which are used for
receiving and transmitting data. The class-declarations can be found
in the coresponding .h files. These classes are abstract, this means
you must derive your own to get it working. Look at the .h files
which functions you must implemet. USI++ ships with the classes
`Pcap`, `TX_IP`, `TX_eth_dnet` etc which let you capture/send packets. They give you
basic functionality so that you can use programs that work with USI++ 1.67 or
lower as normal.
By making `RX` and `TX` abstract we make sure that `Layer2` can access
routines such as `sendpack()`. You are free to write your own RX/TX based
classes for different hardware (FDDI,...). You can change RX/TX behaivior at runtime,
so it is as flexible as possible. For example you could detect that you are
working with PPP and then you load PPP transimitter.
Have fun.