diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-11-11 22:54:21 +0900 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-12-21 19:28:25 +0900 |
commit | 406efffa74eadb44826e4b464dc2fbabdddf72c4 (patch) | |
tree | 78ba4c1b69ed3272e76175c70b26b2839b93130d /config | |
parent | e71fb3a3ae6129573f50848f7af8e83eb8a4d7e2 (diff) |
*: add global listen port configuration
if port < 0, gobgpd won't listen on tcp:179
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'config')
-rw-r--r-- | config/bgp_configs.go | 8 | ||||
-rw-r--r-- | config/default.go | 4 |
2 files changed, 12 insertions, 0 deletions
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 } |