support

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2018 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const LogAlert = 1

LogAlert = stdlog.h/LOG_ALERT

View Source
const LogCrit = 2

LogCrit = stdlog.h/LOG_CRIT

View Source
const LogDebug = 7

LogDebug = stdlog.h/LOG_DEBUG

View Source
const LogEmerg = 0

LogEmerg = stdlog.h/LOG_EMERG

View Source
const LogErr = 3

LogErr = stdlog.h/LOG_ERR

View Source
const LogInfo = 6

LogInfo = stdlog.h/LOG_INFO

View Source
const LogNotice = 5

LogNotice = stdlog.h/LOG_NOTICE

View Source
const LogWarning = 4

LogWarning = stdlog.h/LOG_WARNING

Variables

This section is empty.

Functions

func CleanCertificateTable

func CleanCertificateTable()

CleanCertificateTable cleans the certificate table by removing stale entries

func CleanConntrackTable

func CleanConntrackTable()

CleanConntrackTable cleans the conntrack table by removing stale entries

func CleanSessionTable

func CleanSessionTable()

CleanSessionTable cleans the session table by removing stale entries

func FindCertificate

func FindCertificate(finder string) (x509.Certificate, bool)

FindCertificate fetches the cached certificate for the argumented address.

func InsertCertificate

func InsertCertificate(finder string, cert x509.Certificate)

InsertCertificate adds a certificate to the cache

func InsertConntrackEntry

func InsertConntrackEntry(finder string, entry ConntrackEntry)

InsertConntrackEntry adds an entry to the conntrack table

func InsertSessionEntry

func InsertSessionEntry(finder string, entry SessionEntry)

InsertSessionEntry adds an entry to the session table

func Int2Ip

func Int2Ip(value uint32) net.IP

Int2Ip converts an IPv4 address from uint32 to net.IP

func LogMessage

func LogMessage(level int, source string, format string, args ...interface{})

LogMessage is called to write messages to the system log

func NextSessionID

func NextSessionID() uint64

NextSessionID returns the next sequential session ID value

func RemoveCertificate

func RemoveCertificate(finder string)

RemoveCertificate removes a certificate from the cache

func RemoveConntrackEntry

func RemoveConntrackEntry(finder string)

RemoveConntrackEntry removes an entry from the conntrack table

func RemoveSessionEntry

func RemoveSessionEntry(finder string)

RemoveSessionEntry removes an entry from the session table

func Startup

func Startup()

Startup is called during daemon startup to handle initialization

func Tuple2String

func Tuple2String(tuple Tuple) string

Tuple2String generates a string from a Tuple for use as a map index

Types

type CertificateHolder

type CertificateHolder struct {
	CreationTime time.Time
	Certificate  x509.Certificate
}

CertificateHolder is used to cache SSL/TLS certificates

type ConntrackEntry

type ConntrackEntry struct {
	ConntrackID     uint
	SessionID       uint64
	SessionCreation time.Time
	SessionActivity time.Time
	SessionTuple    Tuple
	UpdateCount     uint64
	C2Sbytes        uint64
	S2Cbytes        uint64
	TotalBytes      uint64
	C2Srate         float32
	S2Crate         float32
	TotalRate       float32
	PurgeFlag       bool
}

ConntrackEntry stores the details of a conntrack entry

func FindConntrackEntry

func FindConntrackEntry(finder string) (ConntrackEntry, bool)

FindConntrackEntry finds an entry in the conntrack table

type LogWriter

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

LogWriter is used to send an output stream to the LogMessage facility

func NewLogWriter

func NewLogWriter(source string) *LogWriter

NewLogWriter creates an io Writer to steam output to the LogMessage facility

func (*LogWriter) Write

func (w *LogWriter) Write(p []byte) (int, error)

Write takes written data and stores it in a buffer and writes to the log when a line feed is detected

type NetloggerMessage

type NetloggerMessage struct {
	Protocol uint8
	IcmpType uint16
	SrcIntf  uint8
	DstIntf  uint8
	SrcAddr  uint32
	DstAddr  uint32
	SrcPort  uint16
	DstPort  uint16
	Mark     uint32
	Prefix   string
}

NetloggerMessage is used to pass the details of NFLOG events to interested plugins

type SessionEntry

type SessionEntry struct {
	SessionID         uint64
	SessionCreation   time.Time
	SessionActivity   time.Time
	SessionTuple      Tuple
	UpdateCount       uint64
	ServerCertificate x509.Certificate
	ClientLocation    string
	ServerLocation    string
}

SessionEntry stores details related to a session

func FindSessionEntry

func FindSessionEntry(finder string) (SessionEntry, bool)

FindSessionEntry searches for an entry in the session table

type TrafficMessage

type TrafficMessage struct {
	MsgTuple  Tuple
	MsgPacket gopacket.Packet
	MsgLength int
	MsgIP     *layers.IPv4
	MsgTCP    *layers.TCP
	MsgUDP    *layers.UDP
}

TrafficMessage is used to pass netfilter traffic to interested plugins

type Tuple

type Tuple struct {
	Protocol   uint8
	ClientAddr net.IP
	ClientPort uint16
	ServerAddr net.IP
	ServerPort uint16
}

Tuple represent a session using the protocol and source and destination address and port values.

Jump to

Keyboard shortcuts

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