buffer

package
v2.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	// contains filtered or unexported fields
}

func NewData added in v2.6.5

func NewData(sz int) *Data

func (*Data) Buf

func (d *Data) Buf() []byte

Buf returns this Data's buffer. This is the buffer that should be used everywhere except for the tun.Device ReadPacket and WritePacket methods.

func (*Data) Copy added in v2.7.2

func (d *Data) Copy(n int) *Data

Copy copies n bytes from the given Data buffer into a new Data and returns it.

func (*Data) Raw

func (d *Data) Raw() []byte

Raw returns this Data's raw buffer. This is the buffer that should be used by the tun.Device ReadPacket and WritePacket methods. It uses the same underlying byte array as Buf but might be offset before Buf to allow for leading bytes that are provided before the IP header.

func (*Data) Resize added in v2.7.2

func (d *Data) Resize(size int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL