use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.conntrack.grouping.NxActionConntrack in project openflowplugin by opendaylight.
the class ConntrackConvertor method getCtAction.
private List<CtActions> getCtAction(final NxActionConntrack action) {
if (action.getCtActions() == null) {
return null;
}
List<CtActions> ctActions = new ArrayList<>();
for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.conntrack.grouping.nx.action.conntrack.CtActions ctAction : action.getCtActions()) {
org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.OfpactActions ofpactAction = ctAction.getOfpactActions();
if (ofpactAction instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.NxActionNatCase) {
org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.nx.action.nat._case.NxActionNat nxActionNat = ((org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.NxActionNatCase) ofpactAction).getNxActionNat();
NxActionNatBuilder nxActionNatBuilder = new NxActionNatBuilder();
nxActionNatBuilder.setFlags(nxActionNat.getFlags());
nxActionNatBuilder.setRangePresent(nxActionNat.getRangePresent());
nxActionNatBuilder.setIpAddressMin(nxActionNat.getIpAddressMin());
nxActionNatBuilder.setIpAddressMax(nxActionNat.getIpAddressMax());
nxActionNatBuilder.setPortMin(nxActionNat.getPortMin());
nxActionNatBuilder.setPortMax(nxActionNat.getPortMax());
NxActionNatCaseBuilder caseBuilder = new NxActionNatCaseBuilder();
caseBuilder.setNxActionNat(nxActionNatBuilder.build());
CtActionsBuilder ctActionsBuilder = new CtActionsBuilder();
ctActionsBuilder.setOfpactActions(caseBuilder.build());
ctActions.add(ctActionsBuilder.build());
} else if (ofpactAction instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.NxActionCtMarkCase) {
org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.nx.action.ct.mark._case.NxActionCtMark nxActionCtMark = ((org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.NxActionCtMarkCase) ofpactAction).getNxActionCtMark();
NxActionCtMarkBuilder nxActionCtMarkBuilder = new NxActionCtMarkBuilder();
nxActionCtMarkBuilder.setCtMark(nxActionCtMark.getCtMark());
// TODO: ct_mark mask is not supported yet
NxActionCtMarkCaseBuilder caseBuilder = new NxActionCtMarkCaseBuilder();
caseBuilder.setNxActionCtMark(nxActionCtMarkBuilder.build());
CtActionsBuilder ctActionsBuilder = new CtActionsBuilder();
ctActionsBuilder.setOfpactActions(caseBuilder.build());
ctActions.add(ctActionsBuilder.build());
}
}
return ctActions;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.conntrack.grouping.NxActionConntrack in project openflowplugin by opendaylight.
the class ConntrackConvertor method convert.
@Override
public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(final Action input, final ActionPath path) {
NxActionConntrack action = ((ActionConntrack) input.getActionChoice()).getNxActionConntrack();
NxConntrackBuilder builder = new NxConntrackBuilder();
builder.setFlags(action.getFlags());
builder.setZoneSrc(action.getZoneSrc());
builder.setRecircTable(action.getRecircTable());
builder.setConntrackZone(action.getConntrackZone());
builder.setCtActions(getCtAction(action));
return resolveAction(builder.build(), path);
}
Aggregations