Skip to content
Snippets Groups Projects
Unverified Commit 9d775325 authored by Daniel Czerwonk's avatar Daniel Czerwonk Committed by GitHub
Browse files

Merge branch 'master' into feature/metrics

parents 45ab7091 fd1ccf16
No related branches found
No related tags found
No related merge requests found
...@@ -79,7 +79,7 @@ func main() { ...@@ -79,7 +79,7 @@ func main() {
go func() { go func() {
for { for {
fmt.Print(rib.Print()) fmt.Printf("LocRIB count: %d\n", rib.Count())
time.Sleep(time.Second * 10) time.Sleep(time.Second * 10)
} }
}() }()
......
...@@ -82,7 +82,6 @@ func serializeAndSendUpdate(out io.Writer, update serializeAbleUpdate) error { ...@@ -82,7 +82,6 @@ func serializeAndSendUpdate(out io.Writer, update serializeAbleUpdate) error {
return nil return nil
} }
fmt.Printf("Sending Update: %v\n", updateBytes)
_, err = out.Write(updateBytes) _, err = out.Write(updateBytes)
if err != nil { if err != nil {
return fmt.Errorf("Failed sending Update: %v", err) return fmt.Errorf("Failed sending Update: %v", err)
......
...@@ -72,12 +72,10 @@ func (a *AdjRIBOut) AddPath(pfx bnet.Prefix, p *route.Path) error { ...@@ -72,12 +72,10 @@ func (a *AdjRIBOut) AddPath(pfx bnet.Prefix, p *route.Path) error {
a.removePathsFromClients(pfx, oldPaths) a.removePathsFromClients(pfx, oldPaths)
} }
fmt.Printf("Adding path: %s\n", p.Print())
pathID, err := a.pathIDManager.addPath(p) pathID, err := a.pathIDManager.addPath(p)
if err != nil { if err != nil {
return fmt.Errorf("Unable to get path ID: %v", err) return fmt.Errorf("Unable to get path ID: %v", err)
} }
fmt.Printf("New path ID: %d\n", pathID)
p.BGPPath.PathIdentifier = pathID p.BGPPath.PathIdentifier = pathID
a.rt.AddPath(pfx, p) a.rt.AddPath(pfx, p)
......
...@@ -27,6 +27,14 @@ func New() *LocRIB { ...@@ -27,6 +27,14 @@ func New() *LocRIB {
return a return a
} }
//Count routes from the LocRIP
func (a *LocRIB) Count() uint64 {
a.mu.RLock()
defer a.mu.RUnlock()
return uint64(len(a.rt.Dump()))
}
// UpdateNewClient sends current state to a new client // UpdateNewClient sends current state to a new client
func (a *LocRIB) UpdateNewClient(client routingtable.RouteTableClient) error { func (a *LocRIB) UpdateNewClient(client routingtable.RouteTableClient) error {
a.mu.RLock() a.mu.RLock()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment