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
088ca6df
Commit
088ca6df
authored
10 years ago
by
sanjivininaikar
Browse files
Options
Downloads
Patches
Plain Diff
Update StaticFlowEntryPusherResource.java
Support for IPv6
parent
96060548
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/staticflowentry/web/StaticFlowEntryPusherResource.java
+12
-4
12 additions, 4 deletions
...er/staticflowentry/web/StaticFlowEntryPusherResource.java
with
12 additions
and
4 deletions
src/main/java/net/floodlightcontroller/staticflowentry/web/StaticFlowEntryPusherResource.java
+
12
−
4
View file @
088ca6df
...
...
@@ -26,9 +26,9 @@ import org.restlet.resource.ServerResource;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
net.floodlightcontroller.core.annotations.LogMessageCategory
;
import
net.floodlightcontroller.core.annotations.LogMessageDoc
;
import
net.floodlightcontroller.staticflowentry.HeaderFieldsException
;
import
net.floodlightcontroller.staticflowentry.StaticFlowEntries
;
import
net.floodlightcontroller.staticflowentry.StaticFlowEntryPusher
;
import
net.floodlightcontroller.storage.IStorageSourceService
;
...
...
@@ -62,11 +62,13 @@ public class StaticFlowEntryPusherResource extends ServerResource {
type
=
Integer
.
parseInt
(
val
);
}
catch
(
NumberFormatException
e
)
{
/* fail silently */
}
}
if
(
type
==
2048
)
matchEther
=
true
;
if
(
(
type
==
2048
)
||
(
type
==
34525
)
)
matchEther
=
true
;
}
if
((
rows
.
containsKey
(
StaticFlowEntryPusher
.
COLUMN_NW_DST
)
||
rows
.
containsKey
(
StaticFlowEntryPusher
.
COLUMN_NW_SRC
)
||
rows
.
containsKey
(
StaticFlowEntryPusher
.
COLUMN_NW6_SRC
)
||
rows
.
containsKey
(
StaticFlowEntryPusher
.
COLUMN_NW6_DST
)
||
rows
.
containsKey
(
StaticFlowEntryPusher
.
COLUMN_NW_PROTO
)
||
rows
.
containsKey
(
StaticFlowEntryPusher
.
COLUMN_NW_TOS
))
&&
(
matchEther
==
false
))
...
...
@@ -96,8 +98,9 @@ public class StaticFlowEntryPusherResource extends ServerResource {
rowValues
=
StaticFlowEntries
.
jsonToStorageEntry
(
fmJson
);
String
status
=
null
;
if
(!
checkMatchIp
(
rowValues
))
{
status
=
"Warning! Must specify dl_type of IPv4/IPv6 to "
+
"match on IPv4/IPv6 fields! The flow has been discarded."
;
status
=
"Warning! Pushing a static flow entry that matches IP "
+
"fields without matching for IP payload (ether-type IPv4 or IPv6 ) will cause "
+
"the switch to wildcard higher level fields."
;
log
.
error
(
status
);
}
else
{
status
=
"Entry pushed"
;
...
...
@@ -107,7 +110,12 @@ public class StaticFlowEntryPusherResource extends ServerResource {
}
catch
(
IOException
e
)
{
log
.
error
(
"Error parsing push flow mod request: "
+
fmJson
,
e
);
return
"{\"status\" : \"Error! Could not parse flod mod, see log for details.\"}"
;
}
catch
(
HeaderFieldsException
e
)
{
log
.
error
(
"Error parsing push flow mod request: "
+
fmJson
,
e
);
return
"{\"status\" : \"Error! Check the fields specified for the flow.Make sure IPv4 fields are not mixed with IPv6 fields or all "
+
"mandatory fields are specified.\"}"
;
}
}
@Delete
...
...
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