Skip to content
Snippets Groups Projects
main.go 552 B
Newer Older
  • Learn to ignore specific revisions
  • Oliver Herms's avatar
    Oliver Herms committed
    package main
    
    import (
    	"fmt"
    
    Oliver Herms's avatar
    Oliver Herms committed
    	"time"
    
    Oliver Herms's avatar
    Oliver Herms committed
    
    	"github.com/sirupsen/logrus"
    
    
    Oliver Herms's avatar
    Oliver Herms committed
    	"github.com/bio-routing/bio-rd/protocols/bgp/server"
    
    Oliver Herms's avatar
    Oliver Herms committed
    	"github.com/bio-routing/bio-rd/routingtable/locRIB"
    
    
    	bnet "github.com/bio-routing/bio-rd/net"
    
    Oliver Herms's avatar
    Oliver Herms committed
    )
    
    
    func strAddr(s string) uint32 {
    	ret, _ := bnet.StrToAddr(s)
    	return ret
    }
    
    
    Oliver Herms's avatar
    Oliver Herms committed
    func main() {
    
    Christoph Petrausch's avatar
    Christoph Petrausch committed
    	logrus.Printf("This is a BGP speaker\n")
    
    Oliver Herms's avatar
    Oliver Herms committed
    
    
    Oliver Herms's avatar
    Oliver Herms committed
    	rib := locRIB.New()
    
    Oliver Herms's avatar
    Oliver Herms committed
    	b := server.NewBgpServer()
    
    	startServer(b, rib)
    
    Oliver Herms's avatar
    Oliver Herms committed
    
    	go func() {
    		for {
    
    			fmt.Printf("LocRIB count: %d\n", rib.Count())
    
    Oliver Herms's avatar
    Oliver Herms committed
    			time.Sleep(time.Second * 10)
    		}
    	}()
    
    Oliver Herms's avatar
    Oliver Herms committed
    
    
    Oliver Herms's avatar
    Oliver Herms committed
    }