use of org.opendaylight.genius.mdsalutil.actions.ActionNxConntrack in project netvirt by opendaylight.
the class VxlanGreConntrackBasedSnatService method installTerminatingServiceTblEntryForVxlanGre.
protected void installTerminatingServiceTblEntryForVxlanGre(BigInteger dpnId, String routerName, Long routerId, int elanId, int addOrRemove) {
LOG.info("installTerminatingServiceTblEntryForVxlanGre : creating entry for" + "Terminating Service Table for switch {}, routerId {}", dpnId, routerId);
List<MatchInfo> matches = new ArrayList<>();
matches.add(MatchEthernetType.IPV4);
BigInteger tunnelId = BigInteger.valueOf(routerId);
if (elanManager.isOpenStackVniSemanticsEnforced()) {
tunnelId = NatOverVxlanUtil.getRouterVni(idManager, routerName, routerId);
}
matches.add(new MatchTunnelId(tunnelId));
List<ActionInfo> actionsInfos = new ArrayList<>();
List<NxCtAction> ctActionsList = new ArrayList<>();
NxCtAction nxCtAction = new ActionNxConntrack.NxNat(0, 0, 0, null, null, 0, 0);
ctActionsList.add(nxCtAction);
ActionNxConntrack actionNxConntrack = new ActionNxConntrack(0, 0, elanId, NwConstants.OUTBOUND_NAPT_TABLE, ctActionsList);
ActionSetFieldMeta actionSetFieldMeta = new ActionSetFieldMeta(MetaDataUtil.getVpnIdMetadata(routerId.longValue()));
actionsInfos.add(actionSetFieldMeta);
actionsInfos.add(actionNxConntrack);
List<InstructionInfo> instructions = new ArrayList<>();
instructions.add(new InstructionApplyActions(actionsInfos));
String flowRef = getFlowRef(dpnId, NwConstants.INTERNAL_TUNNEL_TABLE, routerId.longValue());
syncFlow(dpnId, NwConstants.INTERNAL_TUNNEL_TABLE, flowRef, NatConstants.DEFAULT_TS_FLOW_PRIORITY, flowRef, NwConstants.COOKIE_SNAT_TABLE, matches, instructions, addOrRemove);
}
use of org.opendaylight.genius.mdsalutil.actions.ActionNxConntrack in project netvirt by opendaylight.
the class AbstractAclServiceImpl method programConntrackRecircRule.
protected void programConntrackRecircRule(BigInteger dpId, int lportTag, String portId, MatchEthernetType matchEtherType, int addOrRemove) {
List<MatchInfoBase> matches = new ArrayList<>();
matches.add(matchEtherType);
matches.add(AclServiceUtils.buildLPortTagMatch(lportTag, serviceMode));
List<InstructionInfo> instructions = new ArrayList<>();
if (addOrRemove == NwConstants.ADD_FLOW) {
Long elanTag = getElanIdFromAclInterface(portId);
if (elanTag == null) {
LOG.error("ElanId not found for portId={}; Context: dpId={}, lportTag={}, addOrRemove={},", portId, dpId, lportTag, addOrRemove);
return;
}
List<ActionInfo> actionsInfos = new ArrayList<>();
actionsInfos.add(new ActionNxConntrack(2, 0, 0, elanTag.intValue(), getAclForExistingTrafficTable()));
instructions.add(new InstructionApplyActions(actionsInfos));
}
String flowName = this.directionString + "_Fixed_Conntrk_" + dpId + "_" + lportTag + "_" + matchEtherType + "_Recirc";
syncFlow(dpId, getAclConntrackSenderTable(), flowName, AclConstants.ACL_DEFAULT_PRIORITY, "ACL", 0, 0, AclConstants.COOKIE_ACL_BASE, matches, instructions, addOrRemove);
}
Aggregations