godnscapture

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2017 License: MIT Imports: 15 Imported by: 1

README

godnscapture

Build Status codecov

Go library to capture DNS packets, based on https://github.com/Phillipmartin/gopassivedns. This library doesn't associate requests and responces of dns packets, and its used for raw logging.

This library support IPv4 and IPv6 protocols (+fragmented), using TCP or UDP.

Updating dependencies

To update dependencies, use the official dep manager at https://github.com/golang/dep and run

$ dep ensure -update

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CaptureOptions

type CaptureOptions struct {
	DevName                      string
	PcapFile                     string
	Filter                       string
	Port                         uint16
	GcTime                       time.Duration
	ResultChannel                chan<- DNSResult
	PacketHandlerCount           uint
	PacketChannelSize            uint
	TCPHandlerCount              uint
	TCPAssemblyChannelSize       uint
	TCPResultChannelSize         uint
	IPDefraggerChannelSize       uint
	IPDefraggerReturnChannelSize uint
	Done                         chan bool
}

type DNSCapturer

type DNSCapturer struct {
	// contains filtered or unexported fields
}

func NewDNSCapturer

func NewDNSCapturer(options CaptureOptions) DNSCapturer

func (*DNSCapturer) Start

func (capturer *DNSCapturer) Start()

type DNSResult

type DNSResult struct {
	Timestamp    time.Time
	DNS          mkdns.Msg
	IPVersion    uint8
	SrcIP        net.IP
	DstIP        net.IP
	Protocol     string
	PacketLength uint16
}

Directories

Path Synopsis
Package ip6defrag implements a IPv6 defragmenter
Package ip6defrag implements a IPv6 defragmenter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL