exportwriter

package
v0.0.0-...-5327f33 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExportElement

type ExportElement struct {
	SrcIP        string  `json:"srcIp"`
	DstIP        string  `json:"dstIp"`
	SrcPort      float64 `json:"srcPort"`
	DstPort      float64 `json:"dstPort"`
	CreateDate   string  `json:"create_date"`
	ProtocolType float64 `json:"protocol_type"`
	ProtocolText string  `json:"protocol_text"`
	PayloadType  float64 `json:"payload_type"`
	PayloadText  string  `json:"payload_text"`
	Message      string  `json:"msg_color"`
	TimeSeconds  float64 `json:"timeSeconds"`
	TimeUseconds float64 `json:"timeUSeconds"`
	CaptureID    float64 `json:"capture_id"`
}

type Writer

type Writer struct {
	Buffer bytes.Buffer
	// contains filtered or unexported fields
}

Writer wraps an underlying o.Writer to write packet data in PCAP format. See http://wiki.wireshark.org/Development/LibpcapFileFormat for information on the file format.

For those that care, we currently write v2.4 files with nanosecond or microsecond timestamp resolution and little-endian encoding.

func NewWriter

func NewWriter(buf bytes.Buffer) *Writer

func NewWriterNanos

func NewWriterNanos(buf bytes.Buffer) *Writer

func (*Writer) WriteDataPcapBuffer

func (w *Writer) WriteDataPcapBuffer(h *gabs.Container) error

WriteDataToBuffer writes a file header out to the writer. This must be called exactly once per output.

func (*Writer) WriteDataToBuffer

func (w *Writer) WriteDataToBuffer(h *gabs.Container) error

WriteDataToBuffer writes a file header out to the writer. This must be called exactly once per output.

func (*Writer) WritePcapHeader

func (w *Writer) WritePcapHeader(snaplen uint32, linkType uint32) error

WriteFileHeader writes a file header out to the writer. This must be called exactly once per output.

func (*Writer) WritePcapPacket

func (w *Writer) WritePcapPacket(ci gopacket.CaptureInfo, data []byte) error

WritePacket writes the given packet data out to the file.

Jump to

Keyboard shortcuts

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