icmp

package
v0.0.0-...-6f44a9b Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolICMP     int = 1
	ProtocolIPv6ICMP int = 58
)

Variables

This section is empty.

Functions

func ParseEchoBody

func ParseEchoBody(b []byte) (*icmp.Echo, error)

ParseEchoBody parses b as an ICMP Echo.

Types

type DestinationUnreachableBody

type DestinationUnreachableBody struct {
	Reserved   uint16
	NextHopMTU uint16
	IpHeader   ipv4.Header
	Data       []byte
}

An DestinationUnreachableBody represents an ICMP destination unreachable message body.

func ParseDestinationUnreachableBody

func ParseDestinationUnreachableBody(b []byte) (*DestinationUnreachableBody, error)

ParseDestinationUnreachableBody parses b as an ICMP DestinationUnreachableBody.

func (*DestinationUnreachableBody) Len

Len returns the ICMP DestinationUnreachableBody length

func (*DestinationUnreachableBody) Marshal

func (p *DestinationUnreachableBody) Marshal() ([]byte, error)

Marshal returns the binary encoding of the ICMP DestinationUnreachableBody .

type RedirectBody

type RedirectBody struct {
	Addr     net.IP // identifier
	IpHeader ipv4.Header
	Data     []byte
}

An RedirectBody represents an ICMP redirect message body.

func ParseRedirectBody

func ParseRedirectBody(b []byte) (*RedirectBody, error)

ParseRedirectBody parses b as an ICMP RedirectBody .

func (*RedirectBody) Len

func (p *RedirectBody) Len() int

Len returns the ICMP RedirectBody length

func (*RedirectBody) Marshal

func (p *RedirectBody) Marshal() ([]byte, error)

Marshal returns the binary encoding of the ICMP RedirectBody .

type TimeExceededBody

type TimeExceededBody struct {
	Reserved int32 // identifier
	IpHeader ipv4.Header
	Data     []byte
}

An TimeExceededBody represents an ICMP time exceeded message body.

func ParseTimeExceedeBody

func ParseTimeExceedeBody(b []byte) (*TimeExceededBody, error)

ParseTimeExceedeBody parses b as an ICMP TimeExceededBody.

func (*TimeExceededBody) Len

func (p *TimeExceededBody) Len() int

Len returns the ICMP TimeExceededBody length

func (*TimeExceededBody) Marshal

func (p *TimeExceededBody) Marshal() ([]byte, error)

Marshal returns the binary encoding of the ICMP TimeExceededBody .

Jump to

Keyboard shortcuts

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