Search in sources :

Example 1 with IPathVerificationService

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;
}
Also used : IPathVerificationService(org.openkilda.floodlight.pathverification.IPathVerificationService) DatapathId(org.projectfloodlight.openflow.types.DatapathId) Put(org.restlet.resource.Put)

Aggregations

IPathVerificationService (org.openkilda.floodlight.pathverification.IPathVerificationService)1 DatapathId (org.projectfloodlight.openflow.types.DatapathId)1 Put (org.restlet.resource.Put)1