external

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

nolint

nolint

nolint

nolint

nolint

Index

Constants

This section is empty.

Variables

View Source
var PrinterWaitGroup sync.WaitGroup
View Source
var WaitGroup sync.WaitGroup

Functions

This section is empty.

Types

type ConnectionHandler

type ConnectionHandler interface {
	// contains filtered or unexported methods
}

ConnectionHandler is interface for handle tcp connection

type ConnectionID

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

ConnectionID identify a tcp connection

type ConnectionKey

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

ConnectionKey contains src and dst endpoint identify a connection

type Endpoint

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

Endpoint is one endpoint of a tcp connection

func (Endpoint) String

func (p Endpoint) String() string

type HTTPConnectionHandler

type HTTPConnectionHandler struct {
	Option  *Option
	Printer *Printer
}

HTTPConnectionHandler impl ConnectionHandler

type HTTPTrafficHandler

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

HTTPTrafficHandler parse a http connection traffic and send to Printer

type IntRange

type IntRange struct {
	Start int // inclusive
	End   int // inclusive
}

Range of int value

func NewIntRange

func NewIntRange(start int, end int) IntRange

Create new int range

func (*IntRange) Contains

func (r *IntRange) Contains(value int) bool

If this range contains the value

type IntSet

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

A set of int values

func NewIntSet

func NewIntSet(ranges ...IntRange) *IntSet

Create new IntSet

func ParseIntSet

func ParseIntSet(str string) (*IntSet, error)

parse int set

func (*IntSet) Contains

func (s *IntSet) Contains(value int) bool

If this set contains int value

func (*IntSet) String

func (s *IntSet) String() string

implement Stringer

type NetworkStream

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

NetworkStream tread one-direction tcp data as stream. impl reader closer

func (*NetworkStream) Close

func (stream *NetworkStream) Close() error

Close the stream

func (*NetworkStream) Read

func (stream *NetworkStream) Read(p []byte) (n int, err error)

type Option

type Option struct {
	Level     string        `` /* 133-byte string literal not displayed */
	File      string        `description:"Read from pcap file. If not set, will capture data from network device by default"`
	Device    string        `default:"any" description:"Capture packet from network device. If is any, capture all interface traffics"`
	Ip        string        `description:"Filter by ip, if either source or target ip is matched, the packet will be processed"`
	Port      uint          `description:"Filter by port, if either source or target port is matched, the packet will be processed."`
	Host      string        `description:"Filter by request host, using wildcard match(*, ?)"`
	Uri       string        `description:"Filter by request url path, using wildcard match(*, ?)"`
	Status    string        `description:"Filter by response status code. Can use range. eg: 200, 200-300 or 200:300-400"`
	StatusSet *IntSet       `ignore:"true"`
	Force     bool          `description:"Force print unknown content-type http body even if it seems not to be text content"`
	Pretty    bool          `description:"Try to format and prettify json content"`
	Curl      bool          `description:"Output an equivalent curl command for each http request"`
	DumpBody  bool          `description:"dump http request/response body to file"`
	Output    string        `description:"Write result to file [output] instead of stdout"`
	Idle      time.Duration `default:"4m" description:"Idle time to remove connection if no package received"`
}

command line options

type Printer

type Printer struct {
	OutputQueue chan *netevent.HTTPNetData
	// contains filtered or unexported fields
}

Printer output parsed http messages

func NewPrinter

func NewPrinter(matchChan chan *netevent.HTTPNetData) *Printer

func (*Printer) Finish

func (p *Printer) Finish()

func (*Printer) Send

func (p *Printer) Send(data *netevent.HTTPNetData)

type ReceiveWindow

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

ReceiveWindow simulate tcp receivec window

type TCPAssembler

type TCPAssembler struct {
	FilterIP   string
	FilterPort uint16
	// contains filtered or unexported fields
}

TCPAssembler do tcp package Assemble

func NewTCPAssembler

func NewTCPAssembler(connectionHandler ConnectionHandler) *TCPAssembler

func (*TCPAssembler) Assemble

func (assembler *TCPAssembler) Assemble(flow gopacket.Flow, tcp *layers.TCP, timestamp time.Time)

func (*TCPAssembler) FinishAll

func (assembler *TCPAssembler) FinishAll()

func (*TCPAssembler) FlushOlderThan

func (assembler *TCPAssembler) FlushOlderThan(time time.Time)

flush timeout connections

type TCPConnection

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

TCPConnection hold info for one tcp connection

Directories

Path Synopsis
Package internal contains HTTP internals shared by net/http and net/http/httputil.
Package internal contains HTTP internals shared by net/http and net/http/httputil.

Jump to

Keyboard shortcuts

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