From 406efffa74eadb44826e4b464dc2fbabdddf72c4 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Wed, 11 Nov 2015 22:54:21 +0900 Subject: *: add global listen port configuration if port < 0, gobgpd won't listen on tcp:179 Signed-off-by: ISHIDA Wataru --- config/bgp_configs.go | 8 ++++++++ config/default.go | 4 ++++ 2 files changed, 12 insertions(+) (limited to 'config') diff --git a/config/bgp_configs.go b/config/bgp_configs.go index 5611124d..6302d867 100644 --- a/config/bgp_configs.go +++ b/config/bgp_configs.go @@ -802,6 +802,12 @@ type Neighbors struct { NeighborList []Neighbor } +//struct for container gobgp:listen-config +type ListenConfig struct { + // original -> gobgp:port + Port int32 +} + //struct for container gobgp:mpls-label-range type MplsLabelRange struct { // original -> gobgp:min-label @@ -1376,6 +1382,8 @@ type Global struct { Zebra Zebra // original -> gobgp:mpls-label-range MplsLabelRange MplsLabelRange + // original -> gobgp:listen-config + ListenConfig ListenConfig } //struct for container bgp:bgp diff --git a/config/default.go b/config/default.go index 2170e0dd..9f58a9b8 100644 --- a/config/default.go +++ b/config/default.go @@ -47,6 +47,10 @@ func SetDefaultConfigValues(md toml.MetaData, bt *Bgp) error { } } + if bt.Global.ListenConfig.Port == 0 { + bt.Global.ListenConfig.Port = bgp.BGP_PORT + } + if _, ok := global["Global.MplsLabelRange.MinLabel"]; !ok { bt.Global.MplsLabelRange.MinLabel = DEFAULT_MPLS_LABEL_MIN } -- cgit v1.2.3