Search in sources :

Example 1 with MatchVlanVid

use of org.opendaylight.genius.mdsalutil.matches.MatchVlanVid 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;
}
Also used : MatchInfo(org.opendaylight.genius.mdsalutil.MatchInfo) MatchVlanVid(org.opendaylight.genius.mdsalutil.matches.MatchVlanVid) ArrayList(java.util.ArrayList) MatchInPort(org.opendaylight.genius.mdsalutil.matches.MatchInPort) IfL2vlan(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfL2vlan)

Example 2 with MatchVlanVid

use of org.opendaylight.genius.mdsalutil.matches.MatchVlanVid 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;
}
Also used : MatchInfo(org.opendaylight.genius.mdsalutil.MatchInfo) MatchVlanVid(org.opendaylight.genius.mdsalutil.matches.MatchVlanVid) ArrayList(java.util.ArrayList) MatchInPort(org.opendaylight.genius.mdsalutil.matches.MatchInPort)

Aggregations

ArrayList (java.util.ArrayList)2 MatchInfo (org.opendaylight.genius.mdsalutil.MatchInfo)2 MatchInPort (org.opendaylight.genius.mdsalutil.matches.MatchInPort)2 MatchVlanVid (org.opendaylight.genius.mdsalutil.matches.MatchVlanVid)2 IfL2vlan (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfL2vlan)1