MCPcopy Create free account
hub / github.com/google/nftables / StringWithLength

Method StringWithLength

alignedbuff/alignedbuff.go:160–164  ·  view source on GitHub ↗

StringWithLength unmarshals a string of a given length (for non-null terminated strings)

(len int)

Source from the content-addressed store, hash-verified

158// StringWithLength unmarshals a string of a given length (for non-null
159// terminated strings)
160func (a *AlignedBuff) StringWithLength(len int) (string, error) {
161 v := binaryutil.String(a.data[a.pos : a.pos+len])
162 a.pos += len
163 return v, nil
164}
165
166// Uint unmarshals an uint in native endianess and alignment for the C "unsigned
167// int" type. It returns ErrEOF when trying to read beyond the payload. Please

Callers 1

TestAlignedBuffPutStringFunction · 0.80

Calls 1

StringFunction · 0.92

Tested by 1

TestAlignedBuffPutStringFunction · 0.64