use of org.onosproject.openstacknetworking.api.Constants.ROUTING_TABLE in project onos by opennetworkinglab.
the class OpenstackRoutingHandler method setRouterAdminRules.
private void setRouterAdminRules(String segmentId, Type networkType, boolean install) {
TrafficTreatment treatment;
TrafficSelector.Builder sBuilder = DefaultTrafficSelector.builder().matchEthType(Ethernet.TYPE_IPV4);
switch(networkType) {
case VXLAN:
case GRE:
case GENEVE:
sBuilder.matchTunnelId(Long.parseLong(segmentId));
break;
case VLAN:
sBuilder.matchVlanId(VlanId.vlanId(segmentId));
break;
default:
final String error = String.format("%s %s", ERR_UNSUPPORTED_NET_TYPE, networkType.toString());
throw new IllegalStateException(error);
}
treatment = DefaultTrafficTreatment.builder().drop().build();
osNodeService.completeNodes().stream().filter(osNode -> osNode.type() == COMPUTE).forEach(osNode -> {
osFlowRuleService.setRule(appId, osNode.intgBridge(), sBuilder.build(), treatment, PRIORITY_ADMIN_RULE, ROUTING_TABLE, install);
});
}
Aggregations