Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
floodlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
croft1
floodlight
Commits
1af589cb
Commit
1af589cb
authored
10 years ago
by
sanjivininaikar
Browse files
Options
Downloads
Patches
Plain Diff
Update StatsReplySerializer.java
Support for IPv6
parent
dd963a31
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/net/floodlightcontroller/core/web/serializers/StatsReplySerializer.java
+7
-33
7 additions, 33 deletions
...controller/core/web/serializers/StatsReplySerializer.java
with
7 additions
and
33 deletions
src/main/java/net/floodlightcontroller/core/web/serializers/StatsReplySerializer.java
+
7
−
33
View file @
1af589cb
...
...
@@ -40,33 +40,30 @@ import org.projectfloodlight.openflow.protocol.OFPortStatsReply;
import
org.projectfloodlight.openflow.protocol.OFPortStatsEntry
;
import
org.projectfloodlight.openflow.protocol.OFPortDescStatsReply
;
import
org.projectfloodlight.openflow.protocol.OFPortDesc
;
import
org.projectfloodlight.openflow.protocol.ver13.OFFlowModFlagsSerializerVer13
;
//
Use
L
oxigen's serializer
//Use
the l
oxigen's serializer
import
org.projectfloodlight.openflow.protocol.ver13.OFPortFeaturesSerializerVer13
;
import
org.projectfloodlight.openflow.protocol.ver12.OFFlowModFlagsSerializerVer12
;
import
org.projectfloodlight.openflow.protocol.ver12.OFPortFeaturesSerializerVer12
;
import
org.projectfloodlight.openflow.protocol.ver11.OFFlowModFlagsSerializerVer11
;
import
org.projectfloodlight.openflow.protocol.ver11.OFPortFeaturesSerializerVer11
;
import
org.projectfloodlight.openflow.protocol.ver10.OFFlowModFlagsSerializerVer10
;
import
org.projectfloodlight.openflow.protocol.ver10.OFPortFeaturesSerializerVer10
;
import
org.projectfloodlight.openflow.protocol.ver13.OFPortStateSerializerVer13
;
import
org.projectfloodlight.openflow.protocol.ver12.OFPortStateSerializerVer12
;
import
org.projectfloodlight.openflow.protocol.ver11.OFPortStateSerializerVer11
;
import
org.projectfloodlight.openflow.protocol.ver10.OFPortStateSerializerVer10
;
import
org.projectfloodlight.openflow.protocol.ver13.OFPortConfigSerializerVer13
;
import
org.projectfloodlight.openflow.protocol.ver14.OFFlowModFlagsSerializerVer14
;
import
org.projectfloodlight.openflow.protocol.ver12.OFPortConfigSerializerVer12
;
import
org.projectfloodlight.openflow.protocol.ver11.OFPortConfigSerializerVer11
;
import
org.projectfloodlight.openflow.protocol.ver10.OFPortConfigSerializerVer10
;
import
org.projectfloodlight.openflow.protocol.OFAggregateStatsReply
;
import
org.projectfloodlight.openflow.protocol.OFVersion
;
import
org.projectfloodlight.openflow.protocol.match.*
;
import
org.projectfloodlight.openflow.protocol.oxm.*
;
import
org.projectfloodlight.openflow.protocol.instruction.*
;
import
org.projectfloodlight.openflow.protocol.action.*
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* Serialize a DPID as colon-separated hexadecimal
*/
...
...
@@ -203,27 +200,7 @@ public class StatsReplySerializer extends JsonSerializer<StatsReply> {
jGen
.
writeNumberField
(
"priority"
,
entry
.
getPriority
());
jGen
.
writeNumberField
(
"idleTimeoutSec"
,
entry
.
getIdleTimeout
());
jGen
.
writeNumberField
(
"hardTimeoutSec"
,
entry
.
getHardTimeout
());
switch
(
entry
.
getVersion
())
{
case
OF_10:
jGen
.
writeNumberField
(
"flags"
,
OFFlowModFlagsSerializerVer10
.
toWireValue
(
entry
.
getFlags
()));
break
;
case
OF_11:
jGen
.
writeNumberField
(
"flags"
,
OFFlowModFlagsSerializerVer11
.
toWireValue
(
entry
.
getFlags
()));
break
;
case
OF_12:
jGen
.
writeNumberField
(
"flags"
,
OFFlowModFlagsSerializerVer12
.
toWireValue
(
entry
.
getFlags
()));
break
;
case
OF_13:
jGen
.
writeNumberField
(
"flags"
,
OFFlowModFlagsSerializerVer13
.
toWireValue
(
entry
.
getFlags
()));
break
;
case
OF_14:
jGen
.
writeNumberField
(
"flags"
,
OFFlowModFlagsSerializerVer14
.
toWireValue
(
entry
.
getFlags
()));
break
;
default
:
logger
.
error
(
"Could not decode OFVersion {}"
,
entry
.
getVersion
());
break
;
}
jGen
.
writeNumberField
(
"flags"
,
entry
.
getFlags
());
// list flow matches
jGen
.
writeObjectFieldStart
(
"match"
);
Iterator
<
MatchField
<?>>
mi
=
entry
.
getMatch
().
getMatchFields
().
iterator
();
// get iter to any match field type
...
...
@@ -305,13 +282,13 @@ public class StatsReplySerializer extends JsonSerializer<StatsReply> {
jGen
.
writeNumberField
(
MatchUtils
.
STR_IPV6_FLOW_LABEL
,
m
.
get
(
MatchField
.
IPV6_FLABEL
).
getIPv6FlowLabelValue
());
break
;
case
IPV6_ND_SLL:
jGen
.
writeNumberField
(
MatchUtils
.
STR_IPV6_ND_S
S
L
,
m
.
get
(
MatchField
.
IPV6_ND_SLL
).
getLong
());
jGen
.
writeNumberField
(
MatchUtils
.
STR_IPV6_ND_S
L
L
,
m
.
get
(
MatchField
.
IPV6_ND_SLL
).
getLong
());
break
;
case
IPV6_ND_TARGET:
jGen
.
writeNumberField
(
MatchUtils
.
STR_IPV6_ND_TARGET
,
m
.
get
(
MatchField
.
IPV6_ND_TARGET
).
getZeroCompressStart
());
break
;
case
IPV6_ND_TLL:
jGen
.
writeNumberField
(
MatchUtils
.
STR_IPV6_ND_T
T
L
,
m
.
get
(
MatchField
.
IPV6_ND_TLL
).
getLong
());
jGen
.
writeNumberField
(
MatchUtils
.
STR_IPV6_ND_T
L
L
,
m
.
get
(
MatchField
.
IPV6_ND_TLL
).
getLong
());
break
;
case
METADATA:
jGen
.
writeNumberField
(
MatchUtils
.
STR_METADATA
,
m
.
get
(
MatchField
.
METADATA
).
getValue
().
getValue
());
...
...
@@ -645,9 +622,6 @@ public class StatsReplySerializer extends JsonSerializer<StatsReply> {
jGen
.
writeNumberField
(
"supportedFeatures"
,
OFPortFeaturesSerializerVer13
.
toWireValue
(
entry
.
getSupported
()));
jGen
.
writeNumberField
(
"peerFeatures"
,
OFPortFeaturesSerializerVer13
.
toWireValue
(
entry
.
getPeer
()));
break
;
case
OF_14:
// TODO
logger
.
error
(
"OF1.4 OFPortDesc serializer not implemented"
);
}
if
(
OFVersion
.
OF_10
!=
entry
.
getVersion
())
{
jGen
.
writeNumberField
(
"currSpeed"
,
entry
.
getCurrSpeed
());
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment