use of org.openkilda.floodlight.pathverification.IPathVerificationService in project open-kilda by telstra.
the class PathDiscover method sendDiscoverPacket.
@Put("json")
public String sendDiscoverPacket() {
IPathVerificationService pvs = (IPathVerificationService) getContext().getAttributes().get(IPathVerificationService.class.getCanonicalName());
String srcSwitch = (String) getRequestAttributes().get("src_switch");
String port = (String) getRequestAttributes().get("src_port");
String dstSwitch = (String) getRequestAttributes().get("dst_switch");
logger.debug("asking {} to send a discovery packet out port {} with destination {}.", new Object[] { srcSwitch, port, dstSwitch });
if (dstSwitch == null) {
DatapathId d = DatapathId.of(srcSwitch);
int p = Integer.parseInt(port);
pvs.sendDiscoveryMessage(d, OFPort.of(p));
} else {
pvs.sendDiscoveryMessage(DatapathId.of(srcSwitch), OFPort.of(new Integer(port)), DatapathId.of(dstSwitch));
}
return null;
}
Aggregations