Documentation ¶
Overview ¶
Package ospf3 implements OSPFv3 (OSPF for IPv6) as described in RFC5340.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // AllSPFRouters is the IPv6 multicast group address that all routers // running OSPFv3 should participate in. AllSPFRouters = &net.IPAddr{IP: net.ParseIP("ff02::5")} // AllDRouters is the IPv6 multicast group address that the Designated // Router and Backup Designated Router running OSPFv3 must participate in. AllDRouters = &net.IPAddr{IP: net.ParseIP("ff02::6")} )
Functions ¶
func MarshalPacket ¶
MarshalPacket turns a Packet into OSPFv3 packet bytes.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
A Conn can send and receive OSPFv3 packets which implement the Packet interface.
func (*Conn) ReadFrom ¶
ReadFrom reads a single OSPFv3 packet and returns a Packet along with its associated IPv6 control message and source address. ReadFrom will block until a timeout occurs or a valid OSPFv3 packet is read.
func (*Conn) SetReadDeadline ¶
SetReadDeadline sets the read deadline associated with the Conn.
type DDFlags ¶
type DDFlags uint16
DDFlags are flags which may appear in an OSPFv3 Database Description packet as described in RFC5340, appendix A.3.3.
Possible DDFlags values.
type DatabaseDescription ¶
type DatabaseDescription struct { Header Header Options Options InterfaceMTU uint16 Flags DDFlags SequenceNumber uint32 LSAs []LSAHeader }
A DatabaseDescription is an OSPFv3 Database Description packet as described in RFC5340, appendix A.3.3.
type FloodingScope ¶
type FloodingScope uint8
A FloodingScope is an OSPFv3 LSA flooding scope as described in RFC 5340, appendix A.4.2.1.
const ( LinkLocalScoping FloodingScope = 0b00 AreaScoping FloodingScope = 0b01 ASScoping FloodingScope = 0b10 )
Possible FloodingScope values.
func (FloodingScope) String ¶
func (i FloodingScope) String() string
type Header ¶
A Header is the OSPFv3 packet header as described in RFC5340, appendix A.3.1. Headers accompany each Packet implementation. The Header only allows setting OSPFv3 header fields which are not calculated programmatically. Version, packet type, and packet length are set automatically when calling MarshalPacket.
type Hello ¶
type Hello struct { Header Header InterfaceID uint32 RouterPriority uint8 Options Options HelloInterval time.Duration RouterDeadInterval time.Duration DesignatedRouterID ID BackupDesignatedRouterID ID NeighborIDs []ID }
A Hello is an OSPFv3 Hello packet as described in RFC5340, appendix A.3.2.
type ID ¶
type ID [4]byte
An ID is a four byte identifier typically used for OSPFv3 router and/or area IDs in a dotted-decimal IPv4 format.
type LSAHeader ¶
type LSAHeader struct { Age time.Duration LSA LSA SequenceNumber uint32 Checksum uint16 Length uint16 }
An LSAHeader is an OSPFv3 Link State Advertisement header as described in RFC5340, appendix A.4.2.
type LSType ¶
type LSType uint16
An LSType is the type of an OSPFv3 Link State Advertisement as described in RFC5340, appendix A.4.2.1.
const ( RouterLSA LSType = 0x2001 NetworkLSA LSType = 0x2002 InterAreaPrefixLSA LSType = 0x2003 InterAreaRouterLSA LSType = 0x2004 ASExternalLSA LSType = 0x4005 NSSALSA LSType = 0x2007 LinkLSA LSType = 0x0008 IntraAreaPrefixLSA LSType = 0x2009 )
Possible LSType values.
func (LSType) FloodingScope ¶
func (t LSType) FloodingScope() FloodingScope
FloodingScope returns the LSA flooding scope value stored in the S1 and S2 bits in the LSType.
func (LSType) LSAHandling ¶
LSAHandling returns the value of the U-bit in the LSType. False indicates the LSA should be treated as if it had link-local flooding scope. True indicates that a router should store and flood the LSA as if the type is understood.
type LinkStateAcknowledgement ¶
A LinkStateAcknowledgement is an OSPFv3 Link State Acknowledgement packet as described in RFC5340, appendix A.3.6.
type LinkStateRequest ¶
A LinkStateRequest is an OSPFv3 Link State Request packet as described in RFC5340, appendix A.3.4.
type Options ¶
type Options uint32
Options is a bitmask of OSPFv3 options as described in RFC5340, appendix A.2.