utils

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DedupIntArr added in v0.3.2

func DedupIntArr[T SliceType](arr []T) []T

func IsGREASEUint16

func IsGREASEUint16(v uint16) bool

func ParseUDPPacket added in v0.2.1

func ParseUDPPacket(buf []byte) (*layers.UDP, error)

ParseUDPPacket parses the IP packet

func RewindConn

func RewindConn(c net.Conn, buf []byte) (net.Conn, error)

func RewindReader added in v0.3.0

func RewindReader(r io.Reader, buf []byte) io.Reader

func Uint16ToUint8

func Uint16ToUint8(a []uint16) []uint8

Types

type SliceType added in v0.3.2

type SliceType interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64
}

type Uint8Arr

type Uint8Arr []uint8

Uint8Arr redefines how []uint8 is marshalled to JSON in order to display it as a list of numbers instead of a string

func (Uint8Arr) MarshalJSON

func (u Uint8Arr) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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