Documentation
¶
Overview ¶
Netcap is a framework for network packet processing at the protocol level. Learn more at https://netcap.io.
Index ¶
- Constants
- Variables
- func CloseFile(outDir string, file *os.File, typ string) (name string, size int64)
- func CloseGzipWriters(writers ...*gzip.Writer)
- func Count(filename string) (count int64)
- func CreateFile(name, ext string) *os.File
- func Dump(c DumpConfig)
- func FlushWriters(writers ...flushableWriter)
- func InitRecord(typ types.Type) (record proto.Message)
- func NewHeader(t types.Type, source, version string, includesPayloads bool) *types.Header
- func PrintBuildInfo()
- func PrintLogo()
- func RemoveAuditRecordFileIfEmpty(name string) (size int64)
- type DumpConfig
- type Reader
- type Writer
- func (w *Writer) Close() (name string, size int64)
- func (w *Writer) GetChan() <-chan []byte
- func (w *Writer) IsCSV() bool
- func (w *Writer) Write(msg proto.Message) error
- func (w *Writer) WriteCSV(msg proto.Message) (int, error)
- func (w *Writer) WriteCSVHeader(msg proto.Message) (int, error)
- func (w *Writer) WriteHeader(t types.Type, source string, version string, includesPayloads bool) error
- func (w *Writer) WriteProto(msg proto.Message) error
Constants ¶
const DefaultBufferSize = 1024 * 1024 * 10 // 10MB
Variables ¶
var Commit = "6759e53197c4df3fc56d6e769863cbe7fbd35db2"
var Version = "v0.4.7"
Netcap version.
Functions ¶
func CloseFile ¶ added in v0.4.0
CloseFile closes the netcap file handle and removes files that do only contain a header but no audit records
func CloseGzipWriters ¶ added in v0.4.0
func CreateFile ¶ added in v0.4.0
CreateFile is a wrapper to create new audit record file
func Dump ¶
func Dump(c DumpConfig)
Dump reads the specified netcap file and dumps the output according to the configuration to stdout
func FlushWriters ¶ added in v0.4.0
func FlushWriters(writers ...flushableWriter)
func InitRecord ¶
InitRecord initializes a new record of the given type that conforms to the proto.Message interface if netcap is extended with new audit records they need to be added here as well
func PrintBuildInfo ¶ added in v0.4.4
func PrintBuildInfo()
PrintBuildInfo displays build information related to netcap
func RemoveAuditRecordFileIfEmpty ¶ added in v0.4.0
RemoveAuditRecordFileIfEmpty removes the audit record file if it does not contain audit records
Types ¶
type DumpConfig ¶ added in v0.4.2
type DumpConfig struct { Path string Separator string TabSeparated bool Structured bool Table bool Selection string UTC bool Fields bool JSON bool MemBufferSize int }
DumpConfig contains all possible settings for dumping an audit records
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader implements reading netcap files
func (*Reader) ReadHeader ¶
ReadHeader reads the file header
type Writer ¶ added in v0.4.0
type Writer struct { // Name of the associated audit record type Name string IsChanWriter bool // contains filtered or unexported fields }
Writer is a structure that supports writing audit records to disk
func NewWriter ¶ added in v0.4.0
func NewWriter(name string, buffer, compress, csv bool, out string, writeChan bool, memBufferSize int) *Writer
NewWriter initializes and configures a new Writer
func (*Writer) WriteCSVHeader ¶ added in v0.4.0
WriteCSVHeader writes a CSV record
func (*Writer) WriteHeader ¶ added in v0.4.0
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
Provides a mechanism to collect network packets from a network interface on macOS, linux and windows
|
Provides a mechanism to collect network packets from a network interface on macOS, linux and windows |
This package implements a simple reader and writer for streams of length-delimited byte records.
|
This package implements a simple reader and writer for streams of length-delimited byte records. |
Implements encoders to transform network packets into protocol buffers for various protocols
|
Implements encoders to transform network packets into protocol buffers for various protocols |
Implements IO primitives
|
Implements IO primitives |
Implements mapping alerts from suricata to netcap audit records
|
Implements mapping alerts from suricata to netcap audit records |
Provides primitives for instrumentation via prometheus
|
Provides primitives for instrumentation via prometheus |
Contains the type definitions for the supported network protocols
|
Contains the type definitions for the supported network protocols |