summaryrefslogtreecommitdiffstats
path: root/infra
diff options
context:
space:
mode:
Diffstat (limited to 'infra')
-rw-r--r--infra/bgp-distribution-test/src/test/resources/bgp.json1
-rw-r--r--infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpConfiguration.java17
-rw-r--r--infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpRIBProvider.java8
-rw-r--r--infra/northbound/bgp/src/main/resources/honeycomb-minimal-resources/config/bgp.json1
4 files changed, 16 insertions, 11 deletions
diff --git a/infra/bgp-distribution-test/src/test/resources/bgp.json b/infra/bgp-distribution-test/src/test/resources/bgp.json
index c352fb0f2..5cc9a419c 100644
--- a/infra/bgp-distribution-test/src/test/resources/bgp.json
+++ b/infra/bgp-distribution-test/src/test/resources/bgp.json
@@ -4,5 +4,6 @@
"bgp-as-number": 65000,
"bgp-receive-multiple-paths": "true",
"bgp-send-max-paths": 0,
+ "bgp-protocol-instance-name": "hc-bgp-instance",
"bgp-netty-threads": 2
} \ No newline at end of file
diff --git a/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpConfiguration.java b/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpConfiguration.java
index 6cc245af7..9335fb33d 100644
--- a/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpConfiguration.java
+++ b/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpConfiguration.java
@@ -45,17 +45,20 @@ public class BgpConfiguration {
public Optional<String> bgpMultiplePaths;
@InjectConfig("bgp-send-max-paths")
public Optional<Integer> bgpSendMaxMaths;
+ @InjectConfig("bgp-protocol-instance-name")
+ public Optional<String> bgpProtocolInstanceName;
@InjectConfig("bgp-netty-threads")
public Integer bgpNettyThreads;
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
- .add("bgpBindingAddress", bgpBindingAddress)
- .add("bgpPort", bgpPort)
- .add("bgp-as-number", bgpAsNumber)
- .add("bgp-netty-threads", bgpNettyThreads)
- .add("bgp-receive-multiple-paths", bgpMultiplePaths)
- .add("bgp-send-max-paths", bgpSendMaxMaths)
- .toString();
+ .add("bgpBindingAddress", bgpBindingAddress)
+ .add("bgpPort", bgpPort)
+ .add("bgpAsNumber", bgpAsNumber)
+ .add("bgpMultiplePaths", bgpMultiplePaths)
+ .add("bgpSendMaxMaths", bgpSendMaxMaths)
+ .add("bgpProtocolInstanceName", bgpProtocolInstanceName)
+ .add("bgpNettyThreads", bgpNettyThreads)
+ .toString();
}
}
diff --git a/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpRIBProvider.java b/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpRIBProvider.java
index 9cd02b49e..7fcddfc5c 100644
--- a/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpRIBProvider.java
+++ b/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpRIBProvider.java
@@ -52,7 +52,6 @@ import org.slf4j.LoggerFactory;
final class BgpRIBProvider extends ProviderTrait<RIB> {
private static final Logger LOG = LoggerFactory.getLogger(BgpRIBProvider.class);
- private static final String HC_BGP_INSTANCE_NAME = "hc-bgp-instance";
@Inject
private BgpConfiguration cfg;
@@ -93,9 +92,10 @@ final class BgpRIBProvider extends ProviderTrait<RIB> {
new TablesKey(entry.getKey().getAfi(), entry.getKey().getSafi()), Map.Entry::getValue));
// based on RIBImpl.createRib
final RIBImpl rib =
- new RIBImpl(new NoopClusterSingletonServiceProvider(), new RibId(HC_BGP_INSTANCE_NAME), asNumber,
- new BgpId(routerId), clusterId, extensions, dispatcher, codec, new PingPongDataBroker(domBroker),
- mappingService.toTableTypes(afiSafi), pathSelectionModes, extensions.getClassLoadingStrategy(), null);
+ new RIBImpl(new NoopClusterSingletonServiceProvider(), new RibId(cfg.bgpProtocolInstanceName.get()),
+ asNumber, new BgpId(routerId), clusterId, extensions, dispatcher, codec,
+ new PingPongDataBroker(domBroker), mappingService.toTableTypes(afiSafi), pathSelectionModes,
+ extensions.getClassLoadingStrategy(), null);
// required for proper RIB's CodecRegistry initialization (based on RIBImpl.start)
schemaService.registerSchemaContextListener(rib);
diff --git a/infra/northbound/bgp/src/main/resources/honeycomb-minimal-resources/config/bgp.json b/infra/northbound/bgp/src/main/resources/honeycomb-minimal-resources/config/bgp.json
index 2efe55ee3..093acb85b 100644
--- a/infra/northbound/bgp/src/main/resources/honeycomb-minimal-resources/config/bgp.json
+++ b/infra/northbound/bgp/src/main/resources/honeycomb-minimal-resources/config/bgp.json
@@ -4,5 +4,6 @@
"bgp-as-number": 65000,
"bgp-receive-multiple-paths": "true",
"bgp-send-max-paths": 0,
+ "bgp-protocol-instance-name": "hc-bgp-instance",
"bgp-netty-threads": 2
} \ No newline at end of file