From 23c9b35acfb6fffe9c6a3cbda91a7857497f9385 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Sat, 31 Oct 2015 08:29:44 +0000 Subject: *: initial openswitch integration support this patch enables the configuration below via ovsdb - addition of router - addition/deletion of neighbor from vtysh of openswitch switch# conf t switch# router bgp 65000 switch# bgp router-id 10.10.10.10 switch# neighbor 192.168.10.1 remote-as 65001 switch# neighbor 192.168.10.2 remote-as 65002 switch# no neighbor 192.168.10.1 Signed-off-by: ISHIDA Wataru --- gobgpd/main.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'gobgpd/main.go') diff --git a/gobgpd/main.go b/gobgpd/main.go index 6024b102..810137a0 100644 --- a/gobgpd/main.go +++ b/gobgpd/main.go @@ -20,6 +20,7 @@ import ( "github.com/Sirupsen/logrus/hooks/syslog" "github.com/jessevdk/go-flags" "github.com/osrg/gobgp/config" + ops "github.com/osrg/gobgp/openswitch" "github.com/osrg/gobgp/packet" "github.com/osrg/gobgp/server" "io/ioutil" @@ -45,6 +46,7 @@ func main() { Facility string `long:"syslog-facility" description:"specify syslog facility"` DisableStdlog bool `long:"disable-stdlog" description:"disable standard logging"` CPUs int `long:"cpus" description:"specify the number of CPUs to be used"` + Ops bool `long:"openswitch" description:"openswitch mode"` } _, err := flags.Parse(&opts) if err != nil { @@ -150,11 +152,18 @@ func main() { configCh := make(chan config.BgpConfigSet) reloadCh := make(chan bool) - if opts.ConfigFile != "" { + bgpServer := server.NewBgpServer(bgp.BGP_PORT) + if opts.Ops { + m, err := ops.NewOpsConfigManager(bgpServer.GrpcReqCh) + if err != nil { + log.Errorf("Failed to start ops config manager: %s", err) + os.Exit(1) + } + go m.Serve() + } else if opts.ConfigFile != "" { go config.ReadConfigfileServe(opts.ConfigFile, configCh, reloadCh) reloadCh <- true } - bgpServer := server.NewBgpServer(bgp.BGP_PORT) go bgpServer.Serve() // start grpc Server -- cgit v1.2.3