use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.ofpact.actions.OfpactActions in project openflowplugin by opendaylight.
the class ConntrackConvertor method getCtAction.
private List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.conntrack.grouping.nx.action.conntrack.CtActions> getCtAction(final NxConntrack action) {
if (action.getCtActions() == null) {
return null;
}
List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.conntrack.grouping.nx.action.conntrack.CtActions> ctActions = new ArrayList<>();
for (CtActions ctAction : action.getCtActions()) {
OfpactActions ofpactAction = ctAction.getOfpactActions();
if (ofpactAction instanceof NxActionNatCase) {
NxActionNat nxActionNat = ((NxActionNatCase) ofpactAction).getNxActionNat();
org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.nx.action.nat._case.NxActionNatBuilder nxActionNatBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.nx.action.nat._case.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());
org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.NxActionNatCaseBuilder caseBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.NxActionNatCaseBuilder();
caseBuilder.setNxActionNat(nxActionNatBuilder.build());
org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.conntrack.grouping.nx.action.conntrack.CtActionsBuilder ctActionsBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.conntrack.grouping.nx.action.conntrack.CtActionsBuilder();
ctActionsBuilder.setOfpactActions(caseBuilder.build());
ctActions.add(ctActionsBuilder.build());
} else if (ofpactAction instanceof NxActionCtMarkCase) {
NxActionCtMark nxActionCtMark = ((NxActionCtMarkCase) ofpactAction).getNxActionCtMark();
org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.nx.action.ct.mark._case.NxActionCtMarkBuilder nxActionCtMarkBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.nx.action.ct.mark._case.NxActionCtMarkBuilder();
nxActionCtMarkBuilder.setCtMark(nxActionCtMark.getCtMark());
// TODO: ct_mark mask is not supported yet
org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.NxActionCtMarkCaseBuilder caseBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.NxActionCtMarkCaseBuilder();
caseBuilder.setNxActionCtMark(nxActionCtMarkBuilder.build());
org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.conntrack.grouping.nx.action.conntrack.CtActionsBuilder ctActionsBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.conntrack.grouping.nx.action.conntrack.CtActionsBuilder();
ctActionsBuilder.setOfpactActions(caseBuilder.build());
ctActions.add(ctActionsBuilder.build());
}
}
return ctActions;
}
Aggregations