/** * @param dpid * @param buffers * @param tables * @param capabilities * @param actions * @param ports * @param manufacturerDescription * @param hardwareDescription * @param softwareDescription * @param serialNumber * @param datapathDescription */ @JsonCreator public SwitchSyncRepresentation( @JsonProperty("dpid") DatapathId dpid, @JsonProperty("buffers") int buffers, @JsonProperty("tables") byte tables, @JsonProperty("capabilities") Set<OFCapabilities> capabilities, @JsonProperty("actions") Set<OFActionType> actions, @JsonProperty("ports") List<SyncedPort> ports, @JsonProperty("manufacturerDescription") String manufacturerDescription, @JsonProperty("hardwareDescription") String hardwareDescription, @JsonProperty("softwareDescription") String softwareDescription, @JsonProperty("serialNumber") String serialNumber, @JsonProperty("datapathDescription") String datapathDescription) { this.dpid = dpid; this.buffers = buffers; this.tables = tables; this.capabilities = capabilities; this.actions = actions; this.ports = ports; this.manufacturerDescription = manufacturerDescription; this.hardwareDescription = hardwareDescription; this.softwareDescription = softwareDescription; this.serialNumber = serialNumber; this.datapathDescription = datapathDescription; }
public static Set<OFCapabilities> ofWireValue(int val) { EnumSet<OFCapabilities> set = EnumSet.noneOf(OFCapabilities.class); if((val & FLOW_STATS_VAL) != 0) set.add(OFCapabilities.FLOW_STATS); if((val & TABLE_STATS_VAL) != 0) set.add(OFCapabilities.TABLE_STATS); if((val & PORT_STATS_VAL) != 0) set.add(OFCapabilities.PORT_STATS); if((val & IP_REASM_VAL) != 0) set.add(OFCapabilities.IP_REASM); if((val & QUEUE_STATS_VAL) != 0) set.add(OFCapabilities.QUEUE_STATS); if((val & GROUP_STATS_VAL) != 0) set.add(OFCapabilities.GROUP_STATS); if((val & PORT_BLOCKED_VAL) != 0) set.add(OFCapabilities.PORT_BLOCKED); return Collections.unmodifiableSet(set); }
public static Set<OFCapabilities> ofWireValue(int val) { EnumSet<OFCapabilities> set = EnumSet.noneOf(OFCapabilities.class); if((val & FLOW_STATS_VAL) != 0) set.add(OFCapabilities.FLOW_STATS); if((val & TABLE_STATS_VAL) != 0) set.add(OFCapabilities.TABLE_STATS); if((val & PORT_STATS_VAL) != 0) set.add(OFCapabilities.PORT_STATS); if((val & STP_VAL) != 0) set.add(OFCapabilities.STP); if((val & RESERVED_VAL) != 0) set.add(OFCapabilities.RESERVED); if((val & IP_REASM_VAL) != 0) set.add(OFCapabilities.IP_REASM); if((val & QUEUE_STATS_VAL) != 0) set.add(OFCapabilities.QUEUE_STATS); if((val & ARP_MATCH_IP_VAL) != 0) set.add(OFCapabilities.ARP_MATCH_IP); return Collections.unmodifiableSet(set); }
public static Set<OFCapabilities> ofWireValue(int val) { EnumSet<OFCapabilities> set = EnumSet.noneOf(OFCapabilities.class); if((val & FLOW_STATS_VAL) != 0) set.add(OFCapabilities.FLOW_STATS); if((val & TABLE_STATS_VAL) != 0) set.add(OFCapabilities.TABLE_STATS); if((val & PORT_STATS_VAL) != 0) set.add(OFCapabilities.PORT_STATS); if((val & IP_REASM_VAL) != 0) set.add(OFCapabilities.IP_REASM); if((val & QUEUE_STATS_VAL) != 0) set.add(OFCapabilities.QUEUE_STATS); if((val & ARP_MATCH_IP_VAL) != 0) set.add(OFCapabilities.ARP_MATCH_IP); if((val & GROUP_STATS_VAL) != 0) set.add(OFCapabilities.GROUP_STATS); return Collections.unmodifiableSet(set); }
@Override public void setFeaturesReply(OFFeaturesReply featuresReply) { OFFeaturesReply.Builder builder = featuresReply.createBuilder(); // do not try to set PORTS or ACTIONS, // they are not supported for this openflow version builder.setAuxiliaryId(featuresReply.getAuxiliaryId()); builder.setDatapathId(featuresReply.getDatapathId()); builder.setNBuffers(featuresReply.getNBuffers()); builder.setReserved(featuresReply.getReserved()); builder.setXid(featuresReply.getXid()); Set<OFCapabilities> capabilities = new HashSet<>(featuresReply.getCapabilities()); capabilities.add(OFCapabilities.GROUP_STATS); builder.setCapabilities(capabilities); super.setFeaturesReply(builder.build()); }
public static Set<OFCapabilities> ofWireValue(int val) { EnumSet<OFCapabilities> set = EnumSet.noneOf(OFCapabilities.class); if((val & FLOW_STATS_VAL) != 0) set.add(OFCapabilities.FLOW_STATS); if((val & TABLE_STATS_VAL) != 0) set.add(OFCapabilities.TABLE_STATS); if((val & PORT_STATS_VAL) != 0) set.add(OFCapabilities.PORT_STATS); if((val & IP_REASM_VAL) != 0) set.add(OFCapabilities.IP_REASM); if((val & QUEUE_STATS_VAL) != 0) set.add(OFCapabilities.QUEUE_STATS); if((val & GROUP_STATS_VAL) != 0) set.add(OFCapabilities.GROUP_STATS); if((val & PORT_BLOCKED_VAL) != 0) set.add(OFCapabilities.PORT_BLOCKED); if((val & BUNDLES_VAL) != 0) set.add(OFCapabilities.BUNDLES); if((val & FLOW_MONITORING_VAL) != 0) set.add(OFCapabilities.FLOW_MONITORING); return Collections.unmodifiableSet(set); }
public void serializeCapabilities(Set<OFCapabilities> ofCapabilities, JsonGenerator jGen) throws IOException, JsonProcessingException { if (null == ofCapabilities) jGen.writeStringField("capabilities","null"); else{ jGen.writeFieldName("capabilities"); jGen.writeStartArray(); for(OFCapabilities ofCapability : ofCapabilities){ jGen.writeString(ofCapability.toString()); } jGen.writeEndArray(); } }
public void setUpFeaturesReply() { portDesc = factory.buildPortDesc() .setName("Eth1") .setPortNo(OFPort.of(1)) .build(); featuresReply = factory.buildFeaturesReply() .setDatapathId(dpid) .setNBuffers(1) .setNTables((short)1) .setCapabilities(EnumSet.<OFCapabilities>of(OFCapabilities.FLOW_STATS, OFCapabilities.TABLE_STATS)) .setAuxiliaryId(OFAuxId.MAIN) .build(); }
@Override OFFeaturesReply getFeaturesReply() { return factory.buildFeaturesReply() .setDatapathId(dpid) .setNBuffers(1) .setNTables((short)1) .setCapabilities(EnumSet.<OFCapabilities>of(OFCapabilities.FLOW_STATS, OFCapabilities.TABLE_STATS)) .setAuxiliaryId(OFAuxId.MAIN) .build(); }
public void setUpFeaturesReply() { portDesc = factory.buildPortDesc() .setName("Eth1") .setPortNo(OFPort.of(1)) .build(); featuresReply = factory.buildFeaturesReply() .setDatapathId(DatapathId.of(0x42L)) .setNBuffers(1) .setNTables((short)1) .setCapabilities(EnumSet.<OFCapabilities>of(OFCapabilities.FLOW_STATS, OFCapabilities.TABLE_STATS)) .setActions(EnumSet.<OFActionType>of(OFActionType.SET_VLAN_PCP)) .setPorts(ImmutableList.<OFPortDesc>of(portDesc)) .build(); }
@Override OFFeaturesReply getFeaturesReply() { OFPortDesc portDesc = factory.buildPortDesc() .setName("Eth1") .setPortNo(OFPort.of(1)) .build(); return factory.buildFeaturesReply() .setDatapathId(dpid) .setNBuffers(1) .setNTables((short)1) .setCapabilities(EnumSet.<OFCapabilities>of(OFCapabilities.FLOW_STATS, OFCapabilities.TABLE_STATS)) .setActions(EnumSet.<OFActionType>of(OFActionType.SET_VLAN_PCP)) .setPorts(ImmutableList.<OFPortDesc>of(portDesc)) .build(); }
@Before public void setUpFeaturesReply() { portDesc = factory.buildPortDesc() .setName("Eth1") .setPortNo(OFPort.of(1)) .build(); featuresReply = factory.buildFeaturesReply() .setDatapathId(dpid) .setNBuffers(1) .setNTables((short)1) .setCapabilities(EnumSet.<OFCapabilities>of(OFCapabilities.FLOW_STATS, OFCapabilities.TABLE_STATS)) .setAuxiliaryId(OFAuxId.MAIN) .build(); }
@Before public void setUpFeaturesReply() { portDesc = factory.buildPortDesc() .setName("Eth1") .setPortNo(OFPort.of(1)) .build(); featuresReply = factory.buildFeaturesReply() .setDatapathId(DatapathId.of(0x42L)) .setNBuffers(1) .setNTables((short)1) .setCapabilities(EnumSet.<OFCapabilities>of(OFCapabilities.FLOW_STATS, OFCapabilities.TABLE_STATS)) .setActions(EnumSet.<OFActionType>of(OFActionType.SET_VLAN_PCP)) .setPorts(ImmutableList.<OFPortDesc>of(portDesc)) .build(); }