Documentation ¶
Overview ¶
Package lcp contains a gopacket Layer that implements the PPP Link Control Protocol (LCP).
Index ¶
Constants ¶
const PPPTypeIPXCP = layers.PPPType(0x802B)
const PPPTypeLCP = layers.PPPType(0xc021)
Variables ¶
var ( OptionIPXNetwork = OptionType(1) OptionIPXNode = OptionType(2) OptionIPXCompressionProtocol = OptionType(3) OptionIPXRoutingProtocol = OptionType(4) OptionIPXRouterName = OptionType(5) OptionIPXConfigurationComplete = OptionType(6) )
var ( MessageTooShort = errors.New("LCP message too short") LayerTypeLCP = gopacket.RegisterLayerType(1818, gopacket.LayerTypeMetadata{ Name: "LCP", Decoder: gopacket.DecodeFunc(decodeLCP), }) )
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 ¶
EchoData contains the data that is specific to echo-* messages.
func (*EchoData) MarshalBinary ¶
func (*EchoData) UnmarshalBinary ¶
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) MarshalBinary ¶
func (*LCP) SerializeTo ¶
func (l *LCP) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error
func (*LCP) UnmarshalBinary ¶
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 ¶
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