16 package org.openkilda.floodlight;
18 import net.floodlightcontroller.core.IOFSwitch;
19 import net.floodlightcontroller.core.internal.IOFSwitchService;
20 import org.projectfloodlight.openflow.types.DatapathId;
21 import org.projectfloodlight.openflow.types.MacAddress;
23 import java.util.Arrays;
26 private final IOFSwitchService switchService;
29 this.switchService = switchService;
40 IOFSwitch swInfo = switchService.getSwitch(dpId);
42 throw new IllegalArgumentException(String.format(
"Switch %s not found", dpId));
51 public MacAddress
dpIdToMac(
final DatapathId dpId) {
52 return MacAddress.of(Arrays.copyOfRange(dpId.getBytes(), 2, 8));
MacAddress dpIdToMac(final IOFSwitch sw)
MacAddress dpIdToMac(final DatapathId dpId)
IOFSwitch lookupSwitch(DatapathId dpId)
SwitchUtils(IOFSwitchService switchService)