Пример #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
 @Deactivate
 public void deactivate() {
   providerRegistry.unregister(this);
   pktService.removeProcessor(processor);
   deviceService.removeListener(deviceListener);
   providerService = null;
   log.info("Stopped");
 }
Пример #3
0
  @Deactivate
  protected void deactivate() {
    hostProviderRegistry.unregister(this);
    hostService.removeListener(hostListener);

    packetService.removeProcessor(packetProcessor);

    configRegistry.unregisterConfigFactory(configFactory);
    configService.removeListener(configListener);

    eventExecutor.shutdown();
    log.info("Stopped");
  }
Пример #4
0
  @Activate
  public void activate(ComponentContext context) {
    appId = coreService.registerApplication("org.onosproject.provider.host");

    modified(context);
    providerService = providerRegistry.register(this);
    pktService.addProcessor(processor, 1);
    deviceService.addListener(deviceListener);

    TrafficSelector.Builder selectorBuilder = DefaultTrafficSelector.builder();
    selectorBuilder.matchEthType(Ethernet.TYPE_ARP);
    pktService.requestPackets(selectorBuilder.build(), PacketPriority.CONTROL, appId);

    log.info("Started");
  }
Пример #5
0
  // Parses the given JSON and provides hosts as configured.
  private void parseHosts() {
    try {
      JsonNode nodes = cfg.get("hosts");
      if (nodes != null) {
        for (JsonNode node : nodes) {
          parseHost(node);

          // FIXME: hack to make sure host attributes take
          // This will be fixed when GossipHostStore uses ECM
          parseHost(node);
        }
      }
    } finally {
      hostProviderRegistry.unregister(this);
    }
  }
Пример #6
0
 private void unregister() {
   deviceProviderRegistry.unregister(this);
   linkProviderRegistry.unregister(this);
   hostProviderRegistry.unregister(this);
 }
Пример #7
0
 private void register() {
   deviceProviderService = deviceProviderRegistry.register(this);
   linkProviderService = linkProviderRegistry.register(this);
   hostProviderService = hostProviderRegistry.register(this);
 }