MCPcopy Index your code
hub / github.com/dreadl0ck/netcap / Decoder

Struct Decoder

decoder/packet/packet_decoder.go:66–97  ·  view source on GitHub ↗

Decoder implements custom logic to decode data from a gopacket.Packet this structure has an optimized field order to avoid excessive padding.

Source from the content-addressed store, hash-verified

64 // Decoder implements custom logic to decode data from a gopacket.Packet
65 // this structure has an optimized field order to avoid excessive padding.
66 Decoder struct {
67
68 // used to keep track of the number of generated audit records
69 NumRecordsWritten int64
70
71 // Name of the decoder
72 Name string
73
74 // Description of the decoder
75 Description string
76
77 // Icon name for the decoder (for Maltego)
78 Icon string
79
80 // Handler to process packets
81 Handler packetDecoderHandler
82
83 // init functions
84 PostInit func(*Decoder) error
85 DeInit func(*Decoder) error
86
87 // FlushState is called during live capture to write current state without clearing it.
88 // This allows accumulating decoders (DeviceProfile, IPProfile, Connection) to periodically
89 // make their data visible while continuing to track state.
90 FlushState func(*Decoder) int64
91
92 // Writer for audit records
93 Writer io.AuditRecordWriter
94
95 // Type of the audit records produced by this decoder
96 Type types.Type
97 }
98
99 // DecoderAPI PacketDecoderAPI describes an interface that all custom decoders need to implement
100 // this allows to supply a custom structure and maintain state for advanced protocol analysis.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected