Documentation ¶
Index ¶
- Constants
- func Close(conn io.Closer, reset bool) error
- func IpDefragger(ipInput chan gopacket.Packet, udpOutput chan gopacket.Packet, ...)
- func SetSock_RCVBUF(conn net.Conn, desired int, is_tls 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 ( 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 ¶
This section is empty.
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 ¶
func SetSock_RCVBUF ¶
Configure SO_RCVBUF, thanks to https://github.com/dmachard/go-dns-collector/issues/61#issuecomment-1201199895
func TcpAssembler ¶
Types ¶
type DnsPacket ¶
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 ¶
type DnsStreamFactory struct { // Channel to send reassembled DNS data Reassembled chan DnsPacket IpDefragmented bool }
func (*DnsStreamFactory) New ¶
func (s *DnsStreamFactory) New(net, transport gopacket.Flow) tcpassembly.Stream
type IpDefragmenter ¶
func NewIPDefragmenter ¶
func NewIPDefragmenter() *IpDefragmenter
func (*IpDefragmenter) DiscardOlderThan ¶
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.