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
alshabib
2014-09-18 10:12:14 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5c370ff70c37e56073e9a41562e80c645de2300c
5c370ff7
1 parent
eec3a064
stats reply in progress
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
22 deletions
core/api/src/main/java/org/onlab/onos/net/flow/FlowRuleProvider.java
core/api/src/main/java/org/onlab/onos/net/flow/FlowRuleProviderService.java
core/trivial/src/main/java/org/onlab/onos/net/trivial/flow/impl/SimpleFlowRuleManager.java
providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/OpenFlowRuleProvider.java
core/api/src/main/java/org/onlab/onos/net/flow/FlowRuleProvider.java
View file @
5c370ff
package
org
.
onlab
.
onos
.
net
.
flow
;
import
org.onlab.onos.net.DeviceId
;
import
org.onlab.onos.net.provider.Provider
;
/**
...
...
@@ -27,13 +26,4 @@ public interface FlowRuleProvider extends Provider {
void
removeFlowRule
(
FlowRule
...
flowRules
);
/**
* Returns the collection of flow entries currently applied on the given
* device.
*
* @param deviceId device identifier
* @return collection of flow entries
*/
Iterable
<
FlowEntry
>
getFlowMetrics
(
DeviceId
deviceId
);
}
...
...
core/api/src/main/java/org/onlab/onos/net/flow/FlowRuleProviderService.java
View file @
5c370ff
...
...
@@ -29,4 +29,13 @@ public interface FlowRuleProviderService extends ProviderService<FlowRuleProvide
*/
void
flowAdded
(
FlowRule
flowRule
);
/**
* Pushes the collection of flow entries currently applied on the given
* device.
*
* @param deviceId device identifier
* @return collection of flow entries
*/
void
pushFlowMetrics
(
Iterable
<
FlowEntry
>
flowEntries
);
}
...
...
core/trivial/src/main/java/org/onlab/onos/net/trivial/flow/impl/SimpleFlowRuleManager.java
View file @
5c370ff
package
org
.
onlab
.
onos
.
net
.
trivial
.
flow
.
impl
;
import
static
com
.
google
.
common
.
base
.
Preconditions
.
checkNotNull
;
import
static
org
.
slf4j
.
LoggerFactory
.
getLogger
;
import
java.util.ArrayList
;
...
...
@@ -28,8 +29,6 @@ import org.onlab.onos.net.provider.AbstractProviderRegistry;
import
org.onlab.onos.net.provider.AbstractProviderService
;
import
org.slf4j.Logger
;
import
static
com
.
google
.
common
.
base
.
Preconditions
.
checkNotNull
;
@Component
(
immediate
=
true
)
@Service
public
class
SimpleFlowRuleManager
...
...
@@ -111,8 +110,8 @@ implements FlowRuleService, FlowRuleProviderRegistry {
}
private
class
InternalFlowRuleProviderService
extends
AbstractProviderService
<
FlowRuleProvider
>
implements
FlowRuleProviderService
{
extends
AbstractProviderService
<
FlowRuleProvider
>
implements
FlowRuleProviderService
{
protected
InternalFlowRuleProviderService
(
FlowRuleProvider
provider
)
{
super
(
provider
);
...
...
@@ -158,6 +157,12 @@ implements FlowRuleService, FlowRuleProviderRegistry {
eventDispatcher
.
post
(
event
);
}
}
@Override
public
void
pushFlowMetrics
(
Iterable
<
FlowEntry
>
flowEntries
)
{
// TODO Auto-generated method stub
}
}
}
...
...
providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/OpenFlowRuleProvider.java
View file @
5c370ff
...
...
@@ -11,7 +11,6 @@ import org.apache.felix.scr.annotations.Reference;
import
org.apache.felix.scr.annotations.ReferenceCardinality
;
import
org.onlab.onos.net.DeviceId
;
import
org.onlab.onos.net.flow.DefaultFlowRule
;
import
org.onlab.onos.net.flow.FlowEntry
;
import
org.onlab.onos.net.flow.FlowRule
;
import
org.onlab.onos.net.flow.FlowRuleProvider
;
import
org.onlab.onos.net.flow.FlowRuleProviderRegistry
;
...
...
@@ -25,10 +24,18 @@ import org.onlab.onos.openflow.controller.OpenFlowEventListener;
import
org.onlab.onos.openflow.controller.OpenFlowSwitch
;
import
org.onlab.onos.openflow.controller.OpenFlowSwitchListener
;
import
org.projectfloodlight.openflow.protocol.OFFlowRemoved
;
import
org.projectfloodlight.openflow.protocol.OFFlowStatsEntry
;
import
org.projectfloodlight.openflow.protocol.OFFlowStatsReply
;
import
org.projectfloodlight.openflow.protocol.OFMessage
;
import
org.projectfloodlight.openflow.protocol.OFPortStatus
;
import
org.projectfloodlight.openflow.protocol.OFStatsReply
;
import
org.projectfloodlight.openflow.protocol.OFStatsType
;
import
org.slf4j.Logger
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
rt
org
.
slf4j
.
Logger
;
import
com.google.common.collect.Maps
;
/**
...
...
@@ -95,12 +102,6 @@ public class OpenFlowRuleProvider extends AbstractProvider implements FlowRulePr
}
@Override
public
Iterable
<
FlowEntry
>
getFlowMetrics
(
DeviceId
deviceId
)
{
// TODO Auto-generated method stub
return
null
;
}
//TODO: InternalFlowRuleProvider listening to stats and error and flowremoved.
// possibly barriers as well. May not be internal at all...
...
...
@@ -119,7 +120,6 @@ public class OpenFlowRuleProvider extends AbstractProvider implements FlowRulePr
@Override
public
void
switchRemoved
(
Dpid
dpid
)
{
collectors
.
remove
(
dpid
).
stop
();
}
@Override
...
...
@@ -137,6 +137,7 @@ public class OpenFlowRuleProvider extends AbstractProvider implements FlowRulePr
providerService
.
flowRemoved
(
fr
);
break
;
case
STATS_REPLY:
pushFlowMetrics
((
OFStatsReply
)
msg
);
break
;
case
BARRIER_REPLY:
case
ERROR:
...
...
@@ -146,6 +147,19 @@ public class OpenFlowRuleProvider extends AbstractProvider implements FlowRulePr
}
private
void
pushFlowMetrics
(
OFStatsReply
stats
)
{
if
(
stats
.
getStatsType
()
!=
OFStatsType
.
FLOW
)
{
return
;
}
final
OFFlowStatsReply
replies
=
(
OFFlowStatsReply
)
stats
;
final
List
<
FlowEntry
>
entries
=
Lists
.
newLinkedList
();
for
(
OFFlowStatsEntry
reply
:
replies
.
getEntries
())
{
}
}
}
...
...
Please
register
or
login
to post a comment