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

Function baseLayerString

packet.go:332–347  ·  view source on GitHub ↗
(value reflect.Value)

Source from the content-addressed store, hash-verified

330}
331
332func baseLayerString(value reflect.Value) string {
333 t := value.Type()
334 content := value.Field(0)
335 c := make([]byte, content.Len())
336 for i := range c {
337 c[i] = byte(content.Index(i).Uint())
338 }
339 payload := value.Field(1)
340 p := make([]byte, payload.Len())
341 for i := range p {
342 p[i] = byte(payload.Index(i).Uint())
343 }
344 return fmt.Sprintf("%s{Contents:%s, Payload:%s}", t.String(),
345 LongBytesGoString(c),
346 LongBytesGoString(p))
347}
348
349func layerGoString(i interface{}, b *bytes.Buffer) {
350 if s, ok := i.(fmt.GoStringer); ok {

Callers 1

layerGoStringFunction · 0.85

Calls 4

LongBytesGoStringFunction · 0.85
StringMethod · 0.65
TypeMethod · 0.45
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…