Search in sources :

Example 1 with IndirectDhcpRelayConfig

use of org.onosproject.dhcprelay.config.IndirectDhcpRelayConfig in project onos by opennetworkinglab.

the class DhcpRelayManager method updateConfig.

/**
 * Updates DHCP relay app configuration with given configuration.
 *
 * @param config the configuration ot update
 */
protected void updateConfig(Config config) {
    if (config instanceof IndirectDhcpRelayConfig) {
        IndirectDhcpRelayConfig indirectConfig = (IndirectDhcpRelayConfig) config;
        v4Handler.setIndirectDhcpServerConfigs(indirectConfig.dhcpServerConfigs());
        v6Handler.setIndirectDhcpServerConfigs(indirectConfig.dhcpServerConfigs());
    } else if (config instanceof DefaultDhcpRelayConfig) {
        DefaultDhcpRelayConfig defaultConfig = (DefaultDhcpRelayConfig) config;
        v4Handler.setDefaultDhcpServerConfigs(defaultConfig.dhcpServerConfigs());
        v6Handler.setDefaultDhcpServerConfigs(defaultConfig.dhcpServerConfigs());
    }
    if (config instanceof IgnoreDhcpConfig) {
        v4Handler.updateIgnoreVlanConfig((IgnoreDhcpConfig) config);
        v6Handler.updateIgnoreVlanConfig((IgnoreDhcpConfig) config);
    }
    if (config instanceof HostAutoRelearnConfig) {
        setHostAutoRelearnConfig((HostAutoRelearnConfig) config);
    }
}
Also used : IgnoreDhcpConfig(org.onosproject.dhcprelay.config.IgnoreDhcpConfig) HostAutoRelearnConfig(org.onosproject.dhcprelay.config.HostAutoRelearnConfig) DefaultDhcpRelayConfig(org.onosproject.dhcprelay.config.DefaultDhcpRelayConfig) IndirectDhcpRelayConfig(org.onosproject.dhcprelay.config.IndirectDhcpRelayConfig)

Example 2 with IndirectDhcpRelayConfig

use of org.onosproject.dhcprelay.config.IndirectDhcpRelayConfig in project onos by opennetworkinglab.

the class DhcpRelayManager method updateConfig.

/**
 * Updates DHCP relay app configuration.
 */
private void updateConfig() {
    DefaultDhcpRelayConfig defaultConfig = cfgService.getConfig(appId, DefaultDhcpRelayConfig.class);
    IndirectDhcpRelayConfig indirectConfig = cfgService.getConfig(appId, IndirectDhcpRelayConfig.class);
    IgnoreDhcpConfig ignoreDhcpConfig = cfgService.getConfig(appId, IgnoreDhcpConfig.class);
    HostAutoRelearnConfig hostAutoRelearnConfig = cfgService.getConfig(appId, HostAutoRelearnConfig.class);
    if (defaultConfig != null) {
        updateConfig(defaultConfig);
    }
    if (indirectConfig != null) {
        updateConfig(indirectConfig);
    }
    if (ignoreDhcpConfig != null) {
        updateConfig(ignoreDhcpConfig);
    }
    if (hostAutoRelearnConfig != null) {
        updateConfig(hostAutoRelearnConfig);
    }
}
Also used : IgnoreDhcpConfig(org.onosproject.dhcprelay.config.IgnoreDhcpConfig) HostAutoRelearnConfig(org.onosproject.dhcprelay.config.HostAutoRelearnConfig) DefaultDhcpRelayConfig(org.onosproject.dhcprelay.config.DefaultDhcpRelayConfig) IndirectDhcpRelayConfig(org.onosproject.dhcprelay.config.IndirectDhcpRelayConfig)

Aggregations

DefaultDhcpRelayConfig (org.onosproject.dhcprelay.config.DefaultDhcpRelayConfig)2 HostAutoRelearnConfig (org.onosproject.dhcprelay.config.HostAutoRelearnConfig)2 IgnoreDhcpConfig (org.onosproject.dhcprelay.config.IgnoreDhcpConfig)2 IndirectDhcpRelayConfig (org.onosproject.dhcprelay.config.IndirectDhcpRelayConfig)2