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
a2fc0b76
Commit
a2fc0b76
authored
12 years ago
by
Munish Mehta
Browse files
Options
Downloads
Patches
Plain Diff
BSC-2475: Handle rest output for port numbers larger than 32K
parent
5d2c766e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/net/floodlightcontroller/routing/Link.java
+12
-2
12 additions, 2 deletions
src/main/java/net/floodlightcontroller/routing/Link.java
src/main/java/net/floodlightcontroller/topology/NodePortTuple.java
+9
-1
9 additions, 1 deletion
...java/net/floodlightcontroller/topology/NodePortTuple.java
with
21 additions
and
3 deletions
src/main/java/net/floodlightcontroller/routing/Link.java
+
12
−
2
View file @
a2fc0b76
...
...
@@ -18,6 +18,7 @@
package
net.floodlightcontroller.routing
;
import
net.floodlightcontroller.core.web.serializers.DPIDSerializer
;
import
net.floodlightcontroller.core.web.serializers.UShortSerializer
;
import
org.codehaus.jackson.annotate.JsonProperty
;
import
org.codehaus.jackson.map.annotate.JsonSerialize
;
...
...
@@ -52,6 +53,7 @@ public class Link {
}
@JsonProperty
(
"src-port"
)
@JsonSerialize
(
using
=
UShortSerializer
.
class
)
public
short
getSrcPort
()
{
return
srcPort
;
}
...
...
@@ -62,6 +64,7 @@ public class Link {
return
dst
;
}
@JsonProperty
(
"dst-port"
)
@JsonSerialize
(
using
=
UShortSerializer
.
class
)
public
short
getDstPort
()
{
return
dstPort
;
}
...
...
@@ -102,11 +105,18 @@ public class Link {
public
String
toString
()
{
return
"Link [src="
+
HexString
.
toHexString
(
this
.
src
)
+
" outPort="
+
srcPort
+
(
srcPort
&
0xffff
)
+
", dst="
+
HexString
.
toHexString
(
this
.
dst
)
+
", inPort="
+
dstPort
+
(
dstPort
&
0xffff
)
+
"]"
;
}
public
String
toKeyString
()
{
return
(
HexString
.
toHexString
(
this
.
src
)
+
"|"
+
(
this
.
srcPort
&
0xffff
)
+
"|"
+
HexString
.
toHexString
(
this
.
dst
)
+
"|"
+
(
this
.
dstPort
&
0xffff
)
);
}
}
This diff is collapsed.
Click to expand it.
src/main/java/net/floodlightcontroller/topology/NodePortTuple.java
+
9
−
1
View file @
a2fc0b76
package
net.floodlightcontroller.topology
;
import
net.floodlightcontroller.core.web.serializers.DPIDSerializer
;
import
net.floodlightcontroller.core.web.serializers.UShortSerializer
;
import
org.codehaus.jackson.annotate.JsonProperty
;
import
org.codehaus.jackson.map.annotate.JsonSerialize
;
...
...
@@ -40,6 +41,7 @@ public class NodePortTuple {
this
.
nodeId
=
nodeId
;
}
@JsonProperty
(
"port"
)
@JsonSerialize
(
using
=
UShortSerializer
.
class
)
public
short
getPortId
()
{
return
portId
;
}
...
...
@@ -76,7 +78,13 @@ public class NodePortTuple {
return
true
;
}
/**
* API to return a String value formed wtih NodeID and PortID
* The portID is a 16-bit field, so mask it as an integer to get full
* positive value
* @return
*/
public
String
toKeyString
()
{
return
(
HexString
.
toHexString
(
nodeId
)+
"|"
+
portId
);
return
(
HexString
.
toHexString
(
nodeId
)+
"|"
+
(
portId
&
0xffff
)
);
}
}
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