udp

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package udp implements the UDP header support in Lucius.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UDP

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

An UDP represents a UDP header in the packet. It can add, remove and update the UDP header. The UDP payload is treated as OPAQUE.

func (*UDP) Field

func (udp *UDP) Field(id fwdpacket.FieldID) ([]byte, error)

Field finds bytes within the UDP header.

func (*UDP) Header

func (udp *UDP) Header() []byte

Header returns the UDP header.

func (UDP) ID

ID returns the UDP protocol header ID.

func (UDP) Modify

func (UDP) Modify(_ fwdpb.PacketHeaderId) error

Modify returns an error as the UDP header has not extensions.

func (*UDP) Rebuild

func (udp *UDP) Rebuild() error

Rebuild updates the UDP header length and csum (if over IPv6).

func (*UDP) Remove

func (udp *UDP) Remove(id fwdpb.PacketHeaderId) error

Remove removes the UDP header.

func (UDP) Trailer

func (UDP) Trailer() []byte

Trailer returns the no trailing bytes.

func (*UDP) UpdateField

func (udp *UDP) UpdateField(id fwdpacket.FieldID, op int, arg []byte) (bool, error)

UpdateField sets bytes within the UDP header.

Jump to

Keyboard shortcuts

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