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


Java IFloodlightProviderService类代码示例

本文整理汇总了Java中net.floodlightcontroller.core.IFloodlightProviderService的典型用法代码示例。如果您正苦于以下问题:Java IFloodlightProviderService类的具体用法?Java IFloodlightProviderService怎么用?Java IFloodlightProviderService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: processPacketInMessage

import net.floodlightcontroller.core.IFloodlightProviderService; //导入依赖的package包/类
protected Command processPacketInMessage(IOFSwitch sw, OFPacketIn pi, FloodlightContext cntx) {
	// get the packet-in switch.
	Ethernet eth =
			IFloodlightProviderService.bcStore.
			get(cntx,IFloodlightProviderService.CONTEXT_PI_PAYLOAD);

	if (eth.getPayload() instanceof BSN) {
		BSN bsn = (BSN) eth.getPayload();
		if (bsn == null) return Command.STOP;
		if (bsn.getPayload() == null) return Command.STOP;

		// It could be a packet other than BSN LLDP, therefore
		// continue with the regular processing.
		if (bsn.getPayload() instanceof LLDP == false)
			return Command.CONTINUE;

		doFloodBDDP(sw.getId(), pi, cntx);
		return Command.STOP;
	} else {
		return dropFilter(sw.getId(), pi, cntx);
	}
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:23,代码来源:TopologyManager.java

示例2: init

import net.floodlightcontroller.core.IFloodlightProviderService; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext context)
		throws FloodlightModuleException {
	linkDiscoveryService = context.getServiceImpl(ILinkDiscoveryService.class);
	threadPoolService = context.getServiceImpl(IThreadPoolService.class);
	floodlightProviderService = context.getServiceImpl(IFloodlightProviderService.class);
	switchService = context.getServiceImpl(IOFSwitchService.class);
	restApiService = context.getServiceImpl(IRestApiService.class);
	debugCounterService = context.getServiceImpl(IDebugCounterService.class);
	debugEventService = context.getServiceImpl(IDebugEventService.class);

	switchPorts = new HashMap<DatapathId, Set<OFPort>>();
	switchPortLinks = new HashMap<NodePortTuple, Set<Link>>();
	directLinks = new HashMap<NodePortTuple, Set<Link>>();
	portBroadcastDomainLinks = new HashMap<NodePortTuple, Set<Link>>();
	tunnelPorts = new HashSet<NodePortTuple>();
	topologyAware = new ArrayList<ITopologyListener>();
	ldUpdates = new LinkedBlockingQueue<LDUpdate>();
	haListener = new HAListenerDelegate();
	registerTopologyDebugCounters();
	registerTopologyDebugEvents();
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:23,代码来源:TopologyManager.java

示例3: setUp

import net.floodlightcontroller.core.IFloodlightProviderService; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    logger = LoggerFactory.getLogger(PathVerificationFlowTest.class);
    cntx = new FloodlightContext();
    FloodlightModuleContext fmc = new FloodlightModuleContext();
    fmc.addService(IFloodlightProviderService.class, mockFloodlightProvider);

    swDescription = factory.buildDescStatsReply().build();
    swFeatures = factory.buildFeaturesReply().setNBuffers(1000).build();

    sw = EasyMock.createMock(IOFSwitch.class);
    expect(sw.getId()).andReturn(swDpid).anyTimes();
    expect(sw.getOFFactory()).andReturn(factory).anyTimes();
    expect(sw.getBuffers()).andReturn(swFeatures.getNBuffers()).anyTimes();
    expect(sw.hasAttribute(IOFSwitch.PROP_SUPPORTS_OFPP_TABLE)).andReturn(true).anyTimes();
    expect(sw.getSwitchDescription()).andReturn(new SwitchDescription(swDescription)).anyTimes();
    expect(sw.isActive()).andReturn(true).anyTimes();
    expect(sw.getLatency()).andReturn(U64.of(10L)).anyTimes();
    replay(sw);

    pvs = new PathVerificationService();
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:23,代码来源:PathVerificationFlowTest.java

示例4: getModuleDependencies

import net.floodlightcontroller.core.IFloodlightProviderService; //导入依赖的package包/类
@Override
public Collection<Class<? extends IFloodlightService>>
        getModuleDependencies() {
    Collection<Class<? extends IFloodlightService>> l = 
            new ArrayList<Class<? extends IFloodlightService>>();
    l.add(IFloodlightProviderService.class);
    l.add(IRestApiService.class);
    l.add(IOFSwitchService.class);
    l.add(IDeviceService.class);
    l.add(IDebugCounterService.class);
    l.add(ITopologyService.class);
    l.add(IRoutingService.class);
    l.add(IStaticFlowEntryPusherService.class);

    return l;
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:17,代码来源:LoadBalancer.java

示例5: dispatchMessage

import net.floodlightcontroller.core.IFloodlightProviderService; //导入依赖的package包/类
public void dispatchMessage(IOFSwitch sw, OFMessage msg, FloodlightContext bc) {
      List<IOFMessageListener> theListeners = listeners.get(msg.getType()).getOrderedListeners();
      if (theListeners != null) {
          Command result = Command.CONTINUE;
          Iterator<IOFMessageListener> it = theListeners.iterator();
          if (OFType.PACKET_IN.equals(msg.getType())) {
              OFPacketIn pi = (OFPacketIn)msg;
              Ethernet eth = new Ethernet();
              eth.deserialize(pi.getData(), 0, pi.getData().length);
              IFloodlightProviderService.bcStore.put(bc,
                      IFloodlightProviderService.CONTEXT_PI_PAYLOAD,
                      eth);
          }
          while (it.hasNext() && !Command.STOP.equals(result)) {
              result = it.next().receive(sw, msg, bc);
          }
      }
// paag
      for (IControllerCompletionListener listener:completionListeners)
      	listener.onMessageConsumed(sw, msg, bc);
  }
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:22,代码来源:MockFloodlightProvider.java

示例6: getSrcIP

import net.floodlightcontroller.core.IFloodlightProviderService; //导入依赖的package包/类
@Override
public int getSrcIP(FPContext cntx) {
	FloodlightContext flCntx = cntx.getFlowContext();
	
	Ethernet eth = IFloodlightProviderService.bcStore.get(flCntx,IFloodlightProviderService.CONTEXT_PI_PAYLOAD);
	IPv4Address srcIP;
	
	if(eth.getEtherType() == EthType.IPv4)
	{		
		IPv4 ipv4 = (IPv4) eth.getPayload();
		srcIP = ipv4.getSourceAddress();
		
		return srcIP.getInt();
	}
	else if (eth.getEtherType() == EthType.ARP){
		ARP arp = (ARP) eth.getPayload();
		srcIP = arp.getSenderProtocolAddress();
		
		return srcIP.getInt();
	}
		
	//for other packets without source IP information	
	return 0;
	
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:26,代码来源:FP_LibFloodlight.java

示例7: getDstIP

import net.floodlightcontroller.core.IFloodlightProviderService; //导入依赖的package包/类
@Override
public int getDstIP(FPContext cntx) {
	FloodlightContext flCntx = cntx.getFlowContext();
	
	Ethernet eth = IFloodlightProviderService.bcStore.get(flCntx,IFloodlightProviderService.CONTEXT_PI_PAYLOAD);
	IPv4Address dstIP;
	
	if(eth.getEtherType() == EthType.IPv4)
	{		
		IPv4 ipv4 = (IPv4) eth.getPayload();
		dstIP = ipv4.getDestinationAddress();
		return dstIP.getInt();
	}
	else if (eth.getEtherType() == EthType.ARP){
		ARP arp = (ARP) eth.getPayload();

		dstIP = arp.getTargetProtocolAddress();

		return dstIP.getInt();
	}
	
	//for other packets without destination IP information
	return 0;
	
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:26,代码来源:FP_LibFloodlight.java

示例8: getARPTargetMAC

import net.floodlightcontroller.core.IFloodlightProviderService; //导入依赖的package包/类
@Override
public long getARPTargetMAC(FPContext cntx){
	FloodlightContext flCntx = cntx.getFlowContext();
	
	Ethernet eth = IFloodlightProviderService.bcStore.get(flCntx,IFloodlightProviderService.CONTEXT_PI_PAYLOAD);
	MacAddress senderMAC;
	
	if (eth.getEtherType() == EthType.ARP){
		ARP arp = (ARP) eth.getPayload();
		
		senderMAC = arp.getTargetHardwareAddress();
		
		return senderMAC.getLong();
	}
	
	//for other non-arp packets
	return 0;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:19,代码来源:FP_LibFloodlight.java

示例9: init

import net.floodlightcontroller.core.IFloodlightProviderService; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext context)
		throws FloodlightModuleException {
	floodlightProviderService = context.getServiceImpl(IFloodlightProviderService.class);
	threadPoolService = context.getServiceImpl(IThreadPoolService.class);
	debugCounterService = context.getServiceImpl(IDebugCounterService.class);
	flowQueue = new PriorityPendingQueue<OFMatchReconcile>();
	flowReconcileListeners = new ListenerDispatcher<OFType, IFlowReconcileListener>();

	Map<String, String> configParam = context.getConfigParams(this);
	String enableValue = configParam.get(EnableConfigKey);
	registerFlowReconcileManagerDebugCounters();
	// Set flowReconcile default to true
	flowReconcileEnabled = true;
	if (enableValue != null &&
			enableValue.equalsIgnoreCase("false")) {
		flowReconcileEnabled = false;
	}
	flowReconcileThreadRunCount = new AtomicInteger(0);
	lastReconcileTime = new Date(0);
	logger.debug("FlowReconcile is {}", flowReconcileEnabled);
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:23,代码来源:FlowReconcileManager.java

示例10: init

import net.floodlightcontroller.core.IFloodlightProviderService; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext context)
		throws FloodlightModuleException {
	floodlightProviderService = context.getServiceImpl(IFloodlightProviderService.class);
	restApiService = context.getServiceImpl(IRestApiService.class);
	deviceService = context.getServiceImpl(IDeviceService.class);

	vNetsByGuid = new ConcurrentHashMap<String, VirtualNetwork>();
	nameToGuid = new ConcurrentHashMap<String, String>();
	guidToGateway = new ConcurrentHashMap<String, IPv4Address>();
	gatewayToGuid = new ConcurrentHashMap<IPv4Address, Set<String>>();
	macToGuid = new ConcurrentHashMap<MacAddress, String>();
	portToMac = new ConcurrentHashMap<String, MacAddress>();
	macToGateway = new ConcurrentHashMap<MacAddress, IPv4Address>();
	deviceListener = new DeviceListenerImpl();

}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:18,代码来源:VirtualNetworkFilter.java

示例11: updateTopologyMappings

import net.floodlightcontroller.core.IFloodlightProviderService; //导入依赖的package包/类
public void updateTopologyMappings(IOFSwitch sw, OFPacketIn pi, FloodlightContext cntx) {
	Ethernet eth = IFloodlightProviderService.bcStore.get(cntx,IFloodlightProviderService.CONTEXT_PI_PAYLOAD);
	
	if (eth.getPayload() instanceof IPv4) {
		IPv4 ip_pkt = (IPv4) eth.getPayload();
		
		if (ip_pkt.getSourceAddress().getInt() > 0) {
			IpToMac.put(ip_pkt.getSourceAddress(), eth.getSourceMACAddress());
			IpToSwitch.put(ip_pkt.getSourceAddress(),new SwitchHostInfo(sw,pi.getMatch().get(MatchField.IN_PORT)));
		}
	}
	else if (eth.getPayload() instanceof ARP) {
		ARP arp_pkt = (ARP) eth.getPayload();
		
		if (IPv4Address.of(arp_pkt.getSenderProtocolAddress()).getInt() > 0) {
		
			if (!IPv4Address.of(arp_pkt.getSenderProtocolAddress()).toString().contentEquals("10.0.0.111")) {// ignore crafted requests from switches 
				IpToMac.put(IPv4Address.of(arp_pkt.getSenderProtocolAddress()), eth.getSourceMACAddress());
				IpToSwitch.put(IPv4Address.of(arp_pkt.getSenderProtocolAddress()),new SwitchHostInfo(sw,pi.getMatch().get(MatchField.IN_PORT)));
			}
		}
	}
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:24,代码来源:ObfuscationTopologyManager.java

示例12: SetUp

import net.floodlightcontroller.core.IFloodlightProviderService; //导入依赖的package包/类
@Before 
public void SetUp() throws Exception {
    fmc = new FloodlightModuleContext();
    linkDiscovery = EasyMock.createMock(ILinkDiscoveryService.class);
    mockFloodlightProvider = new MockFloodlightProvider();
    fmc.addService(IFloodlightProviderService.class, mockFloodlightProvider);
    fmc.addService(IOFSwitchService.class, new MockSwitchManager());
    fmc.addService(ILinkDiscoveryService.class, linkDiscovery);
    fmc.addService(IDebugCounterService.class, new MockDebugCounterService());
    fmc.addService(IDebugEventService.class, new MockDebugEventService());
    MockThreadPoolService tp = new MockThreadPoolService();
    topologyManager = new TopologyManager();
    fmc.addService(IThreadPoolService.class, tp);
    topologyManager.init(fmc);
    tp.init(fmc);
    tp.startUp(fmc);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:18,代码来源:TopologyInstanceTest.java

示例13: getModuleDependencies

import net.floodlightcontroller.core.IFloodlightProviderService; //导入依赖的package包/类
@Override
public Collection<Class<? extends IFloodlightService>> getModuleDependencies() {
	Collection<Class<? extends IFloodlightService>> l = new ArrayList<Class<? extends IFloodlightService>>();
	l.add(IFloodlightProviderService.class);
	l.add(IRestApiService.class);
	l.add(IRoutingService.class);
	return l;
}
 
开发者ID:hexec,项目名称:floodlight-simple-multicast,代码行数:9,代码来源:Multicast.java

示例14: init

import net.floodlightcontroller.core.IFloodlightProviderService; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext context) throws FloodlightModuleException {
	floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class);
	restApiService = context.getServiceImpl(IRestApiService.class);
	routingService = context.getServiceImpl(IRoutingService.class);
	// create an empty db
	groupDb = new MulticastDb();
	log.info("Startup MULTICAST module");
}
 
开发者ID:hexec,项目名称:floodlight-simple-multicast,代码行数:10,代码来源:Multicast.java

示例15: getModuleDependencies

import net.floodlightcontroller.core.IFloodlightProviderService; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Collection<Class<? extends IFloodlightService>> getModuleDependencies() {
    Collection<Class<? extends IFloodlightService>> services = new ArrayList<>(3);
    services.add(IFloodlightProviderService.class);
    services.add(IOFSwitchService.class);
    services.add(IRestApiService.class);
    return services;
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:12,代码来源:SwitchManager.java


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