netlink

package
v0.0.0-...-3dd6856 Latest Latest
Warning

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

Go to latest
Published: May 20, 2019 License: Apache-2.0, Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NtohsU16

func NtohsU16(n uint16) uint16

NtohsU16 converts an unsigned int16 from network order to host order

func ReplDstIP

func ReplDstIP(c ct.Conn) net.IP

ReplDstIP extracts the dest IP of the reply tuple from a conntrack entry

func ReplSrcIP

func ReplSrcIP(c ct.Conn) net.IP

ReplSrcIP extracts the source IP of the reply tuple from a conntrack entry

Types

type Conntracker

type Conntracker interface {
	GetTranslationForConn(ip string, port uint16) *IPTranslation
	ClearShortLived()
	GetStats() map[string]interface{}
	Close()
}

Conntracker is a wrapper around go-conntracker that keeps a record of all connections in user space

func NewConntracker

func NewConntracker(procRoot string, stbSize int) (Conntracker, error)

NewConntracker creates a new conntracker with a short term buffer capped at the given size

func NewNoOpConntracker

func NewNoOpConntracker() Conntracker

NewNoOpConntracker creates a conntracker which always returns empty information

type IPTranslation

type IPTranslation struct {
	ReplSrcIP   string `json:"repl_src_ip"`
	ReplDstIP   string `json:"repl_dst_ip"`
	ReplSrcPort uint16 `json:"repl_src_port"`
	ReplDstPort uint16 `json:"repl_dst_port"`
}

IPTranslation can be associated with a connection to show show the connection is NAT'd

func (IPTranslation) MarshalEasyJSON

func (v IPTranslation) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (IPTranslation) MarshalJSON

func (v IPTranslation) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*IPTranslation) UnmarshalEasyJSON

func (v *IPTranslation) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*IPTranslation) UnmarshalJSON

func (v *IPTranslation) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

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