ngnet

package
v0.0.0-...-69b72fb Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPEvent

type HTTPEvent struct {
	Type      string
	Start     time.Time
	End       time.Time
	StreamSeq uint
}

HTTPEvent is HTTP request or response

type HTTPHeaderItem

type HTTPHeaderItem struct {
	Name  string
	Value string
}

HTTPHeaderItem is HTTP header key-value pair

type HTTPRequestEvent

type HTTPRequestEvent struct {
	HTTPEvent
	ClientAddr string
	ServerAddr string
	Method     string
	URI        string
	Version    string
	Headers    []HTTPHeaderItem
	Body       []byte
}

HTTPRequestEvent is HTTP request

type HTTPResponseEvent

type HTTPResponseEvent struct {
	HTTPEvent
	ClientAddr string
	ServerAddr string
	Version    string
	Code       uint
	Reason     string
	Headers    []HTTPHeaderItem
	Body       []byte
}

HTTPResponseEvent is HTTP response

type HTTPStreamFactory

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

HTTPStreamFactory implements StreamFactory interface for tcpassembly

func NewHTTPStreamFactory

func NewHTTPStreamFactory(out chan<- interface{}) HTTPStreamFactory

NewHTTPStreamFactory create a NewHTTPStreamFactory

func (HTTPStreamFactory) New

func (f HTTPStreamFactory) New(netFlow, tcpFlow gopacket.Flow) (ret tcpassembly.Stream)

New creates a HTTPStreamFactory

func (*HTTPStreamFactory) RunningStreamCount

func (f *HTTPStreamFactory) RunningStreamCount() int32

RunningStreamCount get the running stream count

func (HTTPStreamFactory) Wait

func (f HTTPStreamFactory) Wait()

Wait for all stream exit

type StreamDataBlock

type StreamDataBlock struct {
	Bytes []byte
	Seen  time.Time
}

StreamDataBlock is copied from tcpassembly.Reassembly

func NewStreamDataBlock

func NewStreamDataBlock(bytes []byte, seen time.Time) *StreamDataBlock

NewStreamDataBlock create a new StreamDataBlock

type StreamReader

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

StreamReader read data from tcp stream

func NewStreamReader

func NewStreamReader() *StreamReader

NewStreamReader create a new StreamReader

func (*StreamReader) Next

func (s *StreamReader) Next(n int) ([]byte, error)

Next read n bytes from stream

func (*StreamReader) ReadUntil

func (s *StreamReader) ReadUntil(delim []byte) ([]byte, error)

ReadUntil read bytes until delim

Jump to

Keyboard shortcuts

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