server

package
v0.0.0-...-ac9ef1f Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2017 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OSPF_HELLO_MIN_SIZE  = 20
	OSPF_DBD_MIN_SIZE    = 8
	OSPF_LSA_HEADER_SIZE = 20
	OSPF_LSA_REQ_SIZE    = 12
	OSPF_LSA_ACK_SIZE    = 20
	OSPF_HEADER_SIZE     = 24
	IP_HEADER_MIN_LEN    = 20
	OSPF_PROTO_ID        = 89
	OSPF_VERSION_2       = 2
	OSPF_NO_OF_LSA_FIELD = 4
)
View Source
const (
	EOption  = 0x02
	MCOption = 0x04
	NPOption = 0x08
	EAOption = 0x20
	DCOption = 0x40
)
View Source
const (
	LsdbEntryFound    = 0
	LsdbEntryNotFound = 1
)
View Source
const (
	RouterLSA     uint8 = 1
	NetworkLSA    uint8 = 2
	Summary3LSA   uint8 = 3
	Summary4LSA   uint8 = 4
	ASExternalLSA uint8 = 5
)
View Source
const (
	LsdbAdd      uint8 = 0
	LsdbDel      uint8 = 1
	LsdbUpdate   uint8 = 2
	LsdbNoAction uint8 = 3
)
View Source
const (
	P2PLink     uint8 = 1
	TransitLink uint8 = 2
	StubLink    uint8 = 3
	VirtualLink uint8 = 4
)
View Source
const (
	NBRADD = 0
	NBRUPD = 1
	NBRDEL = 2
)
View Source
const (
	LSAFLOOD        = 0 // flood when FULL state reached
	LSASELFLOOD     = 1 // flood for received LSA
	LSAINTF         = 2 // Send LSA on the interface in reply to LSAREQ
	LSAAGE          = 3 // flood aged LSAs.
	LSASUMMARYFLOOD = 4 //flood summary LSAs in different areas.
	LSAEXTFLOOD     = 5 //flood AS External summary LSA
	LSAROUTERFLOOD  = 6 //flood only router LSA
)
View Source
const (
	RouterVertex   uint8 = 0
	SNetworkVertex uint8 = 1 // Stub
	TNetworkVertex uint8 = 2 // Transit
)
View Source
const (
	SUCCESS = 0
	FAIL    = 1
)
View Source
const (
	MODX                       int    = 4102
	FLETCHER_CHECKSUM_VALIDATE uint16 = 0xffff
)
View Source
const (
	DEFAULT_VLAN_COST uint32 = 10
)
View Source
const (
	FloodLsa uint8 = LsdbNoAction + 1
)
View Source
const INTF_MTU_MIN = 1500
TODO

remote hardcoding and get it while config.

View Source
const INTF_OPTIONS = 66
View Source
const LSA_MAX_AGE uint16 = 0x7fff
View Source
const LSA_MAX_AGE_DIFF uint16 = 0x7fff
View Source
const (
	RxDBDInterval = 5
)

Variables

View Source
var ALLDROUTER string = "224.0.0.6"
View Source
var ALLDROUTERMAC string = "01:00:5e:00:00:06"
View Source
var ALLSPFROUTER string = "224.0.0.5"
View Source
var ALLSPFROUTERMAC string = "01:00:5e:00:00:05"
View Source
var DBEventSeq int32
View Source
var INVALID_NEIGHBOR_CONF_KEY uint32
View Source
var InitialSequenceNumber int = 0x80000001
View Source
var LSInfinity uint32 = 0x00ffffff
View Source
var LSSequenceNumber int = InitialSequenceNumber
View Source
var MASKMAC string = "ff:ff:ff:ff:ff:ff"
View Source
var MaxSequenceNumber int = 0x7fffffff
View Source
var OspfNeighborLastDbd map[NeighborConfKey]ospfDatabaseDescriptionData

Global structures for Neighbor

Functions

func DecodeDatabaseDescriptionData

func DecodeDatabaseDescriptionData(data []byte, dbd_data *ospfDatabaseDescriptionData, pktlen uint16)

func NewOspfDatabaseDescriptionData

func NewOspfDatabaseDescriptionData() *ospfDatabaseDescriptionData

func NewospfNeighborLSDBMsg

func NewospfNeighborLSDBMsg() *ospfNeighborLSDBMsg

func OSPFNewLogger

func OSPFNewLogger(name string, tag string, listenToConfig bool) (*logging.Writer, error)

Types

type ASExtTOSDetail

type ASExtTOSDetail struct {
	BitE           bool
	TOS            uint8
	TOSMetric      uint32
	TOSFwdAddr     uint32
	TOSExtRouteTag uint32
}

type ASExternalLsa

type ASExternalLsa struct {
	LsaMd           LsaMetadata
	Netmask         uint32 /* Network Mask */
	BitE            bool
	Metric          uint32 /* But only max value 2^24-1 */
	FwdAddr         uint32
	ExtRouteTag     uint32
	ASExtTOSDetails []ASExtTOSDetail
}

LS Type 5

func NewASExternalLsa

func NewASExternalLsa() *ASExternalLsa

type AdjOKEvtMsg

type AdjOKEvtMsg struct {
	NewDRtrId  uint32
	OldDRtrId  uint32
	NewBDRtrId uint32
	OldBDRtrId uint32
}

type AreaConf

type AreaConf struct {
	AuthType               config.AuthType
	ImportAsExtern         config.ImportAsExtern
	AreaSummary            config.AreaSummary
	StubDefaultCost        int32
	AreaNssaTranslatorRole config.NssaTranslatorRole
	TransitCapability      bool
	IntfListMap            map[IntfConfKey]bool
}

TODO - Add list of interfaces for this Area

type AreaConfKey

type AreaConfKey struct {
	AreaId config.AreaId
}

type AreaIdKey

type AreaIdKey struct {
	AreaId uint32
}

type AreaRoutingTbl

type AreaRoutingTbl struct {
	RoutingTblMap map[RoutingTblEntryKey]RoutingTblEntry
}

type AreaState

type AreaState struct {
	SpfRuns                  int32
	AreaBdrRtrCount          int32
	AsBdrRtrCount            int32
	AreaLsaCount             int32
	AreaLsaCksumSum          int32
	AreaNssaTranslatorState  config.NssaTranslatorState
	AreaNssaTranslatorEvents int32
}

type AsicdClient

type AsicdClient struct {
	OspfClientBase
	ClientHdl *asicdServices.ASICDServicesClient
}

type BackupSeenMsg

type BackupSeenMsg struct {
	RouterId uint32
	BDRId    []byte
	DRId     []byte
}

type ClientJson

type ClientJson struct {
	Name string `json:Name`
	Port int    `json:Port`
}

type DbEventMsg

type DbEventMsg struct {
	// contains filtered or unexported fields
}

type DbLsdbMsg

type DbLsdbMsg struct {
	// contains filtered or unexported fields
}

type DbRouteMsg

type DbRouteMsg struct {
	// contains filtered or unexported fields
}

type DestType

type DestType uint8
const (
	Network         DestType = 0
	InternalRouter  DestType = 1
	ASBdrRouter     DestType = 2
	AreaBdrRouter   DestType = 3
	ASAreaBdrRouter DestType = 4
)

type DrChangeMsg

type DrChangeMsg struct {
	// contains filtered or unexported fields
}

type DstIPType

type DstIPType uint8
const (
	Normal       DstIPType = 1
	AllSPFRouter DstIPType = 2
	AllDRouter   DstIPType = 3
)

type EthHdrMetadata

type EthHdrMetadata struct {
	// contains filtered or unexported fields
}

func NewEthHdrMetadata

func NewEthHdrMetadata() *EthHdrMetadata

type GlobalConf

type GlobalConf struct {
	RouterId                 []byte
	AdminStat                config.Status
	ASBdrRtrStatus           bool
	TOSSupport               bool
	ExtLsdbLimit             int32
	MulticastExtensions      int32
	ExitOverflowInterval     config.PositiveInteger
	DemandExtensions         bool
	RFC1583Compatibility     bool
	ReferenceBandwidth       uint32
	RestartSupport           config.RestartSupport
	RestartInterval          int32
	RestartStrictLsaChecking bool
	StubRouterAdvertisement  config.AdvertiseAction
	Version                  uint8
	AreaBdrRtrStatus         bool
	ExternLsaCount           int32
	ExternLsaChecksum        int32
	OriginateNewLsas         int32
	RxNewLsas                int32
	OpaqueLsaSupport         bool
	RestartStatus            config.RestartStatus
	RestartAge               int32
	RestartExitReason        config.RestartExitReason
	AsLsaCount               int32
	AsLsaCksumSum            int32
	StubRouterSupport        bool
	//DiscontinuityTime        string
	DiscontinuityTime int32 // This should be string
	// contains filtered or unexported fields
}

type GlobalRoutingTblEntry

type GlobalRoutingTblEntry struct {
	AreaId        uint32 // Area
	RoutingTblEnt RoutingTblEntry
}

type IPIntfProperty

type IPIntfProperty struct {
	IfName  string
	IpAddr  net.IP
	MacAddr net.HardwareAddr
	NetMask []byte
	Mtu     int32
	Cost    uint32
}

type IPv4IntfNotifyMsg

type IPv4IntfNotifyMsg struct {
	IpAddr string
	IfId   uint16
	IfType uint8
}

type IfData

type IfData struct {
	IfIpAddr uint32
	IfIdx    uint32
}

type IntfConf

type IntfConf struct {
	IfAreaId              []byte
	IfType                config.IfType
	IfAdminStat           config.Status
	IfRtrPriority         uint8
	IfTransitDelay        config.UpToMaxAge
	IfRetransInterval     config.UpToMaxAge
	IfHelloInterval       uint16
	IfRtrDeadInterval     uint32
	IfPollInterval        config.PositiveInteger
	IfAuthKey             []byte
	IfMulticastForwarding config.MulticastForwarding
	IfDemand              bool
	IfAuthType            uint16
	FSMCtrlCh             chan bool
	FSMCtrlStatusCh       chan bool
	HelloIntervalTicker   *time.Ticker
	BackupSeenCh          chan BackupSeenMsg
	NeighborMap           map[NeighborConfKey]NeighborData
	NeighCreateCh         chan NeighCreateMsg
	NeighChangeCh         chan NeighChangeMsg
	NbrStateChangeCh      chan NbrStateChangeMsg
	NbrFullStateCh        chan NbrFullStateMsg
	WaitTimer             *time.Timer
	/* IntefaceState: Start */
	IfDRIp        []byte
	IfBDRIp       []byte
	IfFSMState    config.IfState
	IfEvents      int32
	IfLsaCount    int32
	IfLsaCksumSum int32
	IfDRtrId      uint32
	IfBDRtrId     uint32
	/* IntefaceState: End */
	IfName         string
	IfIpAddr       net.IP
	IfMacAddr      net.HardwareAddr
	IfNetmask      []byte
	IfMtu          int32
	IfCost         uint32
	IfMetricTOSMap map[uint8]uint32 // Key: TOS Value, Value: TOS Metric
}

type IntfConfKey

type IntfConfKey struct {
	IPAddr  config.IpAddress
	IntfIdx config.InterfaceIndexOrZero
}

type IntfRxHandle

type IntfRxHandle struct {
	RecvPcapHdl     *pcap.Handle
	PktRecvCh       chan bool
	PktRecvStatusCh chan bool
}

type IntfToNeighMsg

type IntfToNeighMsg struct {
	IntfConfKey IntfConfKey
	RouterId    uint32
	RtrPrio     uint8
	NeighborIP  net.IP

	TwoWayStatus bool
	// contains filtered or unexported fields
}

type IntfTxHandle

type IntfTxHandle struct {
	SendPcapHdl *pcap.Handle
	SendMutex   *sync.Mutex
}

type IpHdrMetadata

type IpHdrMetadata struct {
	// contains filtered or unexported fields
}

func NewIpHdrMetadata

func NewIpHdrMetadata() *IpHdrMetadata

type IpProperty

type IpProperty struct {
	IfId   uint16
	IfType uint8
	IpAddr string // CIDR Notation
}

type LSAChangeMsg

type LSAChangeMsg struct {
	// contains filtered or unexported fields
}

type LSDatabase

type LSDatabase struct {
	RouterLsaMap     map[LsaKey]RouterLsa
	NetworkLsaMap    map[LsaKey]NetworkLsa
	Summary3LsaMap   map[LsaKey]SummaryLsa
	Summary4LsaMap   map[LsaKey]SummaryLsa
	ASExternalLsaMap map[LsaKey]ASExternalLsa
}

type LinkDetail

type LinkDetail struct {
	LinkId     uint32 /* Link ID */
	LinkData   uint32 /* Link Data */
	LinkType   uint8  /* Link Type */
	NumOfTOS   uint8  /* # TOS Metrics */
	LinkMetric uint16 /* Metric */
	TOSDetails []TOSDetail
}

type LogicalIntfProperty

type LogicalIntfProperty struct {
	Name    string
	MacAddr net.HardwareAddr
}

type LsaHeader

type LsaHeader struct {
	LSAge         uint16
	Options       uint8
	LSType        uint8
	LinkId        uint32
	Adv_router    uint32
	LSSequenceNum uint32
	LSChecksum    uint16
	// contains filtered or unexported fields
}

func NewLsaHeader

func NewLsaHeader() *LsaHeader

type LsaKey

type LsaKey struct {
	LSType    uint8  /* LS Type */
	LSId      uint32 /* Link State Id */
	AdvRouter uint32 /* Avertising Router */
}

func NewLsaKey

func NewLsaKey() *LsaKey

type LsaMetadata

type LsaMetadata struct {
	LSAge         uint16 /* LS Age */
	Options       uint8  /* Options */
	LSSequenceNum int    /* LS Sequence Number */
	LSChecksum    uint16 /* LS Checksum */
	LSLen         uint16 /* LS Length */
}

type LsaOp

type LsaOp uint8

type LsdbKey

type LsdbKey struct {
	AreaId uint32
}

type LsdbSliceEnt

type LsdbSliceEnt struct {
	AreaId uint32
	LSType uint8
	LSId   uint32
	AdvRtr uint32
}

type LsdbUpdateMsg

type LsdbUpdateMsg struct {
	MsgType uint8
	AreaId  uint32
	Data    []byte
}

func NewLsdbUpdateMsg

func NewLsdbUpdateMsg() *LsdbUpdateMsg

type NbrFullStateMsg

type NbrFullStateMsg struct {
	FullState bool
	NbrRtrId  uint32
	// contains filtered or unexported fields
}

type NbrIP

type NbrIP uint32

type NbrMsgType

type NbrMsgType uint32

type NbrStateChangeMsg

type NbrStateChangeMsg struct {
	// contains filtered or unexported fields
}

type NeighChangeMsg

type NeighChangeMsg struct {
	RouterId     uint32
	NbrIP        uint32
	TwoWayStatus bool
	RtrPrio      uint8
	DRtr         []byte
	BDRtr        []byte
}

type NeighCreateMsg

type NeighCreateMsg struct {
	RouterId     uint32
	NbrIP        uint32
	TwoWayStatus bool
	RtrPrio      uint8
	DRtr         []byte
	BDRtr        []byte
}

type NeighborConfKey

type NeighborConfKey struct {
	IPAddr  config.IpAddress
	IntfIdx config.InterfaceIndexOrZero
}

type NeighborData

type NeighborData struct {
	TwoWayStatus bool
	RtrPrio      uint8
	DRtr         []byte
	BDRtr        []byte
	NbrIP        uint32
	FullState    bool
}

type NetworkLSAChangeMsg

type NetworkLSAChangeMsg struct {
	// contains filtered or unexported fields
}

type NetworkLsa

type NetworkLsa struct {
	LsaMd       LsaMetadata
	Netmask     uint32 /* Network Mask */
	AttachedRtr []uint32
}

LS Type 2

func NewNetworkLsa

func NewNetworkLsa() *NetworkLsa

type NextHop

type NextHop struct {
	IfIPAddr  uint32
	IfIdx     uint32
	NextHopIP uint32
	AdvRtr    uint32 // Nbr Router Id
}

type OSPFHeader

type OSPFHeader struct {
	// contains filtered or unexported fields
}

func NewOSPFHeader

func NewOSPFHeader() *OSPFHeader

type OSPFHelloData

type OSPFHelloData struct {
	// contains filtered or unexported fields
}

func NewOSPFHelloData

func NewOSPFHelloData() *OSPFHelloData

type OSPFServer

type OSPFServer struct {
	GlobalConfigCh     chan config.GlobalConf
	AreaConfigCh       chan config.AreaConf
	IntfConfigCh       chan config.InterfaceConf
	IfMetricConfCh     chan config.IfMetricConf
	GlobalConfigRetCh  chan error
	AreaConfigRetCh    chan error
	IntfConfigRetCh    chan error
	AreaLsdb           map[LsdbKey]LSDatabase
	LsdbSlice          []LsdbSliceEnt
	LsdbStateTimer     *time.Timer
	AreaSelfOrigLsa    map[LsdbKey]SelfOrigLsa
	LsdbUpdateCh       chan LsdbUpdateMsg
	LsaUpdateRetCodeCh chan bool
	IntfStateChangeCh  chan NetworkLSAChangeMsg
	NetworkDRChangeCh  chan DrChangeMsg
	FlushNetworkLSACh  chan NetworkLSAChangeMsg
	CreateNetworkLSACh chan ospfNbrMdata
	AdjOKEvtCh         chan AdjOKEvtMsg

	ExternalRouteNotif chan RouteMdata

	AreaConfMap       map[AreaConfKey]AreaConf
	IntfConfMap       map[IntfConfKey]IntfConf
	IntfTxMap         map[IntfConfKey]IntfTxHandle
	IntfRxMap         map[IntfConfKey]IntfRxHandle
	NeighborConfigMap map[NeighborConfKey]OspfNeighborEntry
	NeighborListMap   map[IntfConfKey]list.List

	AreaStateTimer           *time.Timer
	AreaStateMutex           sync.RWMutex
	AreaStateMap             map[AreaConfKey]AreaState
	AreaStateSlice           []AreaConfKey
	AreaConfKeyToSliceIdxMap map[AreaConfKey]int
	IntfKeySlice             []IntfConfKey
	IntfKeyToSliceIdxMap     map[IntfConfKey]bool
	IntfStateTimer           *time.Timer
	IntfSliceRefreshCh       chan bool
	IntfSliceRefreshDoneCh   chan bool

	RefreshDuration time.Duration

	TempAreaRoutingTbl   map[AreaIdKey]AreaRoutingTbl
	GlobalRoutingTbl     map[RoutingTblEntryKey]GlobalRoutingTblEntry
	OldGlobalRoutingTbl  map[RoutingTblEntryKey]GlobalRoutingTblEntry
	TempGlobalRoutingTbl map[RoutingTblEntryKey]GlobalRoutingTblEntry

	SummaryLsDb map[LsdbKey]SummaryLsaMap

	StartCalcSPFCh chan bool
	DoneCalcSPFCh  chan bool
	AreaGraph      map[VertexKey]Vertex
	SPFTree        map[VertexKey]TreeVertex
	AreaStubs      map[VertexKey]StubVertex

	DbReadConfig chan bool
	DbRouteOp    chan DbRouteMsg
	DbLsdbOp     chan DbLsdbMsg
	DbEventOp    chan DbEventMsg
	// contains filtered or unexported fields
}

func NewOSPFServer

func NewOSPFServer(logger *logging.Writer) *OSPFServer

func (*OSPFServer) AddIPv4RoutesState

func (server *OSPFServer) AddIPv4RoutesState(entry RoutingTblEntryKey) error

func (*OSPFServer) AddLsdbEntry

func (server *OSPFServer) AddLsdbEntry(entry LsdbSliceEnt) error

func (*OSPFServer) AddOspfEventState

func (server *OSPFServer) AddOspfEventState(eventType string, eventInfo string) error

func (*OSPFServer) BuildAndSendLSAReq

func (server *OSPFServer) BuildAndSendLSAReq(nbrId NeighborConfKey, nbrConf OspfNeighborEntry) (curr_index uint8)

func (*OSPFServer) BuildDBDPkt

func (server *OSPFServer) BuildDBDPkt(intfKey IntfConfKey, ent IntfConf,
	nbrConf OspfNeighborEntry, dbdData ospfDatabaseDescriptionData, dstMAC net.HardwareAddr) (data []byte)

func (*OSPFServer) BuildHelloPkt

func (server *OSPFServer) BuildHelloPkt(ent IntfConf) []byte

func (*OSPFServer) BuildLSAAckPkt

func (server *OSPFServer) BuildLSAAckPkt(intfKey IntfConfKey, ent IntfConf,
	nbrConf OspfNeighborEntry, dstMAC net.HardwareAddr, dstIp net.IP, lsa_pkt_size int, lsaAckEnc []byte) (data []byte)

func (server *OSPFServer) encodeLSAAck

func (*OSPFServer) BuildLsaUpdPkt

func (server *OSPFServer) BuildLsaUpdPkt(intfKey IntfConfKey, ent IntfConf,
	dstMAC net.HardwareAddr, dstIp net.IP, lsa_pkt_size int, lsaUpdEnc []byte) (data []byte)

func (*OSPFServer) BuildOspfInfra

func (server *OSPFServer) BuildOspfInfra()

func (*OSPFServer) CalcASBorderRoutes

func (server *OSPFServer) CalcASBorderRoutes(areaId uint32)

func (*OSPFServer) CalcInterAreaRoutes

func (server *OSPFServer) CalcInterAreaRoutes(areaId uint32)

Handling Summary LSA in case of FS is internal router

func (*OSPFServer) CheckNeighborFullEvent

func (server *OSPFServer) CheckNeighborFullEvent(nbrKey NeighborConfKey)

func (*OSPFServer) CompareRoutes

func (server *OSPFServer) CompareRoutes(rKey RoutingTblEntryKey) bool

Compare Old and New Route

func (*OSPFServer) ConnectToClients

func (server *OSPFServer) ConnectToClients(paramsFile string)

func (*OSPFServer) ConsolidatingRoutingTbl

func (server *OSPFServer) ConsolidatingRoutingTbl()

func (*OSPFServer) ConstructAndSendDbdPacket

func (server *OSPFServer) ConstructAndSendDbdPacket(nbrKey NeighborConfKey,
	ibit bool, mbit bool, msbit bool, options uint8,
	seq uint32, append_lsa bool, is_duplicate bool, ifMtu int32) (dbd_mdata ospfDatabaseDescriptionData, last_exchange bool)

func (*OSPFServer) CreateAndSendHelloRecvdMsg

func (server *OSPFServer) CreateAndSendHelloRecvdMsg(routerId uint32,
	ipHdrMd *IpHdrMetadata,
	ospfHdrMd *OspfHdrMetadata,
	nbrDeadInterval time.Duration, ifType config.IfType,
	TwoWayStatus bool, rtrPrio uint8, key IntfConfKey)

func (*OSPFServer) CreateAreaGraph

func (server *OSPFServer) CreateAreaGraph(areaId uint32) (VertexKey, error)

func (*OSPFServer) DecodeLSAAck

func (server *OSPFServer) DecodeLSAAck(msg ospfNeighborLSAAckMsg)

func (*OSPFServer) DecodeLSAReq

func (server *OSPFServer) DecodeLSAReq(msg ospfNeighborLSAreqMsg)

func (*OSPFServer) DecodeLSAUpd

func (server *OSPFServer) DecodeLSAUpd(msg ospfNeighborLSAUpdMsg)

func (*OSPFServer) DelIPv4RoutesState

func (server *OSPFServer) DelIPv4RoutesState(entry RoutingTblEntryKey) error

func (*OSPFServer) DelLsdbEntry

func (server *OSPFServer) DelLsdbEntry(entry LsdbSliceEnt) error

func (*OSPFServer) DelOspfEventState

func (server *OSPFServer) DelOspfEventState(entry config.OspfEventState) error

func (*OSPFServer) DeleteRoute

func (server *OSPFServer) DeleteRoute(rKey RoutingTblEntryKey)

func (*OSPFServer) ElectBDR

func (server *OSPFServer) ElectBDR(key IntfConfKey) ([]byte, uint32)

func (*OSPFServer) ElectBDRAndDR

func (server *OSPFServer) ElectBDRAndDR(key IntfConfKey)

func (*OSPFServer) ElectDR

func (server *OSPFServer) ElectDR(key IntfConfKey, electedBDR []byte, electedBDRtrId uint32) ([]byte, uint32)

func (*OSPFServer) EncodeLSAReqPkt

func (server *OSPFServer) EncodeLSAReqPkt(intfKey IntfConfKey, ent IntfConf,
	nbrConf OspfNeighborEntry, lsa_req_pkt []ospfLSAReq, dstMAC net.HardwareAddr) (data []byte)

func (*OSPFServer) ExecuteDijkstra

func (server *OSPFServer) ExecuteDijkstra(vKey VertexKey, areaId uint32) error

func (*OSPFServer) GenerateDefaultSummary3LSA

func (server *OSPFServer) GenerateDefaultSummary3LSA(lsDbKey LsdbKey) (LsaKey, SummaryLsa)

@fn GenerateDefaultSummary3LSA

RFC 2328 A 4.4
For stub areas, Type 3 summary-LSAs can also be used to describe a
(per-area) default route.  Default summary routes are used in stub
 areas instead of flooding a complete set of external routes.  When
describing a default summary route, the summary-LSA's Link State ID
is always set to DefaultDestination (0.0.0.0) and the Network Mask
is set to 0.0.0.0.

func (*OSPFServer) GenerateSummaryLsa

func (server *OSPFServer) GenerateSummaryLsa()

func (*OSPFServer) GenerateType3SummaryLSA

func (server *OSPFServer) GenerateType3SummaryLSA(rKey RoutingTblEntryKey, rEnt GlobalRoutingTblEntry, lsDbKey LsdbKey) (LsaKey, SummaryLsa)

func (*OSPFServer) GenerateType4SummaryLSA

func (server *OSPFServer) GenerateType4SummaryLSA(rKey RoutingTblEntryKey, rEnt GlobalRoutingTblEntry, lsDbKey LsdbKey) (LsaKey, SummaryLsa)

func (*OSPFServer) GetBulkOspfAreaEntryState

func (server *OSPFServer) GetBulkOspfAreaEntryState(idx int, cnt int) (int, int, []config.AreaState)

func (*OSPFServer) GetBulkOspfIfEntryState

func (server *OSPFServer) GetBulkOspfIfEntryState(idx int, cnt int) (int, int, []config.InterfaceState)

func (*OSPFServer) GetBulkOspfLsdbEntryState

func (server *OSPFServer) GetBulkOspfLsdbEntryState(idx int, cnt int) (int, int, []config.LsdbState)

func (*OSPFServer) GetBulkOspfNbrEntryState

func (server *OSPFServer) GetBulkOspfNbrEntryState(idx int, cnt int) (int, int, []config.NeighborState)

func (*OSPFServer) GetOspfGlobalState

func (server *OSPFServer) GetOspfGlobalState() *config.GlobalState

func (*OSPFServer) HandleASExternalLsa

func (server *OSPFServer) HandleASExternalLsa(areaId uint32)

func (*OSPFServer) HandleStubs

func (server *OSPFServer) HandleStubs(vKey VertexKey, areaId uint32)

func (*OSPFServer) HandleSummaryLsa

func (server *OSPFServer) HandleSummaryLsa(areaId uint32)

func (*OSPFServer) HandleSummaryType3Lsa

func (server *OSPFServer) HandleSummaryType3Lsa(areaId uint32)

func (*OSPFServer) HandleSummaryType4Lsa

func (server *OSPFServer) HandleSummaryType4Lsa(areaId uint32)

func (*OSPFServer) HandleTransitAreaSummaryLsa

func (server *OSPFServer) HandleTransitAreaSummaryLsa()

func (*OSPFServer) InitDBChannels

func (server *OSPFServer) InitDBChannels()

func (*OSPFServer) InitNeighborStateMachine

func (server *OSPFServer) InitNeighborStateMachine()

func (*OSPFServer) InitServer

func (server *OSPFServer) InitServer(paramFile string)

func (*OSPFServer) InitializeDB

func (server *OSPFServer) InitializeDB() error

func (*OSPFServer) InstallRoute

func (server *OSPFServer) InstallRoute(rKey RoutingTblEntryKey)

func (*OSPFServer) InstallRoutingTbl

func (server *OSPFServer) InstallRoutingTbl()

func (*OSPFServer) ProcessNbrStateMachine

func (server *OSPFServer) ProcessNbrStateMachine()

func (*OSPFServer) ProcessOspfRecvPkt

func (server *OSPFServer) ProcessOspfRecvPkt(key IntfConfKey, pkt gopacket.Packet)

func (*OSPFServer) ProcessRibdRoutes

func (server *OSPFServer) ProcessRibdRoutes(route ribdInt.Routes, msgType uint16)

@fn ProcessRibdRoutes Send notif to LSDB to generate/delete AS external LSA

func (*OSPFServer) ProcessRxDbdPkt

func (server *OSPFServer) ProcessRxDbdPkt(data []byte, ospfHdrMd *OspfHdrMetadata,
	ipHdrMd *IpHdrMetadata, key IntfConfKey, srcMAC net.HardwareAddr) error

func (*OSPFServer) ProcessRxLSAAckPkt

func (server *OSPFServer) ProcessRxLSAAckPkt(data []byte, ospfHdrMd *OspfHdrMetadata,
	ipHdrMd *IpHdrMetadata, key IntfConfKey) error

func (*OSPFServer) ProcessRxLSAReqPkt

func (server *OSPFServer) ProcessRxLSAReqPkt(data []byte, ospfHdrMd *OspfHdrMetadata, ipHdrMd *IpHdrMetadata, key IntfConfKey) error

@fn ProcessRxLSAReqPkt Send Lsa req packet meta data to Rx packet thread

func (*OSPFServer) ProcessRxLsaUpdPkt

func (server *OSPFServer) ProcessRxLsaUpdPkt(data []byte, ospfHdrMd *OspfHdrMetadata,
	ipHdrMd *IpHdrMetadata, key IntfConfKey) error

func (*OSPFServer) ProcessRxNbrPkt

func (server *OSPFServer) ProcessRxNbrPkt()
@fn ProcessRxNbrPkt

Nbr packet Rx thread. It handles LSA REQ/UPD/ACK in.

func (*OSPFServer) ProcessTxNbrPkt

func (server *OSPFServer) ProcessTxNbrPkt()
@fn ProcessTxNbrPkt

Nbr packet out thread. It handles LSA REQ/UPD/ACK out , DBD packets out signalling the LSA generation

func (*OSPFServer) ReadOspfCfgFromDB

func (server *OSPFServer) ReadOspfCfgFromDB()

func (*OSPFServer) SendOspfPkt

func (server *OSPFServer) SendOspfPkt(key IntfConfKey, ospfPkt []byte) error

func (*OSPFServer) SendRouterLsa

func (server *OSPFServer) SendRouterLsa(areaId uint32, intfKey IntfConfKey,
	lsaKey LsaKey) []byte

@fn sendRouterLsa At the event of interface down need to flood updated router LSA.

func (*OSPFServer) SendSelfOrigLSA

func (server *OSPFServer) SendSelfOrigLSA(areaId uint32, intfKey IntfConfKey) []byte

@fn SendSelfOrigLSA Api is called When adjacency is established DR/BDR change

func (*OSPFServer) StartDBListener

func (server *OSPFServer) StartDBListener()

func (*OSPFServer) StartLSDatabase

func (server *OSPFServer) StartLSDatabase()

func (*OSPFServer) StartOspfBroadcastIntfFSM

func (server *OSPFServer) StartOspfBroadcastIntfFSM(key IntfConfKey)

func (*OSPFServer) StartOspfIntfFSM

func (server *OSPFServer) StartOspfIntfFSM(key IntfConfKey)

func (*OSPFServer) StartOspfP2PIntfFSM

func (server *OSPFServer) StartOspfP2PIntfFSM(key IntfConfKey)

func (*OSPFServer) StartOspfRecvPkts

func (server *OSPFServer) StartOspfRecvPkts(key IntfConfKey)

func (*OSPFServer) StartSendHelloPkt

func (server *OSPFServer) StartSendHelloPkt(key IntfConfKey)

func (*OSPFServer) StartSendRecvPkts

func (server *OSPFServer) StartSendRecvPkts(intfConfKey IntfConfKey)

func (*OSPFServer) StartServer

func (server *OSPFServer) StartServer(paramFile string)

func (*OSPFServer) StopLSDatabase

func (server *OSPFServer) StopLSDatabase()

func (*OSPFServer) StopOspfIntfFSM

func (server *OSPFServer) StopOspfIntfFSM(key IntfConfKey)

func (*OSPFServer) StopOspfRecvPkts

func (server *OSPFServer) StopOspfRecvPkts(key IntfConfKey)

func (*OSPFServer) StopSendHelloPkt

func (server *OSPFServer) StopSendHelloPkt(key IntfConfKey)

func (*OSPFServer) StopSendRecvPkts

func (server *OSPFServer) StopSendRecvPkts(intfConfKey IntfConfKey)

func (*OSPFServer) UpdateAreaGraphNetworkLsa

func (server *OSPFServer) UpdateAreaGraphNetworkLsa(lsaEnt NetworkLsa, lsaKey LsaKey, areaId uint32) error

func (*OSPFServer) UpdateAreaGraphRouterLsa

func (server *OSPFServer) UpdateAreaGraphRouterLsa(lsaEnt RouterLsa, lsaKey LsaKey, areaId uint32) error

func (*OSPFServer) UpdateIPv4Infra

func (server *OSPFServer) UpdateIPv4Infra(msg asicdCommonDefs.IPv4IntfNotifyMsg, msgType uint8)

func (*OSPFServer) UpdateLogicalIntfInfra

func (server *OSPFServer) UpdateLogicalIntfInfra(msg asicdCommonDefs.LogicalIntfNotifyMsg,
	msgType uint8)

func (*OSPFServer) UpdateMtu

func (server *OSPFServer) UpdateMtu(ifIndex int32, mtu int32)

func (*OSPFServer) UpdateNeighborConf

func (server *OSPFServer) UpdateNeighborConf()

@fn UpdateNeighborConf Thread to update/add/delete neighbor global struct.

func (*OSPFServer) UpdateNeighborList

func (server *OSPFServer) UpdateNeighborList(nbrKey NeighborConfKey)

func (*OSPFServer) UpdateRoute

func (server *OSPFServer) UpdateRoute(rKey RoutingTblEntryKey)

func (*OSPFServer) UpdateRoutingTbl

func (server *OSPFServer) UpdateRoutingTbl(vKey VertexKey, areaId uint32)

func (*OSPFServer) UpdateRoutingTblForRouter

func (server *OSPFServer) UpdateRoutingTblForRouter(areaIdKey AreaIdKey, vKey VertexKey, tVertex TreeVertex, rootVKey VertexKey)

func (*OSPFServer) UpdateRoutingTblForTNetwork

func (server *OSPFServer) UpdateRoutingTblForTNetwork(areaIdKey AreaIdKey, vKey VertexKey, tVertex TreeVertex, rootVKey VertexKey)

func (*OSPFServer) UpdateRoutingTblWithStub

func (server *OSPFServer) UpdateRoutingTblWithStub(areaId uint32, vKey VertexKey, tVertex TreeVertex, parent TreeVertex, parentKey VertexKey, rootVKey VertexKey)

func (*OSPFServer) UpdateVlanInfra

func (server *OSPFServer) UpdateVlanInfra(msg asicdCommonDefs.VlanNotifyMsg, msgType uint8)

type OspfClientBase

type OspfClientBase struct {
	Address            string
	Transport          thrift.TTransport
	PtrProtocolFactory *thrift.TBinaryProtocolFactory
	IsConnected        bool
}

type OspfHdrMetadata

type OspfHdrMetadata struct {
	// contains filtered or unexported fields
}

func NewOspfHdrMetadata

func NewOspfHdrMetadata() *OspfHdrMetadata

type OspfNeighborEntry

type OspfNeighborEntry struct {
	OspfNbrRtrId  uint32
	OspfNbrIPAddr net.IP
	OspfRtrPrio   uint8

	OspfNbrOptions int
	OspfNbrState   config.NbrState

	OspfNbrInactivityTimer time.Time
	OspfNbrDeadTimer       time.Duration
	NbrDeadTimer           *time.Timer
	// contains filtered or unexported fields
}

type OspfType

type OspfType uint8
const (
	HelloType         OspfType = 1
	DBDescriptionType OspfType = 2
	LSRequestType     OspfType = 3
	LSUpdateType      OspfType = 4
	LSAckType         OspfType = 5
)

type Path

type Path []VertexKey

type PathType

type PathType int
const (
	/* Decreasing order of Precedence */
	IntraArea PathType = 4
	InterArea PathType = 3
	Type1Ext  PathType = 2
	Type2Ext  PathType = 1
)

type PortProperty

type PortProperty struct {
	Name  string
	Mtu   int32
	Speed uint32 //Unit Mbps
}

type RibdClient

type RibdClient struct {
	OspfClientBase
	ClientHdl *ribd.RIBDServicesClient
}

type RouteMdata

type RouteMdata struct {
	// contains filtered or unexported fields
}

type RouterLsa

type RouterLsa struct {
	LsaMd       LsaMetadata
	BitV        bool         /* V Bit */
	BitE        bool         /* Bit E */
	BitB        bool         /* Bit B */
	NumOfLinks  uint16       /* NumOfLinks */
	LinkDetails []LinkDetail /* List of LinkDetails */
}

LS Type 1

func NewRouterLsa

func NewRouterLsa() *RouterLsa

type RoutingTblEntry

type RoutingTblEntry struct {
	OptCapabilities uint8    // Optional Capabilities
	PathType        PathType // Path Type
	Cost            uint16
	Type2Cost       uint16
	LSOrigin        LsaKey
	NumOfPaths      int
	NextHops        map[NextHop]bool // Next Hop
}

type RoutingTblEntryKey

type RoutingTblEntryKey struct {
	DestId   uint32   // IP address(Network Type) RouterID(Router Type)
	AddrMask uint32   // Only For Network Type
	DestType DestType // true: Network, false: Router
}

type RoutingTblKey

type RoutingTblKey struct {
	AreaId uint32
}

type SelfOrigLsa

type SelfOrigLsa map[LsaKey]bool

type StubVertex

type StubVertex struct {
	NbrVertexKey  VertexKey
	NbrVertexCost uint16
	LinkData      uint32
	LsaKey        LsaKey
	AreaId        uint32
	LinkStateId   uint32
}

type SummaryLsa

type SummaryLsa struct {
	LsaMd             LsaMetadata
	Netmask           uint32 /* Network Mask */
	Metric            uint32
	SummaryTOSDetails []SummaryTOSDetail /* TOS */
}

LS Type 3 or 4

func NewSummaryLsa

func NewSummaryLsa() *SummaryLsa

type SummaryLsaMap

type SummaryLsaMap map[LsaKey]SummaryLsa

type SummaryTOSDetail

type SummaryTOSDetail struct {
	TOS       uint8
	TOSMetric uint32
}

type TOSDetail

type TOSDetail struct {
	TOS       uint8
	TOSMetric uint16
}

type TreeVertex

type TreeVertex struct {
	Paths      []Path
	Distance   uint16
	NumOfPaths int
}

type Vertex

type Vertex struct {
	NbrVertexKey  []VertexKey
	NbrVertexCost []uint16
	LinkData      map[VertexKey]uint32
	LsaKey        LsaKey
	AreaId        uint32
	Visited       bool
	LinkStateId   uint32
	NetMask       uint32
}

type VertexData

type VertexData struct {
	// contains filtered or unexported fields
}

type VertexDataArr

type VertexDataArr []VertexData

func (VertexDataArr) Len

func (v VertexDataArr) Len() int

func (VertexDataArr) Less

func (v VertexDataArr) Less(i, j int) bool

func (VertexDataArr) Swap

func (v VertexDataArr) Swap(i, j int)

type VertexKey

type VertexKey struct {
	Type   uint8
	ID     uint32
	AdvRtr uint32
}

type VlanProperty

type VlanProperty struct {
	Name       string
	UntagPorts []int32
}

Jump to

Keyboard shortcuts

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