use of org.opendaylight.genius.mdsalutil.InstructionInfo in project netvirt by opendaylight.
the class AclNodeDefaultFlowsTxBuilder method programConntrackClassifierFlow.
private void programConntrackClassifierFlow(short tableId, short gotoTableId, MatchEthernetType etherType, IPProtocols protocol) {
String flowId = "Fixed_Conntrk_Classifier_" + dpId + "_" + tableId + "_" + etherType + "_" + protocol.name();
List<MatchInfoBase> matches = new ArrayList<>();
matches.addAll(AclServiceUtils.buildIpProtocolMatches(etherType, protocol));
List<InstructionInfo> instructions = AclServiceOFFlowBuilder.getGotoInstructionInfo(gotoTableId);
InstructionInfo writeMetatdata = AclServiceUtils.getWriteMetadataForAclClassifierType(AclConntrackClassifierType.CONNTRACK_SUPPORTED);
instructions.add(writeMetatdata);
addFlowToTx(tableId, flowId, AclConstants.ACL_DEFAULT_PRIORITY, matches, instructions);
}
use of org.opendaylight.genius.mdsalutil.InstructionInfo in project netvirt by opendaylight.
the class AclNodeDefaultFlowsTxBuilder method addIngressAclTableMissFlows.
/**
* Adds the ingress acl table miss flows.
*/
private void addIngressAclTableMissFlows() {
addDropOrAllowTableMissFlow(NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE, NwConstants.INGRESS_ACL_CONNTRACK_CLASSIFIER_TABLE);
InstructionInfo writeMetatdata = AclServiceUtils.getWriteMetadataForAclClassifierType(AclConntrackClassifierType.NON_CONNTRACK_SUPPORTED);
List<InstructionInfo> instructions = Lists.newArrayList(writeMetatdata);
addGotoOrResubmitTableMissFlow(NwConstants.INGRESS_ACL_CONNTRACK_CLASSIFIER_TABLE, NwConstants.INGRESS_ACL_FILTER_CUM_DISPATCHER_TABLE, instructions);
addDropOrAllowTableMissFlow(NwConstants.INGRESS_ACL_CONNTRACK_SENDER_TABLE, NwConstants.INGRESS_ACL_FOR_EXISTING_TRAFFIC_TABLE);
addGotoOrResubmitTableMissFlow(NwConstants.INGRESS_ACL_FOR_EXISTING_TRAFFIC_TABLE, NwConstants.INGRESS_ACL_FILTER_CUM_DISPATCHER_TABLE);
addDropOrAllowTableMissFlow(NwConstants.INGRESS_ACL_FILTER_CUM_DISPATCHER_TABLE, NwConstants.INGRESS_ACL_RULE_BASED_FILTER_TABLE);
addGotoOrResubmitTableMissFlow(NwConstants.INGRESS_ACL_RULE_BASED_FILTER_TABLE, NwConstants.INGRESS_ACL_FILTER_CUM_DISPATCHER_TABLE);
addGotoOrResubmitTableMissFlow(NwConstants.INGRESS_REMOTE_ACL_TABLE, NwConstants.INGRESS_ACL_FILTER_CUM_DISPATCHER_TABLE);
addDropOrAllowTableMissFlow(NwConstants.INGRESS_ACL_COMMITTER_TABLE, NwConstants.LPORT_DISPATCHER_TABLE);
LOG.debug("Added Stateful Ingress ACL Table Miss Flows for dpn {}", dpId);
}
use of org.opendaylight.genius.mdsalutil.InstructionInfo in project netvirt by opendaylight.
the class ExternalRoutersListener method buildOutboundFlowEntity.
protected FlowEntity buildOutboundFlowEntity(BigInteger dpId, long routerId) {
LOG.debug("buildOutboundFlowEntity : called for dpId {} and routerId{}", dpId, routerId);
List<MatchInfo> matches = new ArrayList<>();
matches.add(MatchEthernetType.IPV4);
matches.add(new MatchMetadata(MetaDataUtil.getVpnIdMetadata(routerId), MetaDataUtil.METADATA_MASK_VRFID));
List<InstructionInfo> instructions = new ArrayList<>();
List<ActionInfo> actionsInfos = new ArrayList<>();
actionsInfos.add(new ActionPuntToController());
instructions.add(new InstructionApplyActions(actionsInfos));
instructions.add(new InstructionWriteMetadata(MetaDataUtil.getVpnIdMetadata(routerId), MetaDataUtil.METADATA_MASK_VRFID));
String flowRef = getFlowRefOutbound(dpId, NwConstants.OUTBOUND_NAPT_TABLE, routerId);
BigInteger cookie = getCookieOutboundFlow(routerId);
FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.OUTBOUND_NAPT_TABLE, flowRef, 5, flowRef, 0, 0, cookie, matches, instructions);
LOG.debug("installOutboundMissEntry : returning flowEntity {}", flowEntity);
return flowEntity;
}
use of org.opendaylight.genius.mdsalutil.InstructionInfo in project netvirt by opendaylight.
the class ExternalRoutersListener method buildSnatFlowEntityForPrmrySwtch.
private FlowEntity buildSnatFlowEntityForPrmrySwtch(BigInteger dpId, String routerName, long routerId) {
LOG.debug("buildSnatFlowEntityForPrmrySwtch : called for primary NAPT switch dpId {}, routerName {}", dpId, routerName);
List<MatchInfo> matches = new ArrayList<>();
matches.add(MatchEthernetType.IPV4);
matches.add(new MatchMetadata(MetaDataUtil.getVpnIdMetadata(routerId), MetaDataUtil.METADATA_MASK_VRFID));
List<InstructionInfo> instructions = new ArrayList<>();
instructions.add(new InstructionGotoTable(NwConstants.OUTBOUND_NAPT_TABLE));
String flowRef = getFlowRefSnat(dpId, NwConstants.PSNAT_TABLE, routerName);
FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.PSNAT_TABLE, flowRef, NatConstants.DEFAULT_PSNAT_FLOW_PRIORITY, flowRef, 0, 0, NwConstants.COOKIE_SNAT_TABLE, matches, instructions);
LOG.debug("buildSnatFlowEntityForPrmrySwtch : Returning SNAT Flow Entity {}", flowEntity);
return flowEntity;
}
use of org.opendaylight.genius.mdsalutil.InstructionInfo in project netvirt by opendaylight.
the class ExternalRoutersListener method buildSnatFlowEntityWithUpdatedVpnIdForPrimrySwtch.
public FlowEntity buildSnatFlowEntityWithUpdatedVpnIdForPrimrySwtch(BigInteger dpId, String routerName, long changedVpnId) {
LOG.debug("buildSnatFlowEntityWithUpdatedVpnIdForPrimrySwtch : called for dpId {}, routerName {} " + "changed VPN ID {}", dpId, routerName, changedVpnId);
List<MatchInfo> matches = new ArrayList<>();
matches.add(MatchEthernetType.IPV4);
matches.add(new MatchMetadata(MetaDataUtil.getVpnIdMetadata(changedVpnId), MetaDataUtil.METADATA_MASK_VRFID));
List<InstructionInfo> instructions = new ArrayList<>();
instructions.add(new InstructionGotoTable(NwConstants.OUTBOUND_NAPT_TABLE));
String flowRef = getFlowRefSnat(dpId, NwConstants.PSNAT_TABLE, routerName);
FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.PSNAT_TABLE, flowRef, NatConstants.DEFAULT_PSNAT_FLOW_PRIORITY, flowRef, 0, 0, NwConstants.COOKIE_SNAT_TABLE, matches, instructions);
LOG.debug("buildSnatFlowEntityWithUpdatedVpnIdForPrimrySwtch : Returning SNAT Flow Entity {}", flowEntity);
return flowEntity;
}
Aggregations