use of org.opendaylight.genius.mdsalutil.matches.MatchInPort in project genius by opendaylight.
the class FlowBasedServicesUtils method getMatchInfoForTunnelPortAtIngressTable.
@Nonnull
public static List<MatchInfo> getMatchInfoForTunnelPortAtIngressTable(BigInteger dpId, long portNo) {
List<MatchInfo> matches = new ArrayList<>();
matches.add(new MatchInPort(dpId, portNo));
return matches;
}
use of org.opendaylight.genius.mdsalutil.matches.MatchInPort in project genius by opendaylight.
the class FlowBasedServicesUtils method getMatchInfoForVlanPortAtIngressTable.
public static List<MatchInfo> getMatchInfoForVlanPortAtIngressTable(BigInteger dpId, long portNo, Interface iface) {
List<MatchInfo> matches = new ArrayList<>();
matches.add(new MatchInPort(dpId, portNo));
int vlanId = 0;
IfL2vlan l2vlan = iface.getAugmentation(IfL2vlan.class);
if (l2vlan != null) {
vlanId = l2vlan.getVlanId() == null ? 0 : l2vlan.getVlanId().getValue();
}
if (vlanId >= 0 && l2vlan.getL2vlanMode() != IfL2vlan.L2vlanMode.Transparent) {
matches.add(new MatchVlanVid(vlanId));
}
return matches;
}
use of org.opendaylight.genius.mdsalutil.matches.MatchInPort in project genius by opendaylight.
the class InterfaceManagerCommonUtils method addTunnelIngressFlow.
public void addTunnelIngressFlow(IfTunnel tunnel, BigInteger dpnId, long portNo, String interfaceName, int ifIndex) {
if (isTunnelWithoutIngressFlow(tunnel)) {
return;
}
LOG.debug("add tunnel ingress flow for {}", interfaceName);
List<MatchInfoBase> matches = new ArrayList<>();
matches.add(new MatchInPort(dpnId, portNo));
if (BooleanUtils.isTrue(tunnel.isTunnelRemoteIpFlow())) {
matches.add(new NxMatchTunnelSourceIp(tunnel.getTunnelDestination().getIpv4Address()));
}
if (BooleanUtils.isTrue(tunnel.isTunnelSourceIpFlow())) {
matches.add(new NxMatchTunnelDestinationIp(tunnel.getTunnelSource().getIpv4Address()));
}
List<InstructionInfo> mkInstructions = new ArrayList<>();
mkInstructions.add(new InstructionWriteMetadata(MetaDataUtil.getLportTagMetaData(ifIndex).or(BigInteger.ONE), MetaDataUtil.METADATA_MASK_LPORT_TAG_SH_FLAG));
short tableId = tunnel.getTunnelInterfaceType().isAssignableFrom(TunnelTypeMplsOverGre.class) ? NwConstants.L3_LFIB_TABLE : tunnel.isInternal() ? NwConstants.INTERNAL_TUNNEL_TABLE : NwConstants.DHCP_TABLE_EXTERNAL_TUNNEL;
mkInstructions.add(new InstructionGotoTable(tableId));
mdsalApiManager.batchedAddFlow(dpnId, buildTunnelIngressFlowEntity(dpnId, interfaceName, matches, mkInstructions));
}
use of org.opendaylight.genius.mdsalutil.matches.MatchInPort in project genius by opendaylight.
the class InterfaceServiceUtil method getMatchInfoForVlanLPort.
public static List<MatchInfo> getMatchInfoForVlanLPort(BigInteger dpId, long portNo, long vlanId, boolean isVlanTransparent) {
List<MatchInfo> matches = new ArrayList<>();
matches.add(new MatchInPort(dpId, portNo));
if (vlanId != 0 && !isVlanTransparent) {
matches.add(new MatchVlanVid((int) vlanId));
}
return matches;
}
Aggregations