当前位置: 首页>>代码示例>>Java>>正文


Java OFDescriptionStatistics.setManufacturerDescription方法代码示例

本文整理汇总了Java中org.openflow.protocol.statistics.OFDescriptionStatistics.setManufacturerDescription方法的典型用法代码示例。如果您正苦于以下问题:Java OFDescriptionStatistics.setManufacturerDescription方法的具体用法?Java OFDescriptionStatistics.setManufacturerDescription怎么用?Java OFDescriptionStatistics.setManufacturerDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openflow.protocol.statistics.OFDescriptionStatistics的用法示例。


在下文中一共展示了OFDescriptionStatistics.setManufacturerDescription方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSetSwitchProperties

import org.openflow.protocol.statistics.OFDescriptionStatistics; //导入方法依赖的package包/类
@Test
public void testSetSwitchProperties() {
    OFDescriptionStatistics desc = new OFDescriptionStatistics();

    desc.setDatapathDescription("My Data Path");
    desc.setSerialNumber("");
    desc.setManufacturerDescription("Big Switch Networks");
    desc.setHardwareDescription("Xenon");
    desc.setSoftwareDescription("Indigo 2");

    IOFSwitch sw = new BetterOFSwitchXenon();
    sw.setSwitchProperties(desc);
    assertEquals(desc.getDatapathDescription(),
                 sw.getAttribute(IOFSwitch.SWITCH_DESCRIPTION_DATA));
    assertEquals(true,
                 sw.getAttribute(IOFSwitch.SWITCH_SUPPORTS_NX_ROLE));
    assertNull(sw.getAttribute(IBetterOFSwitch.SUPPORTS_OVSDB_TUNNEL_SETUP));
    assertEquals(true,
                 sw.getAttribute(IBetterOFSwitch.SUPPORTS_NX_TTL_DECREMENT));
}
 
开发者ID:opendaylight,项目名称:archived-net-virt-platform,代码行数:21,代码来源:BetterOFSwitchXenonTest.java

示例2: handleDescrStatsRequest

import org.openflow.protocol.statistics.OFDescriptionStatistics; //导入方法依赖的package包/类
private void handleDescrStatsRequest(OFMessage msg){
	OFDescriptionStatistics descrStats = mySwitch.getDescriptionStatistics();
	OFStatisticsReply reply = new OFStatisticsReply();
	reply.setStatisticType(OFStatisticsType.DESC);
	List<OFStatistics> stats = new ArrayList<OFStatistics>();
	descrStats.setHardwareDescription("FSFW: " + descrStats.getHardwareDescription());
	descrStats.setManufacturerDescription("FSFW: " + descrStats.getManufacturerDescription());
	descrStats.setSoftwareDescription("FSFW: " + descrStats.getSoftwareDescription());
	stats.add(descrStats);
	reply.setStatistics(stats);
	reply.setXid(msg.getXid());
	reply.setFlags((short)0x0000);
	reply.setLengthU(descrStats.getLength() + reply.getLength());
	try {
		ofcch.sendMessage(reply);
	} catch (IOException e1) {
		e1.printStackTrace();
	}
	return;
}
 
开发者ID:GlobalNOC,项目名称:FlowSpaceFirewall,代码行数:21,代码来源:Proxy.java

示例3: getDescription

import org.openflow.protocol.statistics.OFDescriptionStatistics; //导入方法依赖的package包/类
@JsonIgnore
public OFDescriptionStatistics getDescription() {
    OFDescriptionStatistics desc = new OFDescriptionStatistics();
    desc.setManufacturerDescription(manufacturerDescription);
    desc.setHardwareDescription(hardwareDescription);
    desc.setSoftwareDescription(softwareDescription);
    desc.setSerialNumber(serialNumber);
    desc.setDatapathDescription(datapathDescription);
    return desc;
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:11,代码来源:SwitchSyncRepresentation.java

示例4: createOFDescriptionStatistics

import org.openflow.protocol.statistics.OFDescriptionStatistics; //导入方法依赖的package包/类
private static OFDescriptionStatistics createOFDescriptionStatistics() {
    OFDescriptionStatistics desc = new OFDescriptionStatistics();
    desc.setDatapathDescription("");
    desc.setHardwareDescription("");
    desc.setManufacturerDescription("");
    desc.setSerialNumber("");
    desc.setSoftwareDescription("");
    return desc;
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:10,代码来源:ControllerTest.java

示例5: createDescriptionStatsReply

import org.openflow.protocol.statistics.OFDescriptionStatistics; //导入方法依赖的package包/类
private static OFStatisticsReply createDescriptionStatsReply() {
    OFStatisticsReply sr = (OFStatisticsReply)BasicFactory.getInstance()
            .getMessage(OFType.STATS_REPLY);
    sr.setStatisticType(OFStatisticsType.DESC);
    OFDescriptionStatistics desc = new OFDescriptionStatistics();
    desc.setDatapathDescription("Datapath Description");
    desc.setHardwareDescription("Hardware Description");
    desc.setManufacturerDescription("Manufacturer Description");
    desc.setSerialNumber("Serial Number");
    desc.setSoftwareDescription("Software Description");
    sr.setStatistics(Collections.singletonList(desc));
    return sr;
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:14,代码来源:OFChannelHandlerTest.java

示例6: descStatBuilder

import org.openflow.protocol.statistics.OFDescriptionStatistics; //导入方法依赖的package包/类
/**
 * Description Stats Reply Builder
 *
 * @param incomingStat incoming Stats Request
 * @return the Stats Reply
 */
private OFDescriptionStatistics descStatBuilder(OFStatisticsRequest incomingStat) {

    OFDescriptionStatistics descStat = new OFDescriptionStatistics();
    descStat.setDatapathDescription("None");
    descStat.setHardwareDescription("OFCProbe Vswitch");
    descStat.setManufacturerDescription("Lehrstuhl fuer Informatik III, University of Wuerzburg");
    descStat.setSerialNumber(String.valueOf(this.dpid));
    descStat.setSoftwareDescription("1.0.3");

    return descStat;
}
 
开发者ID:lsinfo3,项目名称:ofcprobe,代码行数:18,代码来源:OFStatsHandler.java

示例7: testBindSwitchOrder

import org.openflow.protocol.statistics.OFDescriptionStatistics; //导入方法依赖的package包/类
@Test
 public void testBindSwitchOrder() {
     List<String> order = new ArrayList<String>(3);
     controller.addOFSwitchDriver("", this);
     controller.addOFSwitchDriver("test switch", this);
     controller.addOFSwitchDriver("test", this);
     order.add("test switch");
     order.add("test");
     order.add("");
     test_bind_order = true;

     OFChannelState state = new OFChannelState();
     Controller.OFChannelHandler chdlr =
             controller.new OFChannelHandler(state);
     chdlr.sw = null;

     // Swith should be bound of OFSwitchImpl (default)
     state.hsState = OFChannelState.HandshakeState.HELLO;
     state.hasDescription = true;
     state.hasGetConfigReply = true;
     state.switchBindingDone = false;
     OFDescriptionStatistics desc = new OFDescriptionStatistics();
     desc.setManufacturerDescription("test switch");
     desc.setHardwareDescription("version 0.9");
     state.description = desc;
     OFFeaturesReply featuresReply = new OFFeaturesReply();
     featuresReply.setPorts(new ArrayList<OFPhysicalPort>());
     state.featuresReply = featuresReply;

     chdlr.bindSwitchToDriver();
     assertTrue(chdlr.sw instanceof OFSwitchImpl);
     assertTrue(!(chdlr.sw instanceof TestSwitchClass));
     // Verify bind_order is called as expected
     assertTrue(order.equals(bind_order));
     test_bind_order = false;
     bind_order = null;
}
 
开发者ID:opendaylight,项目名称:archived-net-virt-platform,代码行数:38,代码来源:ControllerTest.java

示例8: testBindSwitchOrder

import org.openflow.protocol.statistics.OFDescriptionStatistics; //导入方法依赖的package包/类
@Test
 public void testBindSwitchOrder() {
     List<String> order = new ArrayList<String>(3);
     controller.addOFSwitchDriver("", this);
     controller.addOFSwitchDriver("test switch", this);
     controller.addOFSwitchDriver("test", this);
     order.add("test switch");
     order.add("test");
     order.add("");
     test_bind_order = true;
     
     OFChannelState state = new OFChannelState();
     Controller.OFChannelHandler chdlr =
             controller.new OFChannelHandler(state);
     chdlr.sw = null;
     
     // Swith should be bound of OFSwitchImpl (default)
     state.hsState = OFChannelState.HandshakeState.HELLO;
     state.hasDescription = true;
     state.hasGetConfigReply = true;
     state.switchBindingDone = false;
     OFDescriptionStatistics desc = new OFDescriptionStatistics();
     desc.setManufacturerDescription("test switch");
     desc.setHardwareDescription("version 0.9");
     state.description = desc;
     OFFeaturesReply featuresReply = new OFFeaturesReply();
     featuresReply.setPorts(new ArrayList<OFPhysicalPort>());
     state.featuresReply = featuresReply;

     chdlr.bindSwitchToDriver();
     assertTrue(chdlr.sw instanceof OFSwitchImpl);
     assertTrue(!(chdlr.sw instanceof TestSwitchClass));
     // Verify bind_order is called as expected
     assertTrue(order.equals(bind_order));
     test_bind_order = false;
     bind_order = null;
}
 
开发者ID:wallnerryan,项目名称:FL_HAND,代码行数:38,代码来源:ControllerTest.java

示例9: testSwitchDriverRegistryNoDriver

import org.openflow.protocol.statistics.OFDescriptionStatistics; //导入方法依赖的package包/类
/**
 * Test SwitchDriverRegistry
 * Test fallback to default if no switch driver is registered for a
 * particular prefix
 */
@Test
public void testSwitchDriverRegistryNoDriver() {
    IOFSwitchDriver driver = createMock(IOFSwitchDriver.class);
    IOFSwitch returnedSwitch = null;
    IOFSwitch mockSwitch = createMock(IOFSwitch.class);
    controller.addOFSwitchDriver("test switch", driver);

    replay(driver);
    replay(mockSwitch);

    OFDescriptionStatistics desc = createOFDescriptionStatistics();
    desc.setManufacturerDescription("test switch");
    desc.setHardwareDescription("version 0.9");
    reset(driver);
    reset(mockSwitch);
    mockSwitch.setSwitchProperties(desc);
    expectLastCall().once();
    expect(driver.getOFSwitchImpl(desc)).andReturn(mockSwitch).once();
    replay(driver);
    replay(mockSwitch);
    returnedSwitch = controller.getOFSwitchInstance(desc);
    assertSame(mockSwitch, returnedSwitch);
    verify(driver);
    verify(mockSwitch);


    desc = createOFDescriptionStatistics();
    desc.setManufacturerDescription("Foo Bar test switch");
    desc.setHardwareDescription("version 0.9");
    reset(driver);
    reset(mockSwitch);
    replay(driver);
    replay(mockSwitch);
    returnedSwitch = controller.getOFSwitchInstance(desc);
    assertNotNull(returnedSwitch);
    assertTrue("Returned switch should be OFSwitchImpl",
               returnedSwitch instanceof OFSwitchImpl);
    assertEquals(desc, returnedSwitch.getDescriptionStatistics());
    verify(driver);
    verify(mockSwitch);
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:47,代码来源:ControllerTest.java

示例10: testSetSwitchPropoerties

import org.openflow.protocol.statistics.OFDescriptionStatistics; //导入方法依赖的package包/类
@Test
public void testSetSwitchPropoerties() {
    OFDescriptionStatistics desc = new OFDescriptionStatistics();
    IOFSwitch sw = new BetterOFSwitchOVS();
    
    desc.setDatapathDescription("My Data Path");
    desc.setSerialNumber("");
    desc.setManufacturerDescription("Nicira Networks, Inc");
    desc.setHardwareDescription("Open vSwitch");
    
    sw = new BetterOFSwitchOVS();
    desc.setSoftwareDescription("1.4.0");
    sw.setSwitchProperties(desc);
    assertNull(sw.getAttribute(IBetterOFSwitch.SUPPORTS_NX_TTL_DECREMENT));
    
    assertEquals(desc.getDatapathDescription(), 
                 sw.getAttribute(IOFSwitch.SWITCH_DESCRIPTION_DATA));
    assertEquals(true,
                 sw.getAttribute(IOFSwitch.SWITCH_SUPPORTS_NX_ROLE));
    assertEquals(true,
                 sw.getAttribute(IBetterOFSwitch.SUPPORTS_OVSDB_TUNNEL_SETUP));
    
    sw = new BetterOFSwitchOVS();
    desc.setSoftwareDescription("1.4.3");
    sw.setSwitchProperties(desc);
    assertNull(sw.getAttribute(IBetterOFSwitch.SUPPORTS_NX_TTL_DECREMENT));
    
    sw = new BetterOFSwitchOVS();
    desc.setSoftwareDescription("1.6.0");
    sw.setSwitchProperties(desc);
    assertEquals(true, 
                 sw.getAttribute(IBetterOFSwitch.SUPPORTS_NX_TTL_DECREMENT));
    
    sw = new BetterOFSwitchOVS();
    desc.setSoftwareDescription("1.7.0");
    sw.setSwitchProperties(desc);
    assertEquals(true, 
                 sw.getAttribute(IBetterOFSwitch.SUPPORTS_NX_TTL_DECREMENT));
    
    // invalid version 
    // don't allocate new switch object.
    desc.setSoftwareDescription("xxxxx");
    sw.setSwitchProperties(desc);
    assertNull(sw.getAttribute(IBetterOFSwitch.SUPPORTS_NX_TTL_DECREMENT));
    
}
 
开发者ID:opendaylight,项目名称:archived-net-virt-platform,代码行数:47,代码来源:BetterOFSwitchOVSTest.java

示例11: testBindSwitchToDriver

import org.openflow.protocol.statistics.OFDescriptionStatistics; //导入方法依赖的package包/类
@Test
public void testBindSwitchToDriver() {
    controller.addOFSwitchDriver("test", this);

    OFChannelState state = new OFChannelState();
    Controller.OFChannelHandler chdlr =
            controller.new OFChannelHandler(state);

    // Swith should be bound of OFSwitchImpl (default)
    state.hsState = OFChannelState.HandshakeState.HELLO;
    state.hasDescription = true;
    state.hasGetConfigReply = true;
    state.switchBindingDone = false;
    OFDescriptionStatistics desc = new OFDescriptionStatistics();
    desc.setManufacturerDescription("test switch");
    desc.setHardwareDescription("version 0.9");
    state.description = desc;
    OFFeaturesReply featuresReply = new OFFeaturesReply();
    featuresReply.setPorts(new ArrayList<OFPhysicalPort>());
    state.featuresReply = featuresReply;

    chdlr.bindSwitchToDriver();
    assertTrue(chdlr.sw instanceof OFSwitchImpl);
    assertTrue(!(chdlr.sw instanceof TestSwitchClass));

    // Switch should be bound to TestSwitchImpl
    state.switchBindingDone = false;
    desc.setManufacturerDescription("test1 switch");
    desc.setHardwareDescription("version 1.0");
    state.description = desc;
    state.featuresReply = featuresReply;

    chdlr.bindSwitchToDriver();
    assertTrue(chdlr.sw instanceof TestSwitchClass);

    // Switch should be bound to Test11SwitchImpl
    state.switchBindingDone = false;
    desc.setManufacturerDescription("test11 switch");
    desc.setHardwareDescription("version 1.1");
    state.description = desc;
    state.featuresReply = featuresReply;

    chdlr.bindSwitchToDriver();
    assertTrue(chdlr.sw instanceof Test11SwitchClass);
}
 
开发者ID:opendaylight,项目名称:archived-net-virt-platform,代码行数:46,代码来源:ControllerTest.java

示例12: parseStatsReply

import org.openflow.protocol.statistics.OFDescriptionStatistics; //导入方法依赖的package包/类
/**
 * Parses message into relevant properties
 * @param statsType the specific Stats Type (0:DESC, 1:FLOW, 2:AGGREGATE, 3:TABLE, 4:PORT, 5:QUEUE, 6:VENDOR)
 * @param rawMessage Assumes the following format and parses into properties:
 * "["flow_stats_reply", 3, [{"packet_count": 0, "hard_timeout": 0, "byte_count": 0, "idle_timeout": 0, "actions": "[{'output': 65533}]", 
 * 							  "duration_nsec": 27000000, "priority": 0, "duration_sec": 0, "table_id": 0, "cookie": 0, "match": "{}"}]]"
 */
public OFStatisticsReply parseStatsReply(OFStatisticsType statsType, String rawMessage) {
	//EXTRACT THE JSON
	String tmp = rawMessage.substring(rawMessage.indexOf(",")+2, rawMessage.length()-2);
	String switchStr = tmp.substring(0, 1);
	this.switchId = Long.parseLong(switchStr);
	String jsonStr = tmp.substring(tmp.indexOf(",")+3);
	JSONObject json = new JSONObject(jsonStr);
	
	//ADD PROPS TO STATS_REPLY OBJECT
	OFStatisticsReply statsReply = new OFStatisticsReply();
	//statsReply.setFlags(Short.parseShort(flagStr));
	statsReply.setStatisticType(statsType);
	statsReply.setStatisticsFactory(new BasicFactory());
	List<OFStatistics> statistics = new ArrayList<OFStatistics>();
	switch (statsType) {
		case DESC:
			OFDescriptionStatistics description = new OFDescriptionStatistics();
			description.setDatapathDescription("A");
			description.setHardwareDescription("B");
			description.setManufacturerDescription("C");
			description.setSerialNumber("D");
			description.setSoftwareDescription("E");
			statistics.add(description);
			break;
		case FLOW:
			OFFlowStatisticsReply flowStats = new OFFlowStatisticsReply();
			flowStats.setByteCount(json.getLong("byte_count"));
			flowStats.setActionFactory(new BasicFactory());
			//FORMATTING SEEMS OFF (why is it in " "), NEED TO CONVERT STRING TO JSON ARRAY
			String tmpArrayStr = json.getString("actions");
			JSONArray jsonArray = new JSONArray(tmpArrayStr);
			flowStats.setActions(parseActionsArray(jsonArray));
			//
			flowStats.setCookie(json.getLong("cookie"));
			flowStats.setDurationNanoseconds(json.getInt("duration_nsec"));
			flowStats.setDurationSeconds(json.getInt("duration_sec"));
			flowStats.setHardTimeout((short)json.getInt("hard_timeout"));
			flowStats.setIdleTimeout((short)json.getInt("idle_timeout"));
			flowStats.setPacketCount(json.getLong("packet_count"));
			flowStats.setPriority((short)json.getInt("priority"));
			flowStats.setTableId((byte)json.getInt("table_id"));
			OFMatch match = new OFMatch();
			flowStats.setMatch(match);
			statistics.add(flowStats);
			break;
		case TABLE:
			OFTableStatistics tables = new OFTableStatistics();
			tables.setTableId(Byte.parseByte(json.getString("table_id")));
			//tables.setActiveCount();
			//tables.setLookupCount(lookupCount);
			//tables.setMatchedCount(matchedCount);
			//tables.setMaximumEntries(maximumEntries);
			//tables.setWildcards(wildcards);
			statistics.add(tables);
			break;
		case PORT:
			OFPortStatisticsReply portStatReply = new OFPortStatisticsReply();
			portStatReply.setreceivePackets(json.getLong("packet_count"));
			portStatReply.setPortNumber(Short.parseShort(json.getString("port")));
			portStatReply.setReceiveBytes(json.getLong("received_bytes"));
			statistics.add(portStatReply);
			break;
		case AGGREGATE:
		case VENDOR:
		case QUEUE:
	}
	statsReply.setStatistics(statistics);
	return statsReply;
}
 
开发者ID:fp7-netide,项目名称:Engine,代码行数:77,代码来源:MessageParser.java

示例13: testBindSwitchToDriver

import org.openflow.protocol.statistics.OFDescriptionStatistics; //导入方法依赖的package包/类
@Test
public void testBindSwitchToDriver() {
    controller.addOFSwitchDriver("test", this);
    
    OFChannelState state = new OFChannelState();
    Controller.OFChannelHandler chdlr =
            controller.new OFChannelHandler(state);
    
    // Swith should be bound of OFSwitchImpl (default)
    state.hsState = OFChannelState.HandshakeState.HELLO;
    state.hasDescription = true;
    state.hasGetConfigReply = true;
    state.switchBindingDone = false;
    OFDescriptionStatistics desc = new OFDescriptionStatistics();
    desc.setManufacturerDescription("test switch");
    desc.setHardwareDescription("version 0.9");
    state.description = desc;
    OFFeaturesReply featuresReply = new OFFeaturesReply();
    featuresReply.setPorts(new ArrayList<OFPhysicalPort>());
    state.featuresReply = featuresReply;

    chdlr.bindSwitchToDriver();
    assertTrue(chdlr.sw instanceof OFSwitchImpl);
    assertTrue(!(chdlr.sw instanceof TestSwitchClass));
    
    // Switch should be bound to TestSwitchImpl
    state.switchBindingDone = false;
    desc.setManufacturerDescription("test1 switch");
    desc.setHardwareDescription("version 1.0");
    state.description = desc;
    state.featuresReply = featuresReply;

    chdlr.bindSwitchToDriver();
    assertTrue(chdlr.sw instanceof TestSwitchClass);

    // Switch should be bound to Test11SwitchImpl
    state.switchBindingDone = false;
    desc.setManufacturerDescription("test11 switch");
    desc.setHardwareDescription("version 1.1");
    state.description = desc;
    state.featuresReply = featuresReply;

    chdlr.bindSwitchToDriver();
    assertTrue(chdlr.sw instanceof Test11SwitchClass);
}
 
开发者ID:wallnerryan,项目名称:FL_HAND,代码行数:46,代码来源:ControllerTest.java


注:本文中的org.openflow.protocol.statistics.OFDescriptionStatistics.setManufacturerDescription方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。