Documentation ¶
Index ¶
- Constants
- Variables
- func Close(conn io.Closer, reset bool) error
- func IPDefragger(ipInput chan gopacket.Packet, udpOutput chan gopacket.Packet, ...)
- func SetSockRCVBUF(conn net.Conn, desired int, isTLS bool) (int, int, error)
- func TCPAssembler(tcpInput chan gopacket.Packet, dnsOutput chan DNSPacket, portFilter int)
- func UDPProcessor(udpInput chan gopacket.Packet, dnsOutput chan DNSPacket, portFilter int)
- type DNSPacket
- type DNSStreamFactory
- type IPDefragmenter
- type NetDecoder
Constants ¶
View Source
const ( ProtoInet = "INET" ProtoInet6 = "INET6" ProtoIPv6 = "IPv6" ProtoIPv4 = "IPv4" ProtoUDP = "UDP" ProtoTCP = "TCP" SocketTCP = "tcp" SocketUDP = "udp" SocketUnix = "unix" SocketTLS = "tcp+tls" )
View Source
const ( IPv6MinimumFragmentSize = 1280 IPv6MaximumSize = 65535 IPv6MaximumFragmentOffset = 8189 IPv6MaximumFragmentListLen = 52 IPv4MinimumFragmentSize = 8 // Minimum size of a single fragment IPv4MaximumSize = 65535 // Maximum size of a fragment (2^16) IPv4MaximumFragmentOffset = 8183 // Maximum offset of a fragment IPv4MaximumFragmentListLen = 8192 // Back out if we get more than this many fragments )
View Source
const ( IPv4ProtocolTCP = layers.IPProtocolTCP IPv4ProtocolUDP = layers.IPProtocolUDP IPv6ProtocolTCP = layers.IPProtocolTCP IPv6ProtocolUDP = layers.IPProtocolUDP IPv6ProtocolFragment = layers.IPProtocolIPv6Fragment )
Variables ¶
View Source
var ( IPVersion = map[string]string{ ProtoInet: ProtoIPv4, ProtoInet6: ProtoIPv6, } IPToInet = map[string]string{ ProtoIPv4: ProtoInet, ProtoIPv6: ProtoInet6, } )
Functions ¶
func Close ¶ added in v0.32.0
thanks to https://stackoverflow.com/questions/28967701/golang-tcp-socket-cant-close-after-get-file, call conn.CloseRead() before calling conn.Close()
func IPDefragger ¶ added in v0.39.0
func SetSockRCVBUF ¶ added in v0.39.0
Configure SO_RCVBUF, thanks to https://github.com/dmachard/go-dns-collector/issues/61#issuecomment-1201199895
func TCPAssembler ¶ added in v0.39.0
Types ¶
type DNSPacket ¶ added in v0.39.0
type DNSPacket struct { // DNS payload Payload []byte // IP layer IPLayer gopacket.Flow // Transport layer TransportLayer gopacket.Flow // Timestamp Timestamp time.Time // IP Defragmented IPDefragmented bool // TCP reassembly TCPReassembled bool }
DefragPacket is a struct that holds DNS data
type DNSStreamFactory ¶ added in v0.39.0
type DNSStreamFactory struct { // Channel to send reassembled DNS data Reassembled chan DNSPacket IPDefragmented bool }
func (*DNSStreamFactory) New ¶ added in v0.39.0
func (s *DNSStreamFactory) New(net, transport gopacket.Flow) tcpassembly.Stream
type IPDefragmenter ¶ added in v0.39.0
func NewIPDefragmenter ¶
func NewIPDefragmenter() *IPDefragmenter
func (*IPDefragmenter) DiscardOlderThan ¶ added in v0.39.0
func (d *IPDefragmenter) DiscardOlderThan(t time.Time) int
type NetDecoder ¶
type NetDecoder struct{}
func (*NetDecoder) Decode ¶
func (d *NetDecoder) Decode(data []byte, p gopacket.PacketBuilder) error
Click to show internal directories.
Click to hide internal directories.