Search in sources :

Example 6 with MatchTunnelId

use of org.opendaylight.genius.mdsalutil.matches.MatchTunnelId in project netvirt by opendaylight.

the class VrfEntryListener method createTerminatingServiceActions.

public void createTerminatingServiceActions(BigInteger destDpId, int label, List<ActionInfo> actionsInfos, WriteTransaction tx) {
    List<MatchInfo> mkMatches = new ArrayList<>();
    LOG.debug("create terminatingServiceAction on DpnId = {} and serviceId = {} and actions = {}", destDpId, label, actionsInfos);
    // Matching metadata
    // FIXME vxlan vni bit set is not working properly with OVS.need to revisit
    mkMatches.add(new MatchTunnelId(BigInteger.valueOf(label)));
    List<InstructionInfo> mkInstructions = new ArrayList<>();
    mkInstructions.add(new InstructionApplyActions(actionsInfos));
    FlowEntity terminatingServiceTableFlowEntity = MDSALUtil.buildFlowEntity(destDpId, NwConstants.INTERNAL_TUNNEL_TABLE, getTableMissFlowRef(destDpId, NwConstants.INTERNAL_TUNNEL_TABLE, label), 5, String.format("%s:%d", "TST Flow Entry ", label), 0, 0, COOKIE_TUNNEL.add(BigInteger.valueOf(label)), mkMatches, mkInstructions);
    FlowKey flowKey = new FlowKey(new FlowId(terminatingServiceTableFlowEntity.getFlowId()));
    FlowBuilder flowbld = terminatingServiceTableFlowEntity.getFlowBuilder();
    Node nodeDpn = FibUtil.buildDpnNode(terminatingServiceTableFlowEntity.getDpnId());
    InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class).child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class).child(Table.class, new TableKey(terminatingServiceTableFlowEntity.getTableId())).child(Flow.class, flowKey).build();
    tx.put(LogicalDatastoreType.CONFIGURATION, flowInstanceId, flowbld.build(), WriteTransaction.CREATE_MISSING_PARENTS);
}
Also used : FlowKey(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey) FlowCapableNode(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode) Node(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node) FlowCapableNode(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) ArrayList(java.util.ArrayList) TableKey(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey) Nodes(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes) FlowEntity(org.opendaylight.genius.mdsalutil.FlowEntity) Flow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow) FlowId(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId) MatchTunnelId(org.opendaylight.genius.mdsalutil.matches.MatchTunnelId) FlowBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder) MatchInfo(org.opendaylight.genius.mdsalutil.MatchInfo) InstructionInfo(org.opendaylight.genius.mdsalutil.InstructionInfo) InstructionApplyActions(org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions)

Example 7 with MatchTunnelId

use of org.opendaylight.genius.mdsalutil.matches.MatchTunnelId in project netvirt by opendaylight.

the class VrfEntryListener method removeTunnelTableEntry.

private void removeTunnelTableEntry(BigInteger dpId, long label, WriteTransaction tx) {
    FlowEntity flowEntity;
    LOG.debug("remove terminatingServiceActions called with DpnId = {} and label = {}", dpId, label);
    List<MatchInfo> mkMatches = new ArrayList<>();
    // Matching metadata
    mkMatches.add(new MatchTunnelId(BigInteger.valueOf(label)));
    flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.INTERNAL_TUNNEL_TABLE, getTableMissFlowRef(dpId, NwConstants.INTERNAL_TUNNEL_TABLE, (int) label), 5, String.format("%s:%d", "TST Flow Entry ", label), 0, 0, COOKIE_TUNNEL.add(BigInteger.valueOf(label)), mkMatches, null);
    Node nodeDpn = FibUtil.buildDpnNode(flowEntity.getDpnId());
    FlowKey flowKey = new FlowKey(new FlowId(flowEntity.getFlowId()));
    InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class).child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class).child(Table.class, new TableKey(flowEntity.getTableId())).child(Flow.class, flowKey).build();
    tx.delete(LogicalDatastoreType.CONFIGURATION, flowInstanceId);
    LOG.debug("Terminating service Entry for dpID {} : label : {} removed successfully", dpId, label);
}
Also used : FlowKey(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey) FlowCapableNode(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode) Node(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node) FlowCapableNode(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) ArrayList(java.util.ArrayList) TableKey(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey) Nodes(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes) FlowEntity(org.opendaylight.genius.mdsalutil.FlowEntity) Flow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow) FlowId(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId) MatchTunnelId(org.opendaylight.genius.mdsalutil.matches.MatchTunnelId) MatchInfo(org.opendaylight.genius.mdsalutil.MatchInfo)

Example 8 with MatchTunnelId

use of org.opendaylight.genius.mdsalutil.matches.MatchTunnelId in project genius by opendaylight.

the class ItmManagerRpcService method getTunnelMatchesForServiceId.

public List<MatchInfo> getTunnelMatchesForServiceId(int serviceId) {
    final List<MatchInfo> mkMatches = new ArrayList<>();
    // Matching metadata
    mkMatches.add(new MatchTunnelId(BigInteger.valueOf(serviceId)));
    return mkMatches;
}
Also used : MatchTunnelId(org.opendaylight.genius.mdsalutil.matches.MatchTunnelId) MatchInfo(org.opendaylight.genius.mdsalutil.MatchInfo) ArrayList(java.util.ArrayList)

Example 9 with MatchTunnelId

use of org.opendaylight.genius.mdsalutil.matches.MatchTunnelId in project netvirt by opendaylight.

the class ElanUtils method getTunnelMatchesForServiceId.

public static List<MatchInfo> getTunnelMatchesForServiceId(int elanTag) {
    List<MatchInfo> mkMatches = new ArrayList<>();
    // Matching metadata
    mkMatches.add(new MatchTunnelId(BigInteger.valueOf(elanTag)));
    return mkMatches;
}
Also used : MatchTunnelId(org.opendaylight.genius.mdsalutil.matches.MatchTunnelId) MatchInfo(org.opendaylight.genius.mdsalutil.MatchInfo) ArrayList(java.util.ArrayList)

Example 10 with MatchTunnelId

use of org.opendaylight.genius.mdsalutil.matches.MatchTunnelId in project netvirt by opendaylight.

the class ElanInterfaceManager method getMatchesForFilterEqualsLPortTag.

private List<MatchInfo> getMatchesForFilterEqualsLPortTag(int lportTag) {
    List<MatchInfo> mkMatches = new ArrayList<>();
    // Matching metadata
    mkMatches.add(new MatchMetadata(MetaDataUtil.getLportTagMetaData(lportTag), MetaDataUtil.METADATA_MASK_LPORT_TAG));
    mkMatches.add(new MatchTunnelId(BigInteger.valueOf(lportTag)));
    return mkMatches;
}
Also used : MatchMetadata(org.opendaylight.genius.mdsalutil.matches.MatchMetadata) MatchTunnelId(org.opendaylight.genius.mdsalutil.matches.MatchTunnelId) MatchInfo(org.opendaylight.genius.mdsalutil.MatchInfo) ArrayList(java.util.ArrayList)

Aggregations

MatchInfo (org.opendaylight.genius.mdsalutil.MatchInfo)24 MatchTunnelId (org.opendaylight.genius.mdsalutil.matches.MatchTunnelId)24 ArrayList (java.util.ArrayList)23 Flow (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow)11 InstructionInfo (org.opendaylight.genius.mdsalutil.InstructionInfo)9 FlowEntity (org.opendaylight.genius.mdsalutil.FlowEntity)7 ActionInfo (org.opendaylight.genius.mdsalutil.ActionInfo)5 InstructionApplyActions (org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions)5 BigInteger (java.math.BigInteger)3 FlowId (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId)3 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)2 ActionNxConntrack (org.opendaylight.genius.mdsalutil.actions.ActionNxConntrack)2 NxCtAction (org.opendaylight.genius.mdsalutil.actions.ActionNxConntrack.NxCtAction)2 ActionNxLoadMetadata (org.opendaylight.genius.mdsalutil.actions.ActionNxLoadMetadata)2 ActionPuntToController (org.opendaylight.genius.mdsalutil.actions.ActionPuntToController)2 InstructionGotoTable (org.opendaylight.genius.mdsalutil.instructions.InstructionGotoTable)2 InstructionWriteMetadata (org.opendaylight.genius.mdsalutil.instructions.InstructionWriteMetadata)2 FlowCapableNode (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode)2 TableKey (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey)2 FlowBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder)2