use of org.opendaylight.yangtools.yang.common.Uint64 in project netvirt by opendaylight.
the class IngressAclServiceImpl method programCommitterDropFlow.
private void programCommitterDropFlow(List<FlowEntity> flowEntries, Uint64 dpId, int lportTag, int addOrRemove) {
List<MatchInfoBase> matches = new ArrayList<>();
List<InstructionInfo> instructions = AclServiceOFFlowBuilder.getDropInstructionInfo();
Uint64 metaData = Uint64.fromLongBits(MetaDataUtil.METADATA_MASK_ACL_DROP.longValue() & (AclConstants.METADATA_DROP_FLAG.longValue() << 2));
Uint64 metaDataMask = Uint64.fromLongBits(MetaDataUtil.METADATA_MASK_ACL_DROP.longValue() & (AclConstants.METADATA_DROP_FLAG.longValue() << 2));
matches.add(new NxMatchRegister(NxmNxReg6.class, MetaDataUtil.getLportTagForReg6(lportTag).longValue(), MetaDataUtil.getLportTagMaskForReg6()));
matches.add(new MatchMetadata(metaData, metaDataMask));
String flowName = "Ingress_" + dpId + "_" + lportTag + "_Drop";
addFlowEntryToList(flowEntries, dpId, getAclCommitterTable(), flowName, AclConstants.CT_STATE_TRACKED_INVALID_PRIORITY, 0, 0, AclServiceUtils.getDropFlowCookie(lportTag), matches, instructions, addOrRemove);
}
use of org.opendaylight.yangtools.yang.common.Uint64 in project netvirt by opendaylight.
the class IngressAclServiceImpl method programAntiSpoofingRules.
@Override
protected void programAntiSpoofingRules(List<FlowEntity> flowEntries, AclInterface port, List<AllowedAddressPairs> allowedAddresses, Action action, int addOrRemove) {
LOG.info("{} programAntiSpoofingRules for port {}, AAPs={}, action={}, addOrRemove={}", this.directionString, port.getInterfaceId(), allowedAddresses, action, addOrRemove);
Uint64 dpid = Uint64.valueOf(port.getDpId());
int lportTag = port.getLPortTag();
if (action == Action.ADD || action == Action.REMOVE) {
programCommitterDropFlow(flowEntries, dpid, lportTag, addOrRemove);
ingressAclDhcpAllowServerTraffic(flowEntries, dpid, lportTag, addOrRemove);
ingressAclDhcpv6AllowServerTraffic(flowEntries, dpid, lportTag, addOrRemove);
ingressAclIcmpv6AllowedTraffic(flowEntries, port, InterfaceType.AccessPort, addOrRemove);
programIcmpv6RARule(flowEntries, port, port.getSubnetInfo(), addOrRemove);
programArpRule(flowEntries, dpid, lportTag, addOrRemove);
programIpv4BroadcastRule(flowEntries, port, port.getSubnetInfo(), addOrRemove);
}
}
use of org.opendaylight.yangtools.yang.common.Uint64 in project netvirt by opendaylight.
the class IngressAclServiceImpl method programIcmpv6RARule.
@Override
protected void programIcmpv6RARule(List<FlowEntity> flowEntries, AclInterface port, List<SubnetInfo> subnets, int addOrRemove) {
if (!AclServiceUtils.isIpv6Subnet(subnets)) {
return;
}
Uint64 dpid = Uint64.valueOf(port.getDpId());
/* Allow ICMPv6 Router Advertisement packets from external routers as well as internal routers
* if subnet is configured with IPv6 version
* Allow ICMPv6 Router Advertisement packets if originating from any LinkLocal Address.
*/
List<InstructionInfo> instructions = getDispatcherTableResubmitInstructions();
List<MatchInfoBase> matches = AclServiceUtils.buildIcmpV6Matches(AclConstants.ICMPV6_TYPE_RA, 0, port.getLPortTag(), serviceMode);
matches.addAll(AclServiceUtils.buildIpMatches(new IpPrefixOrAddress(IpPrefixBuilder.getDefaultInstance(AclConstants.IPV6_LINK_LOCAL_PREFIX)), AclServiceManager.MatchCriteria.MATCH_SOURCE));
String flowName = "Ingress_ICMPv6" + "_" + dpid + "_" + port.getLPortTag() + "_" + AclConstants.ICMPV6_TYPE_RA + "_LinkLocal_Permit_";
addFlowEntryToList(flowEntries, dpid, getAclAntiSpoofingTable(), flowName, AclConstants.PROTO_IPV6_ALLOWED_PRIORITY, 0, 0, AclConstants.COOKIE_ACL_BASE, matches, instructions, addOrRemove);
}
use of org.opendaylight.yangtools.yang.common.Uint64 in project netvirt by opendaylight.
the class AclNodeDefaultFlowsTxBuilder method addFlowToTx.
private void addFlowToTx(short tableId, String flowId, int priority, List<? extends MatchInfoBase> matches, List<InstructionInfo> instructions) {
int idleTimeOut = 0;
int hardTimeOut = 0;
Uint64 cookie = AclConstants.COOKIE_ACL_BASE;
FlowEntity flowEntity = MDSALUtil.buildFlowEntity(Uint64.valueOf(this.dpId.toString()), tableId, flowId, priority, flowId, idleTimeOut, hardTimeOut, cookie, matches, instructions);
LOG.trace("Installing Acl default Flow:: DpnId: {}, flowId: {}, flowName: {}, tableId: {}", dpId.toString(), flowId, flowId, tableId);
mdsalManager.addFlow(tx, flowEntity);
}
use of org.opendaylight.yangtools.yang.common.Uint64 in project netvirt by opendaylight.
the class ElanUtils method deleteMacFlows.
public void deleteMacFlows(ElanInstance elanInfo, InterfaceInfo interfaceInfo, String macAddress, boolean deleteSmac, TypedReadWriteTransaction<Configuration> flowTx) throws ExecutionException, InterruptedException {
String elanInstanceName = elanInfo.getElanInstanceName();
List<DpnInterfaces> remoteFEs = getInvolvedDpnsInElan(elanInstanceName);
Uint64 srcdpId = interfaceInfo.getDpId();
boolean isFlowsRemovedInSrcDpn = false;
for (DpnInterfaces dpnInterface : remoteFEs) {
Uint32 elanTag = elanInfo.getElanTag();
Uint64 dstDpId = dpnInterface.getDpId();
if (executeDeleteMacFlows(elanInfo, interfaceInfo, macAddress, deleteSmac, elanInstanceName, srcdpId, elanTag, dstDpId, flowTx)) {
isFlowsRemovedInSrcDpn = true;
}
executeEtreeDeleteMacFlows(elanInfo, interfaceInfo, macAddress, deleteSmac, elanInstanceName, srcdpId, elanTag, dstDpId, flowTx);
}
if (!isFlowsRemovedInSrcDpn) {
deleteSmacAndDmacFlows(elanInfo, interfaceInfo, macAddress, deleteSmac, flowTx);
}
}
Aggregations