Documentation ¶
Index ¶
- Constants
- Variables
- type AreaAddressesTLV
- type AuthenticationTLV
- type CSNP
- type ChecksumTLV
- type DynamicHostNameTLV
- type ExtendedIPReachability
- type ExtendedIPReachabilityTLV
- type ExtendedISReachabilityNeighbor
- type ExtendedISReachabilityTLV
- type IPInterfaceAddressesTLV
- type IPv4AddressSubTLV
- type ISISHeader
- type ISISPacket
- type ISNeighborsTLV
- type ISReachabilityTLV
- type L2Hello
- type LSPDU
- type LSPEntriesTLV
- type LSPEntry
- type LSPID
- type LinkLocalRemoteIdentifiersSubTLV
- type P2PAdjacencyStateTLV
- type P2PHello
- func (h *P2PHello) GetAreaAddressesTLV() *AreaAddressesTLV
- func (h *P2PHello) GetIPInterfaceAddressesesTLV() *IPInterfaceAddressesTLV
- func (h *P2PHello) GetP2PAdjTLV() *P2PAdjacencyStateTLV
- func (h *P2PHello) GetProtocolsSupportedTLV() *ProtocolsSupportedTLV
- func (h *P2PHello) Serialize(buf *bytes.Buffer)
- type PSNP
- type PaddingTLV
- type ProtocolsSupportedTLV
- type TLV
- type TrafficEngineeringRouterIDTLV
- type UnknownTLV
Constants ¶
const ( P2PHelloMinLen = 20 ISISHeaderLen = 8 L2CircuitType = 2 )
const ( L1_LAN_HELLO_TYPE = 0x0f L1_LS_PDU_TYPE = 0x18 L1_CSNP_TYPE = 0x24 L1_PSNP_TYPE = 0x26 L2_LAN_HELLO_TYPE = 0x10 L2_LS_PDU_TYPE = 0x14 L2_CSNP_TYPE = 0x19 L2_PSNP_TYPE = 0x1b P2P_HELLO = 0x11 DOWN_STATE = 2 INITIALIZING_STATE = 1 UP_STATE = 0 )
const ( LSPIDLen = 8 LSPDUMinLen = 19 MODX = 5802 )
const ( // ExtendedIPReachabilityTLVType is the type value of an Extended IP Reachability TLV ExtendedIPReachabilityTLVType = 135 // ExtendedIPReachabilityLength is the length of an Extended IP Reachability excluding Sub TLVs ExtendedIPReachabilityLength = 9 )
const ( // ExtendedISReachabilityType is the type value of an Extended IS Reachability TLV ExtendedISReachabilityType = 22 // LinkLocalRemoteIdentifiersSubTLVType is the type value of an Link Local/Remote Indentifiers Sub TLV LinkLocalRemoteIdentifiersSubTLVType = 4 // IPv4InterfaceAddressSubTLVType is the type value of an IPv4 interface address sub TLV IPv4InterfaceAddressSubTLVType = 6 // IPv4NeighborAddressSubTLVType is the type value of an IPv4 neighbor address sub TLV IPv4NeighborAddressSubTLVType = 8 )
const ( // P2PAdjacencyStateTLVType is the type value of an P2P adjacency state TLV P2PAdjacencyStateTLVType = uint8(240) // P2PAdjacencyStateTLVLenWithoutNeighbor is the length of this TLV without a neighbor P2PAdjacencyStateTLVLenWithoutNeighbor = 5 //P2PAdjacencyStateTLVLenWithNeighbor is the length of this TLV including a neighbor P2PAdjacencyStateTLVLenWithNeighbor = 15 )
const ( // ProtocolsSupportedTLVType is the type value of an protocols supported TLV ProtocolsSupportedTLVType = 129 // NLPIDIPv4 is the Network Layer Protocol ID for IPv4 NLPIDIPv4 = uint8(0xcc) // NLPIDIPv6 is the Network Layer Protocol ID for IPv6 NLPIDIPv6 = uint8(0x8e) )
const AreaAddressesTLVType = 1
AreaAddressesTLVType is the type value of an area address TLV
const AuthenticationType = 10
AuthenticationType is the type value of an authentication TLV
const ( // CSNPMinLen is the minimal length of a CSNP CSNPMinLen = PSNPMinLen + 16 )
const ChecksumTLVType = 12
ChecksumTLVType is the type value of a checksum TLV
const DynamicHostNameTLVType = 137
DynamicHostNameTLVType is the type value of dynamic hostname TLV
const (
HeaderLen = 8
)
const IPInterfaceAddressesTLVType = 132
IPInterfaceAddressesTLVType is the type value of an IP interface address TLV
const ISNeighborsTLVLength = 8
ISNeighborsTLVLength is the length of an IS Neighbor TLV
const ISNeighborsTLVType = 6
ISNeighborsTLVType is the type value of an IS Neighbor TLV
const ISReachabilityTLVType = 2
ISReachabilityTLVType is the type value of an IS reachability TLV
const ( // LSPEntriesTLVType is the type value of an LSP Entries TLV LSPEntriesTLVType = uint8(9) )
const (
// LSPEntryLen is the lenth of an LSPEntry
LSPEntryLen = 16
)
const (
// PSNPMinLen is the minimal length of PSNP PDU
PSNPMinLen = 17
)
const PaddingType = 8
PaddingType is the type value of a padding TLV
const (
// TrafficEngineeringRouterIDTLVType is the type value of an Traffic Engineering Router ID TLV
TrafficEngineeringRouterIDTLVType = 134
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AreaAddressesTLV ¶
AreaAddressesTLV represents an area address TLV
func NewAreaAddressesTLV ¶
func NewAreaAddressesTLV(areas []types.AreaID) *AreaAddressesTLV
NewAreaAddressesTLV creates a new area addresses TLV
func (*AreaAddressesTLV) Length ¶
func (a *AreaAddressesTLV) Length() uint8
Length gets the length of the TLV
func (*AreaAddressesTLV) Serialize ¶
func (a *AreaAddressesTLV) Serialize(buf *bytes.Buffer)
Serialize serializes an area address TLV
func (*AreaAddressesTLV) Type ¶
func (a *AreaAddressesTLV) Type() uint8
Type gets the type of the TLV
func (*AreaAddressesTLV) Value ¶
func (a *AreaAddressesTLV) Value() interface{}
Value gets the TLV itself
type AuthenticationTLV ¶
type AuthenticationTLV struct { TLVType uint8 TLVLength uint8 AuthenticationType uint8 Password []byte }
AuthenticationTLV represents an authentication TLV
type CSNP ¶
type CSNP struct { PDULength uint16 SourceID types.SourceID StartLSPID LSPID EndLSPID LSPID TLVs []TLV }
CSNP represents a Complete Sequence Number PDU
func DecodeCSNP ¶
DecodeCSNP decodes Complete Sequence Number PDUs
func (*CSNP) GetLSPEntries ¶
GetLSPEntries returns LSP Entries from the LSP Entries TLV
type ChecksumTLV ¶
ChecksumTLV represents a checksum TLV
func (*ChecksumTLV) Serialize ¶
func (c *ChecksumTLV) Serialize(buf *bytes.Buffer)
Serialize serializes a checksum TLV
type DynamicHostNameTLV ¶
DynamicHostNameTLV represents a dynamic Hostname TLV
func NewDynamicHostnameTLV ¶
func NewDynamicHostnameTLV(name []byte) *DynamicHostNameTLV
NewDynamicHostnameTLV creates a new dynamic hostname TLV
func (*DynamicHostNameTLV) Length ¶
func (d *DynamicHostNameTLV) Length() uint8
Length gets the length of the TLV
func (*DynamicHostNameTLV) Serialize ¶
func (d *DynamicHostNameTLV) Serialize(buf *bytes.Buffer)
Serialize serializes a dynamic hostname TLV
func (*DynamicHostNameTLV) Type ¶
func (d *DynamicHostNameTLV) Type() uint8
Type gets the type of the TLV
func (*DynamicHostNameTLV) Value ¶
func (d *DynamicHostNameTLV) Value() interface{}
Value returns the TLV itself
type ExtendedIPReachability ¶
type ExtendedIPReachability struct { Metric uint32 UDSubBitPfxLen uint8 Address uint32 SubTLVs []TLV }
ExtendedIPReachability is the Extended IP Reachability Part of an ExtendedIPReachabilityTLV
func (*ExtendedIPReachability) PfxLen ¶
func (e *ExtendedIPReachability) PfxLen() uint8
PfxLen returns the prefix length
func (*ExtendedIPReachability) Serialize ¶
func (e *ExtendedIPReachability) Serialize(buf *bytes.Buffer)
Serialize serializes an ExtendedIPReachability
type ExtendedIPReachabilityTLV ¶
type ExtendedIPReachabilityTLV struct { TLVType uint8 TLVLength uint8 ExtendedIPReachabilities []*ExtendedIPReachability }
ExtendedIPReachabilityTLV is an Extended IP Reachability TLV
func NewExtendedIPReachabilityTLV ¶
func NewExtendedIPReachabilityTLV() *ExtendedIPReachabilityTLV
NewExtendedIPReachabilityTLV creates a new ExtendedIPReachabilityTLV
func (*ExtendedIPReachabilityTLV) Length ¶
func (e *ExtendedIPReachabilityTLV) Length() uint8
Length gets the length of the TLV
func (*ExtendedIPReachabilityTLV) Serialize ¶
func (e *ExtendedIPReachabilityTLV) Serialize(buf *bytes.Buffer)
Serialize serializes an ExtendedIPReachabilityTLV
func (*ExtendedIPReachabilityTLV) Type ¶
func (e *ExtendedIPReachabilityTLV) Type() uint8
Type gets the type of the TLV
func (*ExtendedIPReachabilityTLV) Value ¶
func (e *ExtendedIPReachabilityTLV) Value() interface{}
Value returns the TLV itself
type ExtendedISReachabilityNeighbor ¶
type ExtendedISReachabilityNeighbor struct { NeighborID types.SourceID Metric [3]byte SubTLVLength uint8 SubTLVs []TLV }
ExtendedISReachabilityNeighbor is an extended IS Reachability Neighbor
func NewExtendedISReachabilityNeighbor ¶
func NewExtendedISReachabilityNeighbor(neighborID types.SourceID, metric [3]byte) *ExtendedISReachabilityNeighbor
NewExtendedISReachabilityNeighbor creates a new ExtendedISReachabilityNeighbor
func (*ExtendedISReachabilityNeighbor) AddSubTLV ¶
func (e *ExtendedISReachabilityNeighbor) AddSubTLV(tlv TLV)
AddSubTLV adds a sub TLV to the ExtendedISReachabilityNeighbor
func (*ExtendedISReachabilityNeighbor) Serialize ¶
func (e *ExtendedISReachabilityNeighbor) Serialize(buf *bytes.Buffer)
Serialize serializes an ExtendedISReachabilityNeighbor
type ExtendedISReachabilityTLV ¶
type ExtendedISReachabilityTLV struct { TLVType uint8 TLVLength uint8 Neighbors []*ExtendedISReachabilityNeighbor }
ExtendedISReachabilityTLV is an Extended IS Reachability TLV
func NewExtendedISReachabilityTLV ¶
func NewExtendedISReachabilityTLV() *ExtendedISReachabilityTLV
NewExtendedISReachabilityTLV creates a new Extended IS Reachability TLV
func (*ExtendedISReachabilityTLV) Length ¶
func (e *ExtendedISReachabilityTLV) Length() uint8
Length gets the length of the TLV
func (*ExtendedISReachabilityTLV) Serialize ¶
func (e *ExtendedISReachabilityTLV) Serialize(buf *bytes.Buffer)
Serialize serializes an ExtendedISReachabilityTLV
func (*ExtendedISReachabilityTLV) Type ¶
func (e *ExtendedISReachabilityTLV) Type() uint8
Type gets the type of the TLV
func (*ExtendedISReachabilityTLV) Value ¶
func (e *ExtendedISReachabilityTLV) Value() interface{}
Value returns the TLV itself
type IPInterfaceAddressesTLV ¶
IPInterfaceAddressesTLV represents an IP interface TLV
func NewIPInterfaceAddressesTLV ¶
func NewIPInterfaceAddressesTLV(addrs []uint32) *IPInterfaceAddressesTLV
NewIPInterfaceAddressesTLV creates a new IPInterfaceAddressesTLV
func (IPInterfaceAddressesTLV) Length ¶
func (i IPInterfaceAddressesTLV) Length() uint8
Length returns the length of the TLV
func (IPInterfaceAddressesTLV) Serialize ¶
func (i IPInterfaceAddressesTLV) Serialize(buf *bytes.Buffer)
Serialize serializes an IP interfaces address TLV
func (IPInterfaceAddressesTLV) Type ¶
func (i IPInterfaceAddressesTLV) Type() uint8
Type returns the type of the TLV
func (IPInterfaceAddressesTLV) Value ¶
func (i IPInterfaceAddressesTLV) Value() interface{}
Value gets the TLV itself
type IPv4AddressSubTLV ¶
IPv4AddressSubTLV is an IPv4 Address Sub TLV (used for both interface and neighbor)
func NewIPv4InterfaceAddressSubTLV ¶
func NewIPv4InterfaceAddressSubTLV(addr uint32) *IPv4AddressSubTLV
NewIPv4InterfaceAddressSubTLV creates a new IPv4 Interface Address Sub TLV
func NewIPv4NeighborAddressSubTLV ¶
func NewIPv4NeighborAddressSubTLV(addr uint32) *IPv4AddressSubTLV
NewIPv4NeighborAddressSubTLV creates a new IPv4 Neighbor Address Sub TLV
func (*IPv4AddressSubTLV) Length ¶
func (s *IPv4AddressSubTLV) Length() uint8
Length gets the length of the TLV
func (*IPv4AddressSubTLV) Serialize ¶
func (s *IPv4AddressSubTLV) Serialize(buf *bytes.Buffer)
Serialize serializes an IPv4 address sub TLV
func (*IPv4AddressSubTLV) Type ¶
func (s *IPv4AddressSubTLV) Type() uint8
Type gets the type of the TLV
func (*IPv4AddressSubTLV) Value ¶
func (s *IPv4AddressSubTLV) Value() interface{}
Value returns the TLV itself
type ISISHeader ¶
type ISISHeader struct { ProtoDiscriminator uint8 LengthIndicator uint8 ProtocolIDExtension uint8 IDLength uint8 PDUType uint8 Version uint8 MaxAreaAddresses uint8 }
ISISHeader represents an ISIS header
func DecodeHeader ¶
func DecodeHeader(buf *bytes.Buffer) (*ISISHeader, error)
DecodeHeader decodes an ISIS header
func (*ISISHeader) Serialize ¶
func (h *ISISHeader) Serialize(buf *bytes.Buffer)
Serialize serializes an ISIS header
type ISISPacket ¶
type ISISPacket struct { Header *ISISHeader Body interface{} }
ISISPacket represents an ISIS packet
type ISNeighborsTLV ¶
ISNeighborsTLV represents an IS Neighbor TLV
func (ISNeighborsTLV) Length ¶
func (i ISNeighborsTLV) Length() uint8
Length returns the length of the TLV
func (ISNeighborsTLV) Serialize ¶
func (i ISNeighborsTLV) Serialize(buf *bytes.Buffer)
Serialize serializes an WriteByte into a buffer
func (ISNeighborsTLV) Value ¶
func (i ISNeighborsTLV) Value() interface{}
Value returns the TLV itself
type ISReachabilityTLV ¶
type ISReachabilityTLV struct { TLVType uint8 TLVLength uint8 VirtualFlag uint8 RIEDefaultMetric uint8 SIEDelayMetric uint8 SIEExpenseMetric uint8 SIEErrorMetric uint8 NeighborID [7]byte }
ISReachabilityTLV represents an IS reachability TLV
type L2Hello ¶
type L2Hello struct { CircuitType uint8 SystemID [6]byte HoldingTimer uint16 PDULength uint16 Priority uint8 DesignatedIS [6]byte TLVs []TLV }
L2Hello represents a broadcast L2 hello
type LSPDU ¶
type LSPDU struct { Length uint16 RemainingLifetime uint16 LSPID LSPID SequenceNumber uint32 Checksum uint16 TypeBlock uint8 TLVs []TLV }
LSPDU represents a link state PDU
func (*LSPDU) SerializeChecksumRelevant ¶
SerializeChecksumRelevant serializes all fields after the Remaining Lifetime field.
type LSPEntriesTLV ¶
LSPEntriesTLV is an LSP Entries TLV carried in PSNP/CSNP
func NewLSPEntriesTLV ¶
func NewLSPEntriesTLV(LSPEntries []*LSPEntry) *LSPEntriesTLV
NewLSPEntriesTLV creates a nbew LSP Entries TLV
func (*LSPEntriesTLV) Length ¶
func (l *LSPEntriesTLV) Length() uint8
Length returns the length of the TLV
func (*LSPEntriesTLV) Serialize ¶
func (l *LSPEntriesTLV) Serialize(buf *bytes.Buffer)
Serialize serializes an LSP Entries TLV
type LSPEntry ¶
type LSPEntry struct { RemainingLifetime uint16 LSPID LSPID SequenceNumber uint32 LSPChecksum uint16 }
LSPEntry represents an LSP entry in a CSNP PDU
type LSPID ¶
LSPID represents a Link State Packet ID
type LinkLocalRemoteIdentifiersSubTLV ¶
type LinkLocalRemoteIdentifiersSubTLV struct { TLVType uint8 TLVLength uint8 Local uint32 Remote uint32 }
LinkLocalRemoteIdentifiersSubTLV is an Link Local/Remote Identifiers Sub TLV
func NewLinkLocalRemoteIdentifiersSubTLV ¶
func NewLinkLocalRemoteIdentifiersSubTLV(local uint32, remote uint32) *LinkLocalRemoteIdentifiersSubTLV
NewLinkLocalRemoteIdentifiersSubTLV creates a new LinkLocalRemoteIdentifiersSubTLV
func (*LinkLocalRemoteIdentifiersSubTLV) Length ¶
func (l *LinkLocalRemoteIdentifiersSubTLV) Length() uint8
Length gets the length of the TLV
func (*LinkLocalRemoteIdentifiersSubTLV) Serialize ¶
func (l *LinkLocalRemoteIdentifiersSubTLV) Serialize(buf *bytes.Buffer)
Serialize serializes an IPv4 address sub TLV
func (*LinkLocalRemoteIdentifiersSubTLV) Type ¶
func (l *LinkLocalRemoteIdentifiersSubTLV) Type() uint8
Type gets the type of the TLV
func (*LinkLocalRemoteIdentifiersSubTLV) Value ¶
func (l *LinkLocalRemoteIdentifiersSubTLV) Value() interface{}
Value returns the TLV itself
type P2PAdjacencyStateTLV ¶
type P2PAdjacencyStateTLV struct { TLVType uint8 TLVLength uint8 AdjacencyState uint8 ExtendedLocalCircuitID uint32 NeighborSystemID types.SystemID NeighborExtendedLocalCircuitID uint32 }
P2PAdjacencyStateTLV represents an P2P adjacency state TLV
func NewP2PAdjacencyStateTLV ¶
func NewP2PAdjacencyStateTLV(adjacencyState uint8, extendedLocalCircuitID uint32) *P2PAdjacencyStateTLV
NewP2PAdjacencyStateTLV creates a new P2PAdjacencyStateTLV
func (P2PAdjacencyStateTLV) Length ¶
func (p P2PAdjacencyStateTLV) Length() uint8
Length gets the length of the TLV
func (P2PAdjacencyStateTLV) Serialize ¶
func (p P2PAdjacencyStateTLV) Serialize(buf *bytes.Buffer)
Serialize serializes a protocols supported TLV
func (P2PAdjacencyStateTLV) Type ¶
func (p P2PAdjacencyStateTLV) Type() uint8
Type gets the type of the TLV
func (P2PAdjacencyStateTLV) Value ¶
func (p P2PAdjacencyStateTLV) Value() interface{}
Value gets the TLV itself
type P2PHello ¶
type P2PHello struct { CircuitType uint8 SystemID types.SystemID HoldingTimer uint16 PDULength uint16 LocalCircuitID uint8 TLVs []TLV }
P2PHello represents a Point to Point Hello
func DecodeP2PHello ¶
DecodeP2PHello decodes a P2P Hello
func (*P2PHello) GetAreaAddressesTLV ¶
func (h *P2PHello) GetAreaAddressesTLV() *AreaAddressesTLV
GetAreaAddressesTLV gets the area addresses TLV
func (*P2PHello) GetIPInterfaceAddressesesTLV ¶
func (h *P2PHello) GetIPInterfaceAddressesesTLV() *IPInterfaceAddressesTLV
GetIPInterfaceAddressesesTLV gets the IP Interface Addresses TLV
func (*P2PHello) GetP2PAdjTLV ¶
func (h *P2PHello) GetP2PAdjTLV() *P2PAdjacencyStateTLV
GetP2PAdjTLV gets the P2P Adjacency TLV from the P2P Hello
func (*P2PHello) GetProtocolsSupportedTLV ¶
func (h *P2PHello) GetProtocolsSupportedTLV() *ProtocolsSupportedTLV
GetProtocolsSupportedTLV gets the protocols supported TLV
type PSNP ¶
PSNP represents a Partial Sequence Number PDU
func DecodePSNP ¶
DecodePSNP decodes a Partion Sequence Number PDU
type PaddingTLV ¶
PaddingTLV represents a padding TLV
func NewPaddingTLV ¶
func NewPaddingTLV(length uint8) *PaddingTLV
NewPaddingTLV creates a new padding TLV
func (*PaddingTLV) Serialize ¶
func (p *PaddingTLV) Serialize(buf *bytes.Buffer)
Serialize serializes a padding TLV
type ProtocolsSupportedTLV ¶
ProtocolsSupportedTLV represents a protocols supported TLV
func NewProtocolsSupportedTLV ¶
func NewProtocolsSupportedTLV(protocols []uint8) ProtocolsSupportedTLV
func (ProtocolsSupportedTLV) Length ¶
func (p ProtocolsSupportedTLV) Length() uint8
Length gets the length of the TLV
func (ProtocolsSupportedTLV) Serialize ¶
func (p ProtocolsSupportedTLV) Serialize(buf *bytes.Buffer)
Serialize serializes a protocols supported TLV
func (ProtocolsSupportedTLV) Type ¶
func (p ProtocolsSupportedTLV) Type() uint8
Type gets the type of the TLV
func (ProtocolsSupportedTLV) Value ¶
func (p ProtocolsSupportedTLV) Value() interface{}
Value gets the TLV itself
type TrafficEngineeringRouterIDTLV ¶
TrafficEngineeringRouterIDTLV is a Traffic Engineering Router ID TLV
func NewTrafficEngineeringRouterIDTLV ¶
func NewTrafficEngineeringRouterIDTLV(addr [4]byte) *TrafficEngineeringRouterIDTLV
NewTrafficEngineeringRouterIDTLV creates a new TrafficEngineeringRouterIDTLV
func (TrafficEngineeringRouterIDTLV) Length ¶
func (t TrafficEngineeringRouterIDTLV) Length() uint8
Length gets the length of the TLV
func (*TrafficEngineeringRouterIDTLV) Serialize ¶
func (t *TrafficEngineeringRouterIDTLV) Serialize(buf *bytes.Buffer)
Serialize serializes a TrafficEngineeringRouterIDTLV
func (TrafficEngineeringRouterIDTLV) Type ¶
func (t TrafficEngineeringRouterIDTLV) Type() uint8
Type gets the type of the TLV
func (TrafficEngineeringRouterIDTLV) Value ¶
func (t TrafficEngineeringRouterIDTLV) Value() interface{}
Value gets the TLV itself
type UnknownTLV ¶
UnknownTLV represents an unknown TLV
func (UnknownTLV) Serialize ¶
func (u UnknownTLV) Serialize(buf *bytes.Buffer)
Serialize serializes an unknown TLV
Source Files ¶
- csnp.go
- header.go
- hello.go
- isis.go
- lsp.go
- lsp_entry.go
- psnp.go
- tlv.go
- tlv_area_addresses.go
- tlv_authentication.go
- tlv_checksum.go
- tlv_dynamic_hostname.go
- tlv_extended_ip_reachability.go
- tlv_extended_is_reachability.go
- tlv_ip_interface_addresses.go
- tlv_is_neighbors.go
- tlv_is_reachability.go
- tlv_lsp_entries.go
- tlv_p2p_adj_state.go
- tlv_padding.go
- tlv_protocols_supported.go
- tlv_traffic_engineering_router_id.go
- tlv_unknown.go