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
Marc De Leenheer
2014-10-28 16:29:07 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
631ffce5b022040935587613441995a713b0ddad
631ffce5
1 parent
bd8c988f
Support optical port status via OFExperimenter type 0x748771
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletions
apps/optical/src/main/java/org/onlab/onos/optical/cfg/OpticalConfigProvider.java
openflow/ctl/src/main/java/org/onlab/onos/openflow/controller/impl/OpenFlowControllerImpl.java
apps/optical/src/main/java/org/onlab/onos/optical/cfg/OpticalConfigProvider.java
View file @
631ffce
...
...
@@ -73,7 +73,7 @@ public class OpticalConfigProvider extends AbstractProvider implements DevicePro
// TODO: fix hard coded file path later.
private
static
final
String
DEFAULT_CONFIG_FILE
=
"
/opt/onos/
config/demo-3-roadm-2-ps.json"
;
"config/demo-3-roadm-2-ps.json"
;
private
String
configFileName
=
DEFAULT_CONFIG_FILE
;
@Reference
(
cardinality
=
ReferenceCardinality
.
MANDATORY_UNARY
)
...
...
openflow/ctl/src/main/java/org/onlab/onos/openflow/controller/impl/OpenFlowControllerImpl.java
View file @
631ffce
...
...
@@ -39,8 +39,11 @@ import org.onlab.onos.openflow.controller.OpenFlowSwitchListener;
import
org.onlab.onos.openflow.controller.PacketListener
;
import
org.onlab.onos.openflow.controller.RoleState
;
import
org.onlab.onos.openflow.controller.driver.OpenFlowAgent
;
import
org.projectfloodlight.openflow.protocol.OFCircuitPortStatus
;
import
org.projectfloodlight.openflow.protocol.OFExperimenter
;
import
org.projectfloodlight.openflow.protocol.OFMessage
;
import
org.projectfloodlight.openflow.protocol.OFPacketIn
;
import
org.projectfloodlight.openflow.protocol.OFPortDesc
;
import
org.projectfloodlight.openflow.protocol.OFPortStatus
;
import
org.projectfloodlight.openflow.protocol.OFStatsReply
;
import
org.projectfloodlight.openflow.protocol.OFStatsType
;
...
...
@@ -183,11 +186,32 @@ public class OpenFlowControllerImpl implements OpenFlowController {
l
.
switchChanged
(
dpid
);
}
}
break
;
case
FLOW_REMOVED:
case
ERROR:
case
BARRIER_REPLY:
executor
.
submit
(
new
OFMessageHandler
(
dpid
,
msg
));
break
;
case
EXPERIMENTER:
// Handle optical port stats
if
(((
OFExperimenter
)
msg
).
getExperimenter
()
==
0x748771
)
{
OFCircuitPortStatus
circuitPortStatus
=
(
OFCircuitPortStatus
)
msg
;
OFPortStatus
.
Builder
portStatus
=
this
.
getSwitch
(
dpid
).
factory
().
buildPortStatus
();
OFPortDesc
.
Builder
portDesc
=
this
.
getSwitch
(
dpid
).
factory
().
buildPortDesc
();
portDesc
.
setPortNo
(
circuitPortStatus
.
getPortNo
())
.
setHwAddr
(
circuitPortStatus
.
getHwAddr
())
.
setName
(
circuitPortStatus
.
getName
())
.
setConfig
(
circuitPortStatus
.
getConfig
())
.
setState
(
circuitPortStatus
.
getState
());
portStatus
.
setReason
(
circuitPortStatus
.
getReason
()).
setDesc
(
portDesc
.
build
());
for
(
OpenFlowSwitchListener
l
:
ofSwitchListener
)
{
l
.
portChanged
(
dpid
,
portStatus
.
build
());
}
}
else
{
log
.
warn
(
"Handling experimenter type {} not yet implemented"
,
((
OFExperimenter
)
msg
).
getExperimenter
(),
msg
);
}
break
;
default
:
log
.
warn
(
"Handling message type {} not yet implemented {}"
,
msg
.
getType
(),
msg
);
...
...
Please
register
or
login
to post a comment