示例#1
0
  @Activate
  protected void activate() {
    appId = coreService.registerApplication("org.onosproject.cordvtn");
    ruleInstaller =
        new CordVtnRuleInstaller(
            appId,
            flowRuleService,
            deviceService,
            driverService,
            groupService,
            mastershipService,
            DEFAULT_TUNNEL);

    arpProxy = new CordVtnArpProxy(appId, packetService);
    packetService.addProcessor(packetProcessor, PacketProcessor.director(0));
    arpProxy.requestPacket();

    hostService.addListener(hostListener);
    hostProvider = hostProviderRegistry.register(this);

    configRegistry.registerConfigFactory(configFactory);
    configService.addListener(configListener);
    readConfiguration();

    log.info("Started");
  }
示例#2
0
  private void enable() {
    hostService.addListener(hostListener);
    packetService.addProcessor(packetProcessor, PacketProcessor.director(3));

    TrafficSelector selector =
        DefaultTrafficSelector.builder()
            .matchEthType(EthType.EtherType.IPV4.ethType().toShort())
            .build();
    packetService.requestPackets(selector, PacketPriority.REACTIVE, appId, Optional.empty());
  }
  @Activate
  protected void activate() {
    appId = coreService.registerApplication("org.onosproject.openstackswitching");

    factories.forEach(cfgService::registerConfigFactory);
    packetService.addProcessor(internalPacketProcessor, PacketProcessor.director(1));
    deviceService.addListener(internalDeviceListener);
    cfgService.addListener(internalConfigListener);

    internalConfigListener.configureNetwork();

    log.info("Started");
  }
  /**
   * Create a variable of the SwitchPacketProcessor class using the PacketProcessor defined above.
   * Activates the app.
   */
  @Activate
  protected void activate() {
    log.info("Started");
    appId =
        coreService.getAppId(
            "org.onosproject.learningswitch"); // equal to the name shown in pom.xml file

    processor = new SwitchPacketProcesser();
    packetService.addProcessor(processor, PacketProcessor.director(3));

    /*
     * Restricts packet types to IPV4 and ARP by only requesting those types.
     */
    packetService.requestPackets(
        DefaultTrafficSelector.builder().matchEthType(Ethernet.TYPE_IPV4).build(),
        PacketPriority.REACTIVE,
        appId,
        Optional.empty());
    packetService.requestPackets(
        DefaultTrafficSelector.builder().matchEthType(Ethernet.TYPE_ARP).build(),
        PacketPriority.REACTIVE,
        appId,
        Optional.empty());
  }