Documentation
¶
Index ¶
Constants ¶
View Source
const ( EchoReply uint8 = 0x00 EchoRequest uint8 = 0x08 )
View Source
const IPAny = IP(0)
View Source
const MIN_FRAG = 60 + 20 // max IPv4 header + basic TCP header
RFC1858: prevent overlapping fragment attacks.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type QDecode ¶
type QDecode struct {
IPProto IPProto // IP subprotocol (UDP, TCP, etc)
SrcIP IP // IP source address
DstIP IP // IP destination address
SrcPort uint16 // TCP/UDP source port
DstPort uint16 // TCP/UDP destination port
TCPFlags uint8 // TCP flags (SYN, ACK, etc)
// contains filtered or unexported fields
}
func (*QDecode) Decode ¶
An extremely simple packet decoder for basic IPv4 packet types. It extracts only the subprotocol id, IP addresses, and (if any) ports, and shouldn't need any memory allocation.
func (*QDecode) EchoRespond ¶
func (*QDecode) IsEchoRequest ¶
For a packet that has already been decoded, check if it's an IPv4 ICMP Echo Request.
func (*QDecode) IsTCPSyn ¶
For a decoded TCP packet, return true if it's a TCP SYN packet (ie. the first packet in a new connection).
Click to show internal directories.
Click to hide internal directories.