use of org.onosproject.segmentrouting.OsgiPropertyConstants.PROP_PW_TRANSPORT_VLAN in project trellis-control by opennetworkinglab.
the class SegmentRoutingManager method modified.
@Modified
private void modified(ComponentContext context) {
Dictionary<?, ?> properties = context.getProperties();
if (properties == null) {
return;
}
String strActiveProbing = Tools.get(properties, PROP_ACTIVE_PROBING);
boolean expectActiveProbing = Boolean.parseBoolean(strActiveProbing);
if (expectActiveProbing != activeProbing) {
activeProbing = expectActiveProbing;
log.info("{} active probing", activeProbing ? "Enabling" : "Disabling");
}
String strSymmetricProbing = Tools.get(properties, PROP_SYMMETRIC_PROBING);
boolean expectSymmetricProbing = Boolean.parseBoolean(strSymmetricProbing);
if (expectSymmetricProbing != symmetricProbing) {
symmetricProbing = expectSymmetricProbing;
log.info("{} symmetric probing", symmetricProbing ? "Enabling" : "Disabling");
}
String strSingleHomedDown = Tools.get(properties, PROP_SINGLE_HOMED_DOWN);
boolean expectSingleHomedDown = Boolean.parseBoolean(strSingleHomedDown);
if (expectSingleHomedDown != singleHomedDown) {
singleHomedDown = expectSingleHomedDown;
log.info("{} downing of single homed hosts for lost uplinks", singleHomedDown ? "Enabling" : "Disabling");
if (singleHomedDown && linkHandler != null) {
hostService.getHosts().forEach(host -> host.locations().forEach(loc -> {
if (interfaceService.isConfigured(loc)) {
linkHandler.checkUplinksForHost(loc);
}
}));
} else {
log.warn("Disabling singleHomedDown does not re-enable already " + "downed ports for single-homed hosts");
}
}
String strRespondToUnknownHosts = Tools.get(properties, PROP_RESPOND_TO_UNKNOWN_HOSTS);
boolean expectRespondToUnknownHosts = Boolean.parseBoolean(strRespondToUnknownHosts);
if (expectRespondToUnknownHosts != respondToUnknownHosts) {
respondToUnknownHosts = expectRespondToUnknownHosts;
log.info("{} responding to ARPs/NDPs from unknown hosts", respondToUnknownHosts ? "Enabling" : "Disabling");
}
String strRouteDoubleTaggedHosts = Tools.get(properties, PROP_ROUTE_DOUBLE_TAGGED_HOSTS);
boolean expectRouteDoubleTaggedHosts = Boolean.parseBoolean(strRouteDoubleTaggedHosts);
if (expectRouteDoubleTaggedHosts != routeDoubleTaggedHosts) {
routeDoubleTaggedHosts = expectRouteDoubleTaggedHosts;
log.info("{} routing for double tagged hosts", routeDoubleTaggedHosts ? "Enabling" : "Disabling");
if (routeDoubleTaggedHosts) {
hostHandler.populateAllDoubleTaggedHost();
} else {
hostHandler.revokeAllDoubleTaggedHost();
}
}
String strDefaultInternalVlan = Tools.get(properties, PROP_DEFAULT_INTERNAL_VLAN);
int defIntVlan = Integer.parseInt(strDefaultInternalVlan);
if (defIntVlan != defaultInternalVlan) {
if (canUseVlanId(defIntVlan)) {
log.warn("Default internal vlan value changed from {} to {}.. " + "re-programming filtering rules, but NOT any groups already " + "created with the former value", defaultInternalVlan, defIntVlan);
VlanId oldDefIntVlan = VlanId.vlanId((short) defaultInternalVlan);
defaultInternalVlan = defIntVlan;
routingRulePopulator.updateSpecialVlanFilteringRules(true, oldDefIntVlan, VlanId.vlanId((short) defIntVlan));
} else {
log.warn("Cannot change default internal vlan to unusable " + "value {}", defIntVlan);
}
}
String strPwTxpVlan = Tools.get(properties, PROP_PW_TRANSPORT_VLAN);
int pwTxpVlan = Integer.parseInt(strPwTxpVlan);
if (pwTxpVlan != pwTransportVlan) {
if (canUseVlanId(pwTxpVlan)) {
log.warn("Pseudowire transport vlan value changed from {} to {}.. " + "re-programming filtering rules, but NOT any groups already " + "created with the former value", pwTransportVlan, pwTxpVlan);
VlanId oldPwTxpVlan = VlanId.vlanId((short) pwTransportVlan);
pwTransportVlan = pwTxpVlan;
routingRulePopulator.updateSpecialVlanFilteringRules(false, oldPwTxpVlan, VlanId.vlanId((short) pwTxpVlan));
} else {
log.warn("Cannot change pseudowire transport vlan to unusable " + "value {}", pwTxpVlan);
}
}
String strRouteSimplification = Tools.get(properties, PROP_ROUTE_SIMPLIFICATION);
boolean expectRouteSimplification = Boolean.parseBoolean(strRouteSimplification);
if (expectRouteSimplification != routeSimplification) {
routeSimplification = expectRouteSimplification;
log.info("{} route simplification", routeSimplification ? "Enabling" : "Disabling");
}
}
Aggregations