summaryrefslogtreecommitdiffhomepage
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/bgp_configs.go10
-rw-r--r--config/default.go10
2 files changed, 20 insertions, 0 deletions
diff --git a/config/bgp_configs.go b/config/bgp_configs.go
index cd8df79d..ae19a162 100644
--- a/config/bgp_configs.go
+++ b/config/bgp_configs.go
@@ -791,6 +791,14 @@ type Neighbors struct {
NeighborList []Neighbor
}
+//struct for container gobgp:mpls-label-range
+type MplsLabelRange struct {
+ // original -> gobgp:min-label
+ MinLabel uint32
+ // original -> gobgp:max-label
+ MaxLabel uint32
+}
+
//struct for container gobgp:zebra
type Zebra struct {
// original -> gobgp:enabled
@@ -1346,6 +1354,8 @@ type Global struct {
Mrt Mrt
// original -> gobgp:zebra
Zebra Zebra
+ // original -> gobgp:mpls-label-range
+ MplsLabelRange MplsLabelRange
}
//struct for container bgp:bgp
diff --git a/config/default.go b/config/default.go
index d3160989..2170e0dd 100644
--- a/config/default.go
+++ b/config/default.go
@@ -10,6 +10,8 @@ const (
DEFAULT_HOLDTIME = 90
DEFAULT_IDLE_HOLDTIME_AFTER_RESET = 30
DEFAULT_CONNECT_RETRY = 120
+ DEFAULT_MPLS_LABEL_MIN = 16000
+ DEFAULT_MPLS_LABEL_MAX = 1048575
)
type neighbor struct {
@@ -45,6 +47,14 @@ func SetDefaultConfigValues(md toml.MetaData, bt *Bgp) error {
}
}
+ if _, ok := global["Global.MplsLabelRange.MinLabel"]; !ok {
+ bt.Global.MplsLabelRange.MinLabel = DEFAULT_MPLS_LABEL_MIN
+ }
+
+ if _, ok := global["Global.MplsLabelRange.MaxLabel"]; !ok {
+ bt.Global.MplsLabelRange.MaxLabel = DEFAULT_MPLS_LABEL_MAX
+ }
+
nidx := 0
for _, key := range md.Keys() {
if !strings.HasPrefix(key.String(), "Neighbors.NeighborList") {