本文整理汇总了Java中org.projectfloodlight.openflow.protocol.OFCapabilities类的典型用法代码示例。如果您正苦于以下问题:Java OFCapabilities类的具体用法?Java OFCapabilities怎么用?Java OFCapabilities使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OFCapabilities类属于org.projectfloodlight.openflow.protocol包,在下文中一共展示了OFCapabilities类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SwitchSyncRepresentation
import org.projectfloodlight.openflow.protocol.OFCapabilities; //导入依赖的package包/类
/**
* @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;
}
示例2: ofWireValue
import org.projectfloodlight.openflow.protocol.OFCapabilities; //导入依赖的package包/类
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);
}
示例3: ofWireValue
import org.projectfloodlight.openflow.protocol.OFCapabilities; //导入依赖的package包/类
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);
}
示例4: ofWireValue
import org.projectfloodlight.openflow.protocol.OFCapabilities; //导入依赖的package包/类
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);
}
示例5: setFeaturesReply
import org.projectfloodlight.openflow.protocol.OFCapabilities; //导入依赖的package包/类
@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());
}
示例6: ofWireValue
import org.projectfloodlight.openflow.protocol.OFCapabilities; //导入依赖的package包/类
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);
}
示例7: serializeCapabilities
import org.projectfloodlight.openflow.protocol.OFCapabilities; //导入依赖的package包/类
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();
}
}
示例8: setUpFeaturesReply
import org.projectfloodlight.openflow.protocol.OFCapabilities; //导入依赖的package包/类
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();
}
示例9: getFeaturesReply
import org.projectfloodlight.openflow.protocol.OFCapabilities; //导入依赖的package包/类
@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();
}
示例10: setUpFeaturesReply
import org.projectfloodlight.openflow.protocol.OFCapabilities; //导入依赖的package包/类
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();
}
示例11: getFeaturesReply
import org.projectfloodlight.openflow.protocol.OFCapabilities; //导入依赖的package包/类
@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();
}
示例12: setUpFeaturesReply
import org.projectfloodlight.openflow.protocol.OFCapabilities; //导入依赖的package包/类
@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();
}
示例13: setUpFeaturesReply
import org.projectfloodlight.openflow.protocol.OFCapabilities; //导入依赖的package包/类
@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();
}