gtcpip

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPPacket

type IPPacket interface {
	header.Network
	IsValid(int) bool
	HeaderLength() uint8
	PayloadLength() uint16
	ResetChecksum()
	PseudoHeaderChecksum() uint16
}

func NewIPPacket

func NewIPPacket(b []byte) IPPacket

return nil if b is invalid

type IPv4

type IPv4 struct {
	header.IPv4 // IPv4 contains both header and payload
}

func (*IPv4) PseudoHeaderChecksum

func (ipv4 *IPv4) PseudoHeaderChecksum() uint16

func (*IPv4) ResetChecksum

func (ipv4 *IPv4) ResetChecksum()

type IPv6

type IPv6 struct {
	header.IPv6 // IPv6 contains both header and payload
}

func (*IPv6) HeaderLength

func (ipv6 *IPv6) HeaderLength() uint8

func (*IPv6) PseudoHeaderChecksum

func (ipv6 *IPv6) PseudoHeaderChecksum() uint16

func (*IPv6) ResetChecksum

func (ipv6 *IPv6) ResetChecksum()

type TCP

type TCP struct {
	header.TCP
}

func (*TCP) ResetChecksum

func (tcp *TCP) ResetChecksum(pseudoSum uint16)

type UDP

type UDP struct {
	header.UDP // UDP contains both header and payload
}

func (*UDP) ResetChecksum

func (udp *UDP) ResetChecksum(pseudoSum uint16)

recalculate checksum and set it

Jump to

Keyboard shortcuts

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