use of org.opendaylight.genius.mdsalutil.InstructionInfo in project netvirt by opendaylight.
the class VpnNodeListener method createTableMissForVpnGwFlow.
private void createTableMissForVpnGwFlow(WriteTransaction writeFlowTx, BigInteger dpId) {
List<MatchInfo> matches = new ArrayList<>();
List<ActionInfo> actionsInfos = Collections.singletonList(new ActionNxResubmit(NwConstants.LPORT_DISPATCHER_TABLE));
List<InstructionInfo> instructions = Collections.singletonList(new InstructionApplyActions(actionsInfos));
FlowEntity flowEntityMissforGw = MDSALUtil.buildFlowEntity(dpId, NwConstants.L3_GW_MAC_TABLE, getTableMissFlowRef(dpId, NwConstants.L3_GW_MAC_TABLE, NwConstants.TABLE_MISS_FLOW), NwConstants.TABLE_MISS_PRIORITY, "L3 Gw Mac Table Miss", 0, 0, new BigInteger("1080000", 16), matches, instructions);
LOG.trace("Invoking MDSAL to install L3 Gw Mac Table Miss Entry");
mdsalManager.addFlowToTx(flowEntityMissforGw, writeFlowTx);
}
use of org.opendaylight.genius.mdsalutil.InstructionInfo in project netvirt by opendaylight.
the class DhcpManager method setupTableMissForHandlingExternalTunnel.
private void setupTableMissForHandlingExternalTunnel(BigInteger dpId) {
List<MatchInfo> matches = new ArrayList<>();
List<InstructionInfo> instructions = new ArrayList<>();
instructions.add(new InstructionGotoTable(NwConstants.EXTERNAL_TUNNEL_TABLE));
FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.DHCP_TABLE_EXTERNAL_TUNNEL, "DHCPTableMissFlowForExternalTunnel", 0, "DHCP Table Miss Flow For External Tunnel", 0, 0, DhcpMConstants.COOKIE_DHCP_BASE, matches, instructions);
DhcpServiceCounters.install_dhcp_table_miss_flow_for_external_table.inc();
mdsalUtil.installFlow(flowEntity);
}
use of org.opendaylight.genius.mdsalutil.InstructionInfo in project netvirt by opendaylight.
the class DhcpManager method setupDhcpAllocationPoolFlow.
private void setupDhcpAllocationPoolFlow(BigInteger dpId) {
List<MatchInfo> matches = DhcpServiceUtils.getDhcpMatch();
List<InstructionInfo> instructions = new ArrayList<>();
List<ActionInfo> actionsInfos = new ArrayList<>();
actionsInfos.add(new ActionPuntToController());
instructions.add(new InstructionApplyActions(actionsInfos));
FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.DHCP_TABLE, "DhcpAllocationPoolFlow", DhcpMConstants.DEFAULT_DHCP_ALLOCATION_POOL_FLOW_PRIORITY, "Dhcp Allocation Pool Flow", 0, 0, DhcpMConstants.COOKIE_DHCP_BASE, matches, instructions);
LOG.trace("Installing DHCP Allocation Pool Flow DpId {}", dpId);
DhcpServiceCounters.install_dhcp_flow.inc();
mdsalUtil.installFlow(flowEntity);
}
use of org.opendaylight.genius.mdsalutil.InstructionInfo in project netvirt by opendaylight.
the class VpnServiceChainUtils method buildLFibVpnPseudoPortFlow.
/**
* Builds a Flow for the LFIB table that sets the LPortTag of the
* VpnPseudoPort and sends to LPortDispatcher table.
* <ul>
* <li>Matching: eth_type = MPLS, mpls_label = VPN MPLS label
* <li>Actions: setMetadata LportTag and SI=2, pop MPLS, Go to
* LPortDispacherTable
* </ul>
*
* @param dpId DpnId
* @param label MPLS label
* @param nextHop Next Hop IP
* @param lportTag Pseudo Logical Port tag
* @return the FlowEntity
*/
public static FlowEntity buildLFibVpnPseudoPortFlow(BigInteger dpId, Long label, String nextHop, int lportTag) {
List<MatchInfo> matches = new ArrayList<>();
matches.add(MatchEthernetType.MPLS_UNICAST);
matches.add(new MatchMplsLabel(label));
List<ActionInfo> actionsInfos = Collections.singletonList(new ActionPopMpls());
List<InstructionInfo> instructions = new ArrayList<>();
instructions.add(new InstructionWriteMetadata(MetaDataUtil.getMetaDataForLPortDispatcher(lportTag, ServiceIndex.getIndex(NwConstants.SCF_SERVICE_NAME, NwConstants.SCF_SERVICE_INDEX)), MetaDataUtil.getMetaDataMaskForLPortDispatcher()));
instructions.add(new InstructionApplyActions(actionsInfos));
instructions.add(new InstructionGotoTable(NwConstants.L3_INTERFACE_TABLE));
String flowRef = getLFibVpnPseudoPortFlowRef(lportTag, label, nextHop);
return MDSALUtil.buildFlowEntity(dpId, NwConstants.L3_LFIB_TABLE, flowRef, CloudServiceChainConstants.DEFAULT_SCF_FLOW_PRIORITY, flowRef, 0, 0, NwConstants.COOKIE_VM_LFIB_TABLE, matches, instructions);
}
use of org.opendaylight.genius.mdsalutil.InstructionInfo in project netvirt by opendaylight.
the class PolicyServiceFlowUtil method getPolicyClassifierInstructions.
public List<InstructionInfo> getPolicyClassifierInstructions(long policyClassifierId) {
List<InstructionInfo> instructions = new ArrayList<>();
instructions.add(new InstructionWriteMetadata(MetaDataUtil.getPolicyClassifierMetaData(policyClassifierId), MetaDataUtil.METADATA_MASK_POLICY_CLASSIFER_ID));
instructions.add(new InstructionGotoTable(NwConstants.EGRESS_POLICY_ROUTING_TABLE));
return instructions;
}
Aggregations