Search in sources :

Example 1 with DataSignature

use of org.openkilda.floodlight.utils.DataSignature in project open-kilda by telstra.

the class PingService method setup.

/**
 * Initialize internal data structures. Called by module that own this service. Called after all dependencies have
 * been loaded.
 */
@Override
public void setup(FloodlightModuleContext moduleContext) throws FloodlightModuleException {
    // FIXME(surabujin): avoid usage foreign module configuration
    Map<String, String> config = moduleContext.getConfigParams(PathVerificationService.class);
    try {
        signature = new DataSignature(config.get("hmac256-secret"));
    } catch (InvalidSignatureConfigurationException e) {
        throw new FloodlightModuleException(String.format("Unable to initialize %s", getClass().getName()), e);
    }
    InputService inputService = moduleContext.getServiceImpl(InputService.class);
    inputService.addTranslator(OFType.PACKET_IN, new PingInputTranslator());
    KildaCoreConfig coreConfig = moduleContext.getServiceImpl(KildaCore.class).getConfig();
    magicSourceMacAddress = MacAddress.of(coreConfig.getFlowPingMagicSrcMacAddress());
}
Also used : InputService(org.openkilda.floodlight.service.of.InputService) FloodlightModuleException(net.floodlightcontroller.core.module.FloodlightModuleException) InvalidSignatureConfigurationException(org.openkilda.floodlight.error.InvalidSignatureConfigurationException) KildaCoreConfig(org.openkilda.floodlight.KildaCoreConfig) KildaCore(org.openkilda.floodlight.KildaCore) DataSignature(org.openkilda.floodlight.utils.DataSignature)

Aggregations

FloodlightModuleException (net.floodlightcontroller.core.module.FloodlightModuleException)1 KildaCore (org.openkilda.floodlight.KildaCore)1 KildaCoreConfig (org.openkilda.floodlight.KildaCoreConfig)1 InvalidSignatureConfigurationException (org.openkilda.floodlight.error.InvalidSignatureConfigurationException)1 InputService (org.openkilda.floodlight.service.of.InputService)1 DataSignature (org.openkilda.floodlight.utils.DataSignature)1