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
24d259e9
Commit
24d259e9
authored
11 years ago
by
Andrew Ferguson
Browse files
Options
Downloads
Patches
Plain Diff
Add support for max-rate OF extension as implemented by Indigo1 firmware
parent
3e41d2f1
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/org/openflow/protocol/OFQueueProp.java
+17
-8
17 additions, 8 deletions
src/main/java/org/openflow/protocol/OFQueueProp.java
with
17 additions
and
8 deletions
src/main/java/org/openflow/protocol/OFQueueProp.java
+
17
−
8
View file @
24d259e9
...
...
@@ -21,11 +21,12 @@ import org.openflow.util.U16;
public
class
OFQueueProp
{
private
int
NONE_MINIMUM_LENGTH
=
8
;
private
int
MIN_
RATE_MINIMUM_LENGTH
=
16
;
private
int
RATE_MINIMUM_LENGTH
=
16
;
public
enum
OFQueuePropType
{
OFPQT_NONE
(
0
),
OFPQT_MIN_RATE
(
1
);
OFPQT_MIN_RATE
(
1
),
OFPQT_MAX_RATE
(
2
);
protected
int
value
;
...
...
@@ -46,6 +47,8 @@ public class OFQueueProp {
return
OFPQT_NONE
;
case
1
:
return
OFPQT_MIN_RATE
;
case
2
:
return
OFPQT_MAX_RATE
;
}
return
null
;
}
...
...
@@ -53,7 +56,7 @@ public class OFQueueProp {
protected
OFQueuePropType
type
;
protected
short
length
;
protected
short
rate
=
-
1
;
// not valid
unless
type == OFPQT_
MIN_RAT
E
protected
short
rate
=
-
1
;
// not valid
if
type == OFPQT_
NON
E
public
OFQueueProp
()
{
this
.
type
=
OFQueuePropType
.
OFPQT_NONE
;
...
...
@@ -78,7 +81,10 @@ public class OFQueueProp {
this
.
length
=
U16
.
t
(
NONE_MINIMUM_LENGTH
);
break
;
case
OFPQT_MIN_RATE:
this
.
length
=
U16
.
t
(
MIN_RATE_MINIMUM_LENGTH
);
this
.
length
=
U16
.
t
(
RATE_MINIMUM_LENGTH
);
break
;
case
OFPQT_MAX_RATE:
this
.
length
=
U16
.
t
(
RATE_MINIMUM_LENGTH
);
break
;
}
}
...
...
@@ -109,8 +115,9 @@ public class OFQueueProp {
this
.
length
=
data
.
readShort
();
data
.
readInt
();
// pad
if
(
this
.
type
==
OFQueuePropType
.
OFPQT_MIN_RATE
)
{
assert
(
this
.
length
==
MIN_RATE_MINIMUM_LENGTH
);
if
(
this
.
type
==
OFQueuePropType
.
OFPQT_MIN_RATE
||
this
.
type
==
OFQueuePropType
.
OFPQT_MAX_RATE
)
{
assert
(
this
.
length
==
RATE_MINIMUM_LENGTH
);
this
.
rate
=
data
.
readShort
();
data
.
readInt
();
// pad
...
...
@@ -125,7 +132,8 @@ public class OFQueueProp {
data
.
writeShort
(
this
.
length
);
data
.
writeInt
(
0
);
// pad
if
(
this
.
type
==
OFQueuePropType
.
OFPQT_MIN_RATE
)
{
if
(
this
.
type
==
OFQueuePropType
.
OFPQT_MIN_RATE
||
this
.
type
==
OFQueuePropType
.
OFPQT_MAX_RATE
)
{
data
.
writeShort
(
this
.
rate
);
data
.
writeInt
(
0
);
// pad
data
.
writeShort
(
0
);
// pad
...
...
@@ -156,7 +164,8 @@ public class OFQueueProp {
if
(
type
!=
other
.
type
)
{
return
false
;
}
if
(
type
==
OFQueuePropType
.
OFPQT_MIN_RATE
)
{
if
(
type
==
OFQueuePropType
.
OFPQT_MIN_RATE
||
type
==
OFQueuePropType
.
OFPQT_MAX_RATE
)
{
if
(
rate
!=
other
.
rate
)
{
return
false
;
}
...
...
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