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);
}
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);
}
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;
}
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;
}
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;
}
Aggregations