Skip to content
Snippets Groups Projects
Commit 774cd0b2 authored by Vishnu Emmadi's avatar Vishnu Emmadi Committed by Saurav Das
Browse files

BVS-447 Flow Path Visualization

Implemented backend for the REST API to retrieve the flow path between a pair of hosts
parent ba4663bb
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,13 @@ public interface ILinkDiscoveryService extends IFloodlightService {
*/
public Map<Link, LinkInfo> getLinks();
/**
* Retrieves the link info for a given link
* @param link link for which the link info should be returned
* @return the link info for the given link
*/
public LinkInfo getLinkInfo(Link link);
/**
* Returns link type of a given link
* @param info
......
......@@ -40,6 +40,12 @@ public class LinkInfo {
this.lastBddpReceivedTime = null;
}
public LinkInfo(LinkInfo fromLinkInfo) {
this.firstSeenTime = fromLinkInfo.getFirstSeenTime();
this.lastLldpReceivedTime = fromLinkInfo.getUnicastValidTime();
this.lastBddpReceivedTime = fromLinkInfo.getMulticastValidTime();
}
protected Long firstSeenTime;
protected Long lastLldpReceivedTime; /* Standard LLLDP received time */
protected Long lastBddpReceivedTime; /* Modified LLDP received time */
......
/**
floodlight/src/main/java/net/floodlightcontroller/linkdiscovery/LinkInfo.java/**
* Copyright 2011, Big Switch Networks, Inc.
* Originally created by David Erickson, Stanford University
*
......@@ -508,6 +508,18 @@ public class LinkDiscoveryManager implements IOFMessageListener,
return result;
}
@Override
public LinkInfo getLinkInfo(Link link) {
lock.readLock().lock();
LinkInfo linkInfo = links.get(link);
LinkInfo retLinkInfo = null;
if (linkInfo != null) {
retLinkInfo = new LinkInfo(linkInfo);
}
lock.readLock().unlock();
return retLinkInfo;
}
@Override
public String getName() {
return MODULE_NAME;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment