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
3887c13f
Commit
3887c13f
authored
8 years ago
by
Geddings Barrineau
Browse files
Options
Downloads
Patches
Plain Diff
Added latency code into Link serializer. Users can now get link latencies from the GUI.
parent
bc33254e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/net/floodlightcontroller/linkdiscovery/web/LinkWithType.java
+8
-6
8 additions, 6 deletions
.../floodlightcontroller/linkdiscovery/web/LinkWithType.java
with
8 additions
and
6 deletions
src/main/java/net/floodlightcontroller/linkdiscovery/web/LinkWithType.java
+
8
−
6
View file @
3887c13f
...
...
@@ -16,20 +16,19 @@
package
net.floodlightcontroller.linkdiscovery.web
;
import
java.io.IOException
;
import
org.projectfloodlight.openflow.types.DatapathId
;
import
org.projectfloodlight.openflow.types.OFPort
;
import
com.fasterxml.jackson.core.JsonGenerator
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.JsonSerializer
;
import
com.fasterxml.jackson.databind.SerializerProvider
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LinkDirection
;
import
net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LinkType
;
import
net.floodlightcontroller.routing.Link
;
import
org.projectfloodlight.openflow.types.DatapathId
;
import
org.projectfloodlight.openflow.types.OFPort
;
import
org.projectfloodlight.openflow.types.U64
;
import
java.io.IOException
;
/**
* This class is both the datastructure and the serializer
...
...
@@ -44,6 +43,7 @@ public class LinkWithType extends JsonSerializer<LinkWithType> {
public
OFPort
dstPort
;
public
LinkType
type
;
public
LinkDirection
direction
;
public
U64
latency
;
// Do NOT delete this, it's required for the serializer
public
LinkWithType
()
{}
...
...
@@ -57,6 +57,7 @@ public class LinkWithType extends JsonSerializer<LinkWithType> {
this
.
dstPort
=
link
.
getDstPort
();
this
.
type
=
type
;
this
.
direction
=
direction
;
this
.
latency
=
link
.
getLatency
();
}
@Override
...
...
@@ -70,6 +71,7 @@ public class LinkWithType extends JsonSerializer<LinkWithType> {
jgen
.
writeNumberField
(
"dst-port"
,
lwt
.
dstPort
.
getPortNumber
());
jgen
.
writeStringField
(
"type"
,
lwt
.
type
.
toString
());
jgen
.
writeStringField
(
"direction"
,
lwt
.
direction
.
toString
());
jgen
.
writeNumberField
(
"latency"
,
lwt
.
latency
.
getValue
());
// Might be an issue if value exceed what unsigned long can hold
jgen
.
writeEndObject
();
}
...
...
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