raw
raw copied to clipboard
Package raw enables reading and writing data at the device driver level for a network interface. MIT Licensed.
This adds support for getting and setting socket options.
Specifying a socketaddr is unnecessary when writing packets to a raw socket. According to packet(7) the supplied buffer should contain a physical-layer header. The `sockaddr_ll` is used for `SOCK_DGRAM`. >...
This allows the interface to subscribe to a link-layer multicast address. I've written a small program to proxy eap packets from one interface to another. EAP (802.1x Auth) packets are...
Instead of hard-coding the length of the BPF header, this pull-request casts the header into a Go struct and gets the length of the header from that struct. This neatly...
Add SetMulticast(b bool, addr net.Addr) to Linux and BSD. Stub in others with ErrNotImplemented. Linux implementation through setsockopt(), as such any multicast groups joined will automatically be dropped on socket...
I would like to propose this, and perhaps kick this off myself, and have this thread open for any future discussions, if that is alright.
func `htons` should take host endianness into account: ``` func htons(i uint16) uint16 { return (i8 } ``` Depending on host endianness this should be a no-op or not. The...
Hello, I encountered a problem during use in Macos, As follows: panic: runtime error: slice bounds out of range [:4098] with capacity 4096 goroutine 886516 [running]: github.com/mdlayher/raw.(*packetConn).ReadFrom(0xc0061cd6e0, {0xc005833280, 0x80, 0x80})...