/** * Convert the string representation of an OFInstructionClearActions to * an OFInstructionClearActions. The instruction will be set within the * OFFlowMod.Builder provided. Notice nothing is returned, but the * side effect is the addition of an instruction in the OFFlowMod.Builder. * @param fmb; The FMB in which to append the new instruction * @param instStr; The string to parse the instruction from * @param log */ public static void clearActionsFromString(OFFlowMod.Builder fmb, String inst, Logger log) { if (fmb.getVersion().compareTo(OFVersion.OF_11) < 0) { log.error("Clear Actions Instruction not supported in OpenFlow 1.0"); return; } if (inst != null && inst.trim().isEmpty()) { /* Allow the empty string, since this is what specifies clear (i.e. key clear does not have any defined values). */ OFInstructionClearActions i = OFFactories.getFactory(fmb.getVersion()).instructions().clearActions(); log.debug("Appending ClearActions instruction: {}", i); appendInstruction(fmb, i); log.debug("All instructions after append: {}", fmb.getInstructions()); } else { log.error("Got non-empty or null string, but ClearActions should not have any String sub-fields: {}", inst); } }
/** * Convert the string representation of an OFInstructionClearActions to * an OFInstructionClearActions. The instruction will be set within the * OFFlowMod.Builder provided. Notice nothing is returned, but the * side effect is the addition of an instruction in the OFFlowMod.Builder. * @param fmb; The FMB in which to append the new instruction * @param instStr; The string to parse the instruction from * @param log */ public static void clearActionsFromString(OFFlowMod.Builder fmb, String inst, Logger log) { if (fmb.getVersion().compareTo(OFVersion.OF_11) < 0) { log.error("Clear Actions Instruction not supported in OpenFlow 1.0"); return; } if (inst != null && inst.isEmpty()) { OFInstructionClearActions i = OFFactories.getFactory(fmb.getVersion()).instructions().clearActions(); log.debug("Appending ClearActions instruction: {}", i); appendInstruction(fmb, i); log.debug("All instructions after append: {}", fmb.getInstructions()); } else { log.error("Got non-empty or null string, but ClearActions should not have any String sub-fields: {}", inst); } }
/** * Convert an OFInstructionClearActions to string form. The string will be formatted * in a dpctl/ofctl-style syntax. * @param inst; The instruction to convert to a string * @param log * @return */ public static String clearActionsToString(OFInstructionClearActions inst, Logger log) { return ""; // No data for this instruction. The presence of it's key indicates it is to be applied. }