lcp

package
v0.0.0-...-c5474ca Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package lcp contains a gopacket Layer that implements the PPP Link Control Protocol (LCP).

Index

Constants

View Source
const PPPTypeIPXCP = layers.PPPType(0x802B)
View Source
const PPPTypeLCP = layers.PPPType(0xc021)

Variables

View Source
var (
	OptionIPXNetwork               = OptionType(1)
	OptionIPXNode                  = OptionType(2)
	OptionIPXCompressionProtocol   = OptionType(3)
	OptionIPXRoutingProtocol       = OptionType(4)
	OptionIPXRouterName            = OptionType(5)
	OptionIPXConfigurationComplete = OptionType(6)
)
View Source
var (
	MessageTooShort = errors.New("LCP message too short")

	LayerTypeLCP = gopacket.RegisterLayerType(1818, gopacket.LayerTypeMetadata{
		Name:    "LCP",
		Decoder: gopacket.DecodeFunc(decodeLCP),
	})
)
View Source
var (
	OptionMRU                       = OptionType(1)
	OptionAuthProtocol              = OptionType(3)
	OptionQualityProtocol           = OptionType(4)
	OptionMagicNumber               = OptionType(5)
	OptionProtocolFieldCompression  = OptionType(7)
	OptionAddressControlCompression = OptionType(8)
)

Functions

This section is empty.

Types

type ConfigureData

type ConfigureData struct {
	Options []Option
}

ConfigureData contains the data that is specific to Configure-* messages.

func (*ConfigureData) MarshalBinary

func (d *ConfigureData) MarshalBinary() (data []byte, err error)

func (*ConfigureData) UnmarshalBinary

func (d *ConfigureData) UnmarshalBinary(data []byte) error

type EchoData

type EchoData struct {
	MagicNumber uint32
	Data        []byte
}

EchoData contains the data that is specific to echo-* messages.

func (*EchoData) MarshalBinary

func (d *EchoData) MarshalBinary() (data []byte, err error)

func (*EchoData) UnmarshalBinary

func (d *EchoData) UnmarshalBinary(data []byte) error

type LCP

type LCP struct {
	layers.BaseLayer
	Type       MessageType
	Identifier uint8
	Data       PerTypeData
}

LCP is a gopacket layer for the Link Control Protocol and and other dialects that reuse the same wire format.

func (*LCP) LayerType

func (l *LCP) LayerType() gopacket.LayerType

func (*LCP) MarshalBinary

func (l *LCP) MarshalBinary() (data []byte, err error)

func (*LCP) SerializeTo

func (l *LCP) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

func (*LCP) UnmarshalBinary

func (l *LCP) UnmarshalBinary(data []byte) error

type MessageType

type MessageType uint8
const (
	ConfigureRequest MessageType = iota + 1
	ConfigureAck
	ConfigureNak
	ConfigureReject
	TerminateRequest
	TerminateAck
	CodeReject
	ProtocolReject
	EchoRequest
	EchoReply
	DiscardRequest
)

type Option

type Option struct {
	Type OptionType
	Data []byte
}

type OptionType

type OptionType uint8

OptionType identifies an LCP option, at least in the context of the particular dialect of LCP being used - the same ID will have different meanings in LCP, IPXCP, etc.

type PerTypeData

type PerTypeData interface {
	encoding.BinaryUnmarshaler
	encoding.BinaryMarshaler
}

PerTypeData specifies a common interface that is implemented by other types that represent per-message-type data.

type ProtocolRejectData

type ProtocolRejectData struct {
	PPPType layers.PPPType
	Data    []byte
}

ProtocolRejectData contains data that is sent in Protocol-Reject messages.

func (*ProtocolRejectData) MarshalBinary

func (d *ProtocolRejectData) MarshalBinary() ([]byte, error)

func (*ProtocolRejectData) UnmarshalBinary

func (d *ProtocolRejectData) UnmarshalBinary(data []byte) error

type TerminateData

type TerminateData struct {
	Data []byte
}

TerminateData contains the data that is specific to Terminate-* messages.

func (*TerminateData) MarshalBinary

func (d *TerminateData) MarshalBinary() (data []byte, err error)

func (*TerminateData) UnmarshalBinary

func (d *TerminateData) UnmarshalBinary(data []byte) error

Jump to

Keyboard shortcuts

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