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());
}
Aggregations