use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.ace.matches.ace.type.AceIp in project netvirt by opendaylight.
the class AclServiceUtils method getHardTimoutForApplyStatefulChangeOnExistingTraffic.
/**
* Returns the hard timeout based on the protocol when a ACL rule removed from the instance.
* It will returns the timeout configured in the {@link AclserviceConfig} class.
*
* @param ace the ace
* @param aclServiceUtils acl service utils
* @return the hard time out
*/
public static Integer getHardTimoutForApplyStatefulChangeOnExistingTraffic(Ace ace, AclServiceUtils aclServiceUtils) {
int hardTimeout = AclConstants.SECURITY_GROUP_ICMP_IDLE_TIME_OUT;
Matches matches = ace.getMatches();
AceIp acl = (AceIp) matches.getAceType();
Short protocol = acl.getProtocol();
if (protocol == null) {
return hardTimeout;
} else if (protocol == NwConstants.IP_PROT_TCP) {
hardTimeout = aclServiceUtils.getConfig().getSecurityGroupTcpIdleTimeout();
} else if (protocol == NwConstants.IP_PROT_UDP) {
hardTimeout = aclServiceUtils.getConfig().getSecurityGroupUdpIdleTimeout();
}
return hardTimeout;
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.ace.matches.ace.type.AceIp in project netvirt by opendaylight.
the class AbstractAclServiceImpl method programAclForExistingTrafficTable.
private void programAclForExistingTrafficTable(AclInterface port, Ace ace, int addOrRemove, String flowName, List<MatchInfoBase> matches, Integer priority) {
AceIp acl = (AceIp) ace.getMatches().getAceType();
final String newFlowName = flowName + this.directionString + "_" + port.getDpId() + "_" + port.getLPortTag() + "_" + ((acl.getAceIpVersion() instanceof AceIpv4) ? "_IPv4" : "_IPv6") + "_FlowAfterRuleDeleted";
final List<MatchInfoBase> newMatches = matches.stream().filter(obj -> !(obj instanceof NxMatchCtState || obj instanceof MatchMetadata)).collect(Collectors.toList());
newMatches.add(AclServiceUtils.buildLPortTagMatch(port.getLPortTag(), serviceMode));
newMatches.add(new NxMatchCtState(AclConstants.TRACKED_RPL_CT_STATE, AclConstants.TRACKED_RPL_CT_STATE_MASK));
List<InstructionInfo> instructions = AclServiceUtils.createCtMarkInstructionForNewState(getAclFilterCumDispatcherTable(), port.getElanId());
// Reversing the flow add/delete operation for this table.
int operation = (addOrRemove == NwConstants.ADD_FLOW) ? NwConstants.DEL_FLOW : NwConstants.ADD_FLOW;
syncFlow(port.getDpId(), getAclForExistingTrafficTable(), newFlowName, priority, "ACL", 0, AclServiceUtils.getHardTimoutForApplyStatefulChangeOnExistingTraffic(ace, aclServiceUtils), AclConstants.COOKIE_ACL_BASE, newMatches, instructions, operation);
}
Aggregations