icmp

package
v2.5.0-rc.8 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NetworkUnreachable = UnreachableCode(iota)
	HostUnreachable
	ProtocolUnreachable
	PortUnreachable
	MustFragment
	SourceRouteFailed
	DestinationNetworkUnknown
	DestinationHostUnknown
	SourceHostIsolated
	DestinationNetworkProhibited
	DestinationHostProhibited
	NetworkTypeOfService
	HostTypeOfService
	CommunicationProhibited
	HostPrecedenceViolation
	PrecedenceCutoffInEffect
)
View Source
const HeaderLen = 8 // Same for IPv4 and IPv6
View Source
const IPv6MinMTU = 1280 // From RFC 2460, section 5

Variables

This section is empty.

Functions

This section is empty.

Types

type Header []byte

Header represents an ICMP Header. The Header is obtained by simply casting the IP headers payload.

func (Header) Checksum

func (h Header) Checksum() uint16

func (Header) Code

func (h Header) Code() int

func (Header) MessageType

func (h Header) MessageType() int

func (Header) Payload

func (h Header) Payload() []byte

func (Header) RestOfHeader

func (h Header) RestOfHeader() []byte

func (Header) SetChecksum

func (h Header) SetChecksum(ipHdr ip.Header)

func (Header) SetCode

func (h Header) SetCode(c int)

func (Header) SetMessageType

func (h Header) SetMessageType(t int)

type Packet

type Packet interface {
	ip.Packet
	Header() Header
	PayloadLen() int
}

func DestinationUnreachablePacket

func DestinationUnreachablePacket(origHdr ip.Header, code UnreachableCode) Packet

func NewPacket

func NewPacket(ipPayloadLen int, src, dst net.IP) Packet

func PacketFromData

func PacketFromData(ipHdr ip.Header, data *buffer.Data) Packet

type UnreachableCode

type UnreachableCode int

Jump to

Keyboard shortcuts

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