Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
tom
2014-08-27 16:22:15 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
edf06bb5b54e59c0036f0480541fbd1206d0a2c5
edf06bb5
1 parent
43387f38
Adding model abstractions to help flesh-out the concepts.
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
228 additions
and
1 deletions
net/api/src/main/java/org/onlab/onos/net/device/DeviceService.java
net/api/src/main/java/org/onlab/onos/net/host/HostService.java
net/api/src/main/java/org/onlab/onos/net/link/LinkService.java
net/api/src/main/java/org/onlab/onos/net/topology/TopologyDescription.java
net/api/src/main/java/org/onlab/onos/net/topology/TopologyEvent.java
net/api/src/main/java/org/onlab/onos/net/topology/TopologyListener.java
net/api/src/main/java/org/onlab/onos/net/topology/TopologyService.java
net/api/src/main/java/org/onlab/onos/net/device/DeviceService.java
View file @
edf06bb
...
...
@@ -22,7 +22,7 @@ public interface DeviceService {
MastershipRole
getRole
(
DeviceId
deviceId
);
/**
* Returns a
n iterable
collection of the currently known infrastructure
* Returns a collection of the currently known infrastructure
* devices.
*
* @return collection of devices
...
...
net/api/src/main/java/org/onlab/onos/net/host/HostService.java
0 → 100644
View file @
edf06bb
package
org
.
onlab
.
onos
.
net
.
host
;
import
org.onlab.onos.net.ConnectPoint
;
import
org.onlab.onos.net.DeviceId
;
import
org.onlab.onos.net.ElementId
;
import
org.onlab.onos.net.Host
;
import
java.util.Set
;
/**
* Service for interacting with the inventory of end-station hosts.
*/
public
interface
HostService
{
/**
* Returns a collection of all end-station hosts.
*
* @return collection of hosts
*/
Iterable
<
Host
>
getHosts
();
/**
* Returns the host with the specified identifier.
*
* @param hostId host identifier
* @return host or null if one with the given identifier is not known
*/
Host
getHost
(
ElementId
hostId
);
// TODO: change to HostId
// TODO: determine which ones make sense or which we care to support
// Set<Host> getHostsByVlan(VlanId vlan);
// Set<Host> getHostsByMac(MacAddress mac);
// Set<Host> getHostsByIp(IpAddress ip);
/**
* Returns the set of hosts whose most recent location is the specified
* connection point.
*
* @param connectPoint connection point
* @return set of hosts connected to the connection point
*/
Set
<
Host
>
getConnectedHosts
(
ConnectPoint
connectPoint
);
/**
* Returns the set of hosts whose most recent location is the specified
* infrastructure device.
*
* @param deviceId device identifier
* @return set of hosts connected to the device
*/
Set
<
Host
>
getConnectedHosts
(
DeviceId
deviceId
);
/**
* Adds the specified host listener.
*
* @param listener host listener
*/
void
addListener
(
HostListener
listener
);
/**
* Removes the specified host listener.
*
* @param listener host listener
*/
void
removeListener
(
HostListener
listener
);
}
net/api/src/main/java/org/onlab/onos/net/link/LinkService.java
0 → 100644
View file @
edf06bb
package
org
.
onlab
.
onos
.
net
.
link
;
import
org.onlab.onos.net.DeviceId
;
import
org.onlab.onos.net.Link
;
import
java.util.Set
;
/**
* Service for interacting with the inventory of infrastructure links.
*/
public
interface
LinkService
{
/**
* Returns a collection of all known infrastructure links.
*
* @return all infrastructure links
*/
Iterable
<
Link
>
getLinks
();
/**
* Returns set of all infrastructure links leading to and from the
* specified device.
*
* @param deviceId device identifier
* @return set of device links
*/
Set
<
Link
>
getDeviceLinks
(
DeviceId
deviceId
);
/**
* Returns set of all infrastructure links leading from the specified device.
*
* @param deviceId device identifier
* @return set of device egress links
*/
Set
<
Link
>
getDeviceEgressLinks
(
DeviceId
deviceId
);
/**
* Returns set of all infrastructure links leading to the specified device.
*
* @param deviceId device identifier
* @return set of device ingress links
*/
Set
<
Link
>
getDeviceInressLinks
(
DeviceId
deviceId
);
/**
* Adds the specified link listener.
*
* @param listener link listener
*/
void
addListener
(
LinkListener
listener
);
/**
* Removes the specified link listener.
*
* @param listener link listener
*/
void
removeListener
(
LinkListener
listener
);
}
net/api/src/main/java/org/onlab/onos/net/topology/TopologyDescription.java
View file @
edf06bb
...
...
@@ -17,4 +17,14 @@ public interface TopologyDescription extends Description {
*/
Collection
<
Description
>
details
();
// Default topology provider/computor should do the following:
// create graph
// search graph for SCC clusters (Tarjan)
// search graph for all pairs shortest paths based on hop-count
// this means all shortest paths, between all pairs; not just one shortest path
// optionally use path results to produce destination-rooted broadcast trees
// provide description with the graph, clusters, paths and trees upwards
}
...
...
net/api/src/main/java/org/onlab/onos/net/topology/TopologyEvent.java
0 → 100644
View file @
edf06bb
package
org
.
onlab
.
onos
.
net
.
topology
;
import
org.onlab.onos.event.AbstractEvent
;
import
org.onlab.onos.net.Topology
;
/**
* Describes network topology event.
*/
public
class
TopologyEvent
extends
AbstractEvent
<
TopologyEvent
.
Type
,
Topology
>
{
/**
* Type of topology events.
*/
public
enum
Type
{
/**
* Signifies that topology has changed.
*/
TOPOLOGY_CHANGED
}
/**
* Creates an event of a given type and for the specified topology and the
* current time.
*
* @param type topology event type
* @param topology event topology subject
*/
public
TopologyEvent
(
Type
type
,
Topology
topology
)
{
super
(
type
,
topology
);
}
/**
* Creates an event of a given type and for the specified topology and time.
*
* @param type link event type
* @param topology event topology subject
* @param time occurrence time
*/
public
TopologyEvent
(
Type
type
,
Topology
topology
,
long
time
)
{
super
(
type
,
topology
,
time
);
}
}
net/api/src/main/java/org/onlab/onos/net/topology/TopologyListener.java
0 → 100644
View file @
edf06bb
package
org
.
onlab
.
onos
.
net
.
topology
;
import
org.onlab.onos.event.EventListener
;
/**
* Entity capable of receiving network topology related events.
*/
public
interface
TopologyListener
extends
EventListener
<
TopologyEvent
>
{
}
net/api/src/main/java/org/onlab/onos/net/topology/TopologyService.java
0 → 100644
View file @
edf06bb
package
org
.
onlab
.
onos
.
net
.
topology
;
import
org.onlab.onos.net.Topology
;
/**
* Service for providing network topology information.
*/
public
interface
TopologyService
{
/**
* Returns the current topology descriptor.
*
* @return current topology
*/
Topology
currentTopology
();
// TODO: Figure out hot to best export graph traversal methods via Graph/Vertex/Edge
// TODO: figure out how we want this to be presented, via Topology or via TopologyService
// Set<TopologyCluster> getClusters(Topology topology);
// Set<Path> getPaths(Topology topology, DeviceId src, DeviceId dst);
// Set<Path> getPaths(Topology topology, DeviceId src, DeviceId dst, LinkWeight weight);
// boolean isInfrastructure(Topology topology, ConnectPoint connectPoint);
// boolean isInBroadcastTree(Topology topology, ConnectPoint connectPoint);
/**
* Adds the specified topology listener.
*
* @param listener topology listener
*/
void
addListener
(
TopologyListener
listener
);
/**
* Removes the specified topology listener.
*
* @param listener topology listener
*/
void
removeListener
(
TopologyListener
listener
);
}
Please
register
or
login
to post a comment