#raw-sockets #arp #raw #networking #sockets #packet

cursock

Crate for raw socketing, can be used for sending raw packets and some protocols

3 stable releases

1.2.7 Jun 21, 2023
1.2.3 May 31, 2023
1.2.0 Feb 12, 2023

#5 in #arp

22 downloads per month

Apache-2.0

92KB
1.5K SLoC

Contains (static library, 27KB) lib/npcap/wpcap.lib, (static library, 1KB) lib/cursock/linux/libcursock.a

Cursock v1.2.7

Crate for raw socketing, can send raw packets and some protocols

Changelog

  • reimplemented Icmp, Arp and Adapter structs
  • added IpPacked which represents eth + (ipv4 | ipv6) headers
  • handling dest mac address for Icmp struct

Todo

  • Add ipv6 support for Icmp

Protocols

  • Arp
  • Icmp

Platforms

  • Windows (npcap)
  • Linux

Examples

use cursock::*;
use cursock::utils::*;

let socket = Socket::new("wlan0").expect("initialize error");
let mut buffer = [0; 1000];

socket.read_raw_packet(&mut buffer).expect("read error");

socket.destroy();

lib.rs:

Cursock

cursock is a crate that designed to help with socketing.

Dependencies

~310KB