PacketSniffer

package
v0.0.0-...-d18c527 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2016 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpMonitor

type HttpMonitor struct {
	Device         string
	Requests       chan HttpRequest
	TimeStamp      time.Time
	Timeout        time.Duration
	SnapshotLength int32
	Promiscous     bool
}

The concrete http-monitor type

func Start

func Start(device string) *HttpMonitor

Init our monitor

func (*HttpMonitor) Receive

func (monitor *HttpMonitor) Receive() chan HttpRequest

Start receiving http requests on an output channel

type HttpRequest

type HttpRequest struct {
	Url       string
	Host      string
	DstPort   int
	SrcPort   int
	DstIP     string
	SrcIP     string
	TimeStamp time.Time
}

An instance of a HTTP request

type HttpRequests

type HttpRequests []HttpRequest

type Monitor

type Monitor interface {
	Start() HttpMonitor
	Receive() chan HttpRequest
}

type Parser

type Parser struct{}

Public interface of our net/http parser

func CreateParser

func CreateParser() Parser

func (*Parser) GetHost

func (parser *Parser) GetHost(packet gopacket.Packet) string

func (*Parser) GetSrcDstIPs

func (parser *Parser) GetSrcDstIPs(packet gopacket.Packet) (string, string)

returns (srcIP, dstIP)

func (*Parser) GetSrcDstPorts

func (parser *Parser) GetSrcDstPorts(packet gopacket.Packet) (int, int)

returns (srcPort, dstPort)

Jump to

Keyboard shortcuts

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