MCPcopy
hub / github.com/google/gopacket / LayerString

Function LayerString

packet.go:216–218  ·  view source on GitHub ↗

LayerString outputs an individual layer as a string. The layer is output in a single line, with no trailing newline. This function is specifically designed to do the right thing for most layers... it follows the following rules: * If the Layer has a String function, just output that. * Otherwise,

(l Layer)

Source from the content-addressed store, hash-verified

214// Payload layer and it's internal 'data' field, which contains a large byte
215// array that would really mess up formatting.
216func LayerString(l Layer) string {
217 return fmt.Sprintf("%v\t%s", l.LayerType(), layerString(reflect.ValueOf(l), false, false))
218}
219
220// Dumper dumps verbose information on a value. If a layer type implements
221// Dumper, then its LayerDump() string will include the results in its output.

Callers 4

FuzzLayerFunction · 0.92
TestDNSPacketWriteAnswerFunction · 0.92
LayerDumpFunction · 0.85
packetStringMethod · 0.85

Calls 2

layerStringFunction · 0.85
LayerTypeMethod · 0.65

Tested by 1

TestDNSPacketWriteAnswerFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…