use of org.opendaylight.genius.mdsalutil.actions.ActionNdOptionType in project netvirt by opendaylight.
the class Ipv6ServiceUtils method instIcmpv6NsMatchFlow.
public void instIcmpv6NsMatchFlow(short tableId, Uint64 dpId, Long elanTag, int lportTag, String vmMacAddress, Ipv6Address ndTargetAddr, int addOrRemove, TypedReadWriteTransaction tx, Boolean isSllOptionSet) throws ExecutionException, InterruptedException {
List<ActionInfo> actionsInfos = new ArrayList<>();
actionsInfos.add(getLearnActionForNsDrop(ipV6NAConfigHelper.getNsSlowProtectionTimeOutinMs()));
actionsInfos.add(new ActionSetIcmpv6Type(Icmpv6Type.NEIGHBOR_ADVERTISEMENT.getValue()));
short priority = Ipv6ServiceConstants.DEFAULT_FLOW_PRIORITY;
if (isSllOptionSet) {
actionsInfos.add(new ActionNdOptionType((short) 2));
priority = Ipv6ServiceConstants.SLLOPTION_SET_FLOW_PRIORITY;
}
List<InstructionInfo> instructions = new ArrayList<>();
instructions.add(new InstructionApplyActions(actionsInfos));
instructions.add(new InstructionGotoTable(NwConstants.ARP_RESPONDER_TABLE));
List<MatchInfo> neighborSolicitationMatch = getIcmpv6NsMatchFlow(elanTag, lportTag, vmMacAddress, ndTargetAddr, isSllOptionSet);
FlowEntity rsFlowEntity = MDSALUtil.buildFlowEntity(dpId, tableId, Boolean.TRUE.equals(isSllOptionSet) ? getIPv6OvsFlowRef(tableId, dpId, lportTag, ndTargetAddr.getValue(), vmMacAddress) : getIPv6OvsFlowRef(tableId, dpId, lportTag, ndTargetAddr.getValue()), priority, "IPv6NS", 0, 0, NwConstants.COOKIE_IPV6_TABLE, neighborSolicitationMatch, instructions);
if (addOrRemove == Ipv6ServiceConstants.DEL_FLOW) {
LOG.debug("installIcmpv6NsResponderFlow: Removing IPv6 Neighbor Solicitation Flow on " + "DpId {} for NDTraget {}, elanTag {}, lportTag {}", dpId, ndTargetAddr.getValue(), elanTag, lportTag);
mdsalUtil.removeFlow(tx, rsFlowEntity);
} else {
LOG.debug("installIcmpv6NsResponderFlow: Installing IPv6 Neighbor Solicitation Flow on " + "DpId {} for NDTraget {} elanTag {}, lportTag {}", dpId, ndTargetAddr.getValue(), elanTag, lportTag);
mdsalUtil.addFlow(tx, rsFlowEntity);
}
}
Aggregations