summaryrefslogtreecommitdiffhomepage
path: root/gobgpd
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-10-31 08:29:44 +0000
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-11-01 14:08:38 +0000
commit23c9b35acfb6fffe9c6a3cbda91a7857497f9385 (patch)
tree3e85c44c3b15f88b134b603f413f422e862f50b0 /gobgpd
parent0b4fa89925851134149372580f23ec6b036c835d (diff)
*: 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 <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'gobgpd')
-rw-r--r--gobgpd/main.go13
1 files changed, 11 insertions, 2 deletions
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