public static Set<OFInstructionType> ofWireValue(short val) { EnumSet<OFInstructionType> set = EnumSet.noneOf(OFInstructionType.class); if((val & GOTO_TABLE_VAL) != 0) set.add(OFInstructionType.GOTO_TABLE); if((val & WRITE_METADATA_VAL) != 0) set.add(OFInstructionType.WRITE_METADATA); if((val & WRITE_ACTIONS_VAL) != 0) set.add(OFInstructionType.WRITE_ACTIONS); if((val & APPLY_ACTIONS_VAL) != 0) set.add(OFInstructionType.APPLY_ACTIONS); if((val & CLEAR_ACTIONS_VAL) != 0) set.add(OFInstructionType.CLEAR_ACTIONS); if((val & EXPERIMENTER_VAL) != 0) set.add(OFInstructionType.EXPERIMENTER); return Collections.unmodifiableSet(set); }
public static Set<OFInstructionType> ofWireValue(short val) { EnumSet<OFInstructionType> set = EnumSet.noneOf(OFInstructionType.class); if((val & GOTO_TABLE_VAL) != 0) set.add(OFInstructionType.GOTO_TABLE); if((val & WRITE_METADATA_VAL) != 0) set.add(OFInstructionType.WRITE_METADATA); if((val & WRITE_ACTIONS_VAL) != 0) set.add(OFInstructionType.WRITE_ACTIONS); if((val & APPLY_ACTIONS_VAL) != 0) set.add(OFInstructionType.APPLY_ACTIONS); if((val & CLEAR_ACTIONS_VAL) != 0) set.add(OFInstructionType.CLEAR_ACTIONS); if((val & EXPERIMENTER_VAL) != 0) set.add(OFInstructionType.EXPERIMENTER); if((val & METER_VAL) != 0) set.add(OFInstructionType.METER); return Collections.unmodifiableSet(set); }
public static Set<OFInstructionType> ofWireValue(short val) { EnumSet<OFInstructionType> set = EnumSet.noneOf(OFInstructionType.class); if((val & GOTO_TABLE_VAL) != 0) set.add(OFInstructionType.GOTO_TABLE); if((val & WRITE_METADATA_VAL) != 0) set.add(OFInstructionType.WRITE_METADATA); if((val & WRITE_ACTIONS_VAL) != 0) set.add(OFInstructionType.WRITE_ACTIONS); if((val & APPLY_ACTIONS_VAL) != 0) set.add(OFInstructionType.APPLY_ACTIONS); if((val & CLEAR_ACTIONS_VAL) != 0) set.add(OFInstructionType.CLEAR_ACTIONS); if((val & EXPERIMENTER_VAL) != 0) set.add(OFInstructionType.EXPERIMENTER); if((val & DEPRECATED_VAL) != 0) set.add(OFInstructionType.DEPRECATED); if((val & STAT_TRIGGER_VAL) != 0) set.add(OFInstructionType.STAT_TRIGGER); return Collections.unmodifiableSet(set); }
public static Set<OFInstructionType> readFrom(ChannelBuffer bb) throws OFParseError { try { return ofWireValue(bb.readShort()); } catch (IllegalArgumentException e) { throw new OFParseError(e); } }
public static short toWireValue(Set<OFInstructionType> set) { short wireValue = 0; for(OFInstructionType e: set) { switch(e) { case GOTO_TABLE: wireValue |= GOTO_TABLE_VAL; break; case WRITE_METADATA: wireValue |= WRITE_METADATA_VAL; break; case WRITE_ACTIONS: wireValue |= WRITE_ACTIONS_VAL; break; case APPLY_ACTIONS: wireValue |= APPLY_ACTIONS_VAL; break; case CLEAR_ACTIONS: wireValue |= CLEAR_ACTIONS_VAL; break; case EXPERIMENTER: wireValue |= EXPERIMENTER_VAL; break; default: throw new IllegalArgumentException("Illegal enum value for type OFInstructionType in version 1.2: " + e); } } return wireValue; }
public static short toWireValue(Set<OFInstructionType> set) { short wireValue = 0; for(OFInstructionType e: set) { switch(e) { case GOTO_TABLE: wireValue |= GOTO_TABLE_VAL; break; case WRITE_METADATA: wireValue |= WRITE_METADATA_VAL; break; case WRITE_ACTIONS: wireValue |= WRITE_ACTIONS_VAL; break; case APPLY_ACTIONS: wireValue |= APPLY_ACTIONS_VAL; break; case CLEAR_ACTIONS: wireValue |= CLEAR_ACTIONS_VAL; break; case EXPERIMENTER: wireValue |= EXPERIMENTER_VAL; break; case METER: wireValue |= METER_VAL; break; default: throw new IllegalArgumentException("Illegal enum value for type OFInstructionType in version 1.3: " + e); } } return wireValue; }
public static short toWireValue(Set<OFInstructionType> set) { short wireValue = 0; for(OFInstructionType e: set) { switch(e) { case GOTO_TABLE: wireValue |= GOTO_TABLE_VAL; break; case WRITE_METADATA: wireValue |= WRITE_METADATA_VAL; break; case WRITE_ACTIONS: wireValue |= WRITE_ACTIONS_VAL; break; case APPLY_ACTIONS: wireValue |= APPLY_ACTIONS_VAL; break; case CLEAR_ACTIONS: wireValue |= CLEAR_ACTIONS_VAL; break; case EXPERIMENTER: wireValue |= EXPERIMENTER_VAL; break; default: throw new IllegalArgumentException("Illegal enum value for type OFInstructionType in version 1.1: " + e); } } return wireValue; }
public static short toWireValue(Set<OFInstructionType> set) { short wireValue = 0; for(OFInstructionType e: set) { switch(e) { case GOTO_TABLE: wireValue |= GOTO_TABLE_VAL; break; case WRITE_METADATA: wireValue |= WRITE_METADATA_VAL; break; case WRITE_ACTIONS: wireValue |= WRITE_ACTIONS_VAL; break; case APPLY_ACTIONS: wireValue |= APPLY_ACTIONS_VAL; break; case CLEAR_ACTIONS: wireValue |= CLEAR_ACTIONS_VAL; break; case EXPERIMENTER: wireValue |= EXPERIMENTER_VAL; break; case METER: wireValue |= METER_VAL; break; default: throw new IllegalArgumentException("Illegal enum value for type OFInstructionType in version 1.4: " + e); } } return wireValue; }
public static List<OFAction> getActions(OFFlowStatsEntry e) { if(e.getVersion() == OFVersion.OF_10) { return e.getActions(); } else { for(OFInstruction i: e.getInstructions()) { if(i.getType() == OFInstructionType.APPLY_ACTIONS) { return ((OFInstructionApplyActions) i).getActions(); } } return ImmutableList.of(); } }
public static List<OFAction> getActions(OFFlowMod e) { if(e.getVersion() == OFVersion.OF_10) { return e.getActions(); } else { for(OFInstruction i: e.getInstructions()) { if(i.getType() == OFInstructionType.APPLY_ACTIONS) { return ((OFInstructionApplyActions) i).getActions(); } } return ImmutableList.of(); } }
public static Set<OFInstructionType> readFrom(ByteBuf bb) throws OFParseError { try { return ofWireValue(bb.readShort()); } catch (IllegalArgumentException e) { throw new OFParseError(e); } }
public static short toWireValue(Set<OFInstructionType> set) { short wireValue = 0; for(OFInstructionType e: set) { switch(e) { case GOTO_TABLE: wireValue |= GOTO_TABLE_VAL; break; case WRITE_METADATA: wireValue |= WRITE_METADATA_VAL; break; case WRITE_ACTIONS: wireValue |= WRITE_ACTIONS_VAL; break; case APPLY_ACTIONS: wireValue |= APPLY_ACTIONS_VAL; break; case CLEAR_ACTIONS: wireValue |= CLEAR_ACTIONS_VAL; break; case EXPERIMENTER: wireValue |= EXPERIMENTER_VAL; break; case DEPRECATED: wireValue |= DEPRECATED_VAL; break; case STAT_TRIGGER: wireValue |= STAT_TRIGGER_VAL; break; default: throw new IllegalArgumentException("Illegal enum value for type OFInstructionType in version 1.5: " + e); } } return wireValue; }
public static void writeTo(ChannelBuffer bb, Set<OFInstructionType> set) { bb.writeShort(toWireValue(set)); }
public static void putTo(Set<OFInstructionType> set, PrimitiveSink sink) { sink.putShort(toWireValue(set)); }
public static void writeTo(ByteBuf bb, Set<OFInstructionType> set) { bb.writeShort(toWireValue(set)); }