Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/mdlayher/packet
/ functions
Functions
45 in github.com/mdlayher/packet
⨍
Functions
45
◇
Types & classes
7
↓ 11 callers
Method
opError
opError is a convenience for the function opError that also passes the local and remote addresses of the Conn.
packet.go:171
↓ 3 callers
Function
opError
opError unpacks err if possible, producing a net.OpError with the input parameters in order to implement net.PacketConn. As a convenience, opError ret
packet.go:228
↓ 3 callers
Method
opError
opError is a convenience for the function opError that also passes the address of the rawConn.
packet.go:204
↓ 2 callers
Method
Close
Close closes the connection.
packet.go:91
↓ 2 callers
Function
hex
(v uint16)
packet_internal_test.go:76
↓ 2 callers
Function
htons
htons converts a short (uint16) from host-to-network byte order.
packet_linux.go:238
↓ 1 callers
Function
Listen
Listen opens a packet sockets connection on the specified interface, using the given socket type and protocol values. The socket type must be one of
packet.go:60
↓ 1 callers
Method
ReadFrom
ReadFrom implements the net.PacketConn ReadFrom method.
packet.go:100
↓ 1 callers
Method
SetBPF
SetBPF attaches an assembled BPF program to the Conn.
packet.go:125
↓ 1 callers
Method
SetReadDeadline
SetReadDeadline implements the net.PacketConn SetReadDeadline method.
packet.go:115
↓ 1 callers
Method
Stats
Stats retrieves statistics about the Conn from the Linux kernel. Note that calling Stats will reset the kernel's internal counters for this Conn. If
packet.go:153
↓ 1 callers
Method
String
String returns the string representation of an Addr.
packet.go:221
↓ 1 callers
Function
bind
bind binds the *socket.Conn to finalize *Conn setup.
packet_linux.go:136
↓ 1 callers
Function
fromSockaddr
fromSockaddr converts an opaque unix.Sockaddr to *Addr. If sa is nil, it returns nil. It panics if sa is not of type *unix.SockaddrLinklayer.
packet_linux.go:182
↓ 1 callers
Function
listen
listen is the entry point for Listen on Linux.
packet_linux.go:101
↓ 1 callers
Method
readFrom
readFrom implements the net.PacketConn ReadFrom method using recvfrom(2).
packet_linux.go:24
↓ 1 callers
Method
setPromiscuous
setPromiscuous wraps setsockopt(2) for the unix.PACKET_MR_PROMISC option.
packet_linux.go:54
↓ 1 callers
Method
stats
stats wraps getsockopt(2) for tpacket_stats* types.
packet_linux.go:72
↓ 1 callers
Function
testConn
testConn produces a *packet.Conn bound to the returned *net.Interface. The caller does not need to call Close on the *packet.Conn.
packet_linux_test.go:92
↓ 1 callers
Function
testInterface
testInterface looks for a suitable Ethernet interface to bind a *packet.Conn.
packet_linux_test.go:111
↓ 1 callers
Method
toSockaddr
toSockaddr converts a net.Addr to an opaque unix.Sockaddr. It returns an error if the fields cannot be packed into a *unix.SockaddrLinklayer.
packet_linux.go:198
↓ 1 callers
Method
writeTo
writeTo implements the net.PacketConn WriteTo method.
packet_linux.go:38
Method
Close
()
packet_others.go:28
Method
Control
Control implements the syscall.RawConn Control method.
packet.go:188
Method
LocalAddr
LocalAddr returns the local network address. The Addr returned is shared by all invocations of LocalAddr, so do not modify it.
packet.go:97
Method
Network
Network returns the address's network name, "packet".
packet.go:218
Method
Read
Control implements the syscall.RawConn Read method.
packet.go:193
Method
SetBPF
(_ []bpf.RawInstruction)
packet_others.go:32
Method
SetDeadline
SetDeadline implements the net.PacketConn SetDeadline method.
packet.go:110
Method
SetDeadline
(_ time.Time)
packet_others.go:29
Method
SetPromiscuous
SetPromiscuous enables or disables promiscuous mode on the Conn, allowing it to receive traffic that is not addressed to the Conn's network interface.
packet.go:131
Method
SetReadDeadline
(_ time.Time)
packet_others.go:30
Method
SetWriteDeadline
SetWriteDeadline implements the net.PacketConn SetWriteDeadline method.
packet.go:120
Method
SetWriteDeadline
(_ time.Time)
packet_others.go:31
Method
SyscallConn
SyscallConn returns a raw network connection. This implements the syscall.Conn interface.
packet.go:157
Method
SyscallConn
()
packet_others.go:33
Function
TestConnListen
(t *testing.T)
packet_linux_test.go:22
Function
Test_htons
(t *testing.T)
packet_internal_test.go:16
Method
Write
Control implements the syscall.RawConn Write method.
packet.go:198
Method
WriteTo
WriteTo implements the net.PacketConn WriteTo method.
packet.go:105
Function
listen
(_ *net.Interface, _ Type, _ int, _ *Config)
packet_others.go:19
Method
readFrom
(_ []byte)
packet_others.go:21
Method
setPromiscuous
(_ bool)
packet_others.go:23
Method
stats
()
packet_others.go:24
Method
writeTo
(_ []byte, _ net.Addr)
packet_others.go:22