icmp

package
v0.0.0-...-d82030c Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ICMP_HEADER_SIZE = 8

Variables

This section is empty.

Functions

func Init

func Init() error

func Output

func Output(icmpType Type, code uint8, value uint32, data []byte, src ip.Address, dst ip.Address) error

Types

type Datagram

type Datagram[H any] struct {
	Header *H
	Data   []byte
}

type Echo

type Echo struct {
	Type           Type
	Code           uint8
	Checksum       uint16
	ID             uint16
	SequenceNumber uint16
}
type Header struct {
	Type     Type
	Code     uint8
	Checksum uint16
	Value    uint32
}

type Type

type Type uint8
const (
	ICMP_TYPE_ECHOREPLY      Type = 0
	ICMP_TYPE_DEST_UNREACH   Type = 3
	ICMP_TYPE_SOURCE_QUENCH  Type = 4
	ICMP_TYPE_REDIRECT       Type = 5
	ICMP_TYPE_ECHO           Type = 8
	ICMP_TYPE_TIME_EXCEEDED  Type = 11
	ICMP_TYPE_PARAM_PROBLEM  Type = 12
	ICMP_TYPE_TIMESTAMP      Type = 13
	ICMP_TYPE_TIMESTAMPREPLY Type = 14
	ICMP_TYPE_INFO_REQUEST   Type = 15
	ICMP_TYPE_INFO_REPLY     Type = 16
)

func (*Type) String

func (t *Type) String() string

Jump to

Keyboard shortcuts

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