MCPcopy
hub / github.com/dreadl0ck/netcap / Encode

Method Encode

types/bfd.go:158–180  ·  view source on GitHub ↗

Encode will encode categorical values and normalize according to configuration

()

Source from the content-addressed store, hash-verified

156
157// Encode will encode categorical values and normalize according to configuration
158func (b *BFD) Encode() []string {
159 return filter([]string{
160 bfdEncoder.Int64(fieldTimestamp, b.Timestamp),
161 bfdEncoder.Int32(fieldVersion, b.Version), // int32
162 bfdEncoder.Int32(fieldDiagnostic, b.Diagnostic), // int32
163 bfdEncoder.Int32(fieldState, b.State), // int32
164 bfdEncoder.Bool(b.Poll), // bool
165 bfdEncoder.Bool(b.Final), // bool
166 bfdEncoder.Bool(b.ControlPlaneIndependent), // bool
167 bfdEncoder.Bool(b.AuthPresent), // bool
168 bfdEncoder.Bool(b.Demand), // bool
169 bfdEncoder.Bool(b.Multipoint), // bool
170 bfdEncoder.Int32(fieldDetectMultiplier, b.DetectMultiplier), // int32
171 bfdEncoder.Int32(fieldMyDiscriminator, b.MyDiscriminator), // int32
172 bfdEncoder.Int32(fieldYourDiscriminator, b.YourDiscriminator), // int32
173 bfdEncoder.Int32(fieldDesiredMinTxInterval, b.DesiredMinTxInterval), // int32
174 bfdEncoder.Int32(fieldRequiredMinRxInterval, b.RequiredMinRxInterval), // int32
175 bfdEncoder.Int32(fieldRequiredMinEchoRxInterval, b.RequiredMinEchoRxInterval), // int32
176
177 // TODO: flatten as top level fields? also for CSV!
178 // bfdEncoder.Int32(b.AuthHeader.getString()), // *BFDAuthHeader
179 })
180}
181
182// Analyze will invoke the configured analyzer for the audit record and return a score.
183func (b *BFD) Analyze() {

Callers

nothing calls this directly

Calls 4

filterFunction · 0.85
Int64Method · 0.80
Int32Method · 0.80
BoolMethod · 0.80

Tested by

no test coverage detected