Search in sources :

Example 1 with MatchArpTpa

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

the class ArpResponderUtil method getMatchCriteria.

/**
 * Get Match Criteria for the ARP Responder Flow.
 *
 * <p>
 * List of Match Criteria for ARP Responder
 * </p>
 * <ul>
 * <li>Packet is ARP</li>
 * <li>Packet is ARP Request</li>
 * <li>The ARP packet is requesting for Gateway IP</li>
 * <li>Metadata which is generated by using Service
 * Index({@link NwConstants#L3VPN_SERVICE_INDEX}) Lport Tag
 * ({@link MetaDataUtil#METADATA_MASK_LPORT_TAG}) and VRF
 * ID({@link MetaDataUtil#METADATA_MASK_VRFID})</li>
 * </ul>
 *
 * @param lportTag
 *            LPort Tag
 * @param elanInstance
 *            Elan Instance
 * @param ipAddress
 *            Ip Address to be matched to this flow
 * @return List of Match criteria
 */
public static List<MatchInfo> getMatchCriteria(int lportTag, ElanInstance elanInstance, String ipAddress) {
    BigInteger metadata = ElanHelper.getElanMetadataLabel(elanInstance.getElanTag(), lportTag);
    BigInteger metadataMask = ElanHelper.getElanMetadataMask();
    return Arrays.asList(MatchEthernetType.ARP, MatchArpOp.REQUEST, new MatchArpTpa(ipAddress, "32"), new MatchMetadata(metadata, metadataMask));
}
Also used : MatchMetadata(org.opendaylight.genius.mdsalutil.matches.MatchMetadata) BigInteger(java.math.BigInteger) MatchArpTpa(org.opendaylight.genius.mdsalutil.matches.MatchArpTpa)

Aggregations

BigInteger (java.math.BigInteger)1 MatchArpTpa (org.opendaylight.genius.mdsalutil.matches.MatchArpTpa)1 MatchMetadata (org.opendaylight.genius.mdsalutil.matches.MatchMetadata)1