header

package
v0.0.0-...-7a82295 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const IPv4ProtocolNumber tcpip.NetworkProtocolNumber = 0x0800
View Source
const UDPMinimumSize = 8
View Source
const UDPProtocolNumber tcpip.TransportProtocolNumber = 17

Variables

This section is empty.

Functions

func Checksum

func Checksum(buf []byte, initial uint16) uint16

func ChecksumCombine

func ChecksumCombine(a, b uint16) uint16

func PseudoHeaderChecksum

func PseudoHeaderChecksum(protocol tcpip.TransportProtocolNumber, srcAddr tcpip.Address, dstAddr tcpip.Address) uint16

Types

type UDP

type UDP []byte

func (UDP) CalculateChecksum

func (b UDP) CalculateChecksum(partialChecksum uint16, totalLen uint16) uint16

func (UDP) Checksum

func (b UDP) Checksum() uint16

func (UDP) DestinationPort

func (b UDP) DestinationPort() uint16

func (UDP) Encode

func (b UDP) Encode(u *UDPFields)

func (UDP) Length

func (b UDP) Length() uint16

func (UDP) Payload

func (b UDP) Payload() []byte

func (UDP) SetChecksum

func (b UDP) SetChecksum(checksum uint16)

func (UDP) SetDestinationPort

func (b UDP) SetDestinationPort(port uint16)

func (UDP) SetSourcePort

func (b UDP) SetSourcePort(port uint16)

func (UDP) SourcePort

func (b UDP) SourcePort() uint16

type UDPFields

type UDPFields struct {
	SrcPort  uint16
	DstPort  uint16
	Length   uint16
	Checksum uint16
}

Jump to

Keyboard shortcuts

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