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
bb497f4f
Commit
bb497f4f
authored
10 years ago
by
sanjivininaikar
Browse files
Options
Downloads
Patches
Plain Diff
Update StaticFlowEntries.java
Suggested changes made
parent
72a5a556
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/StaticFlowEntries.java
+5
-49
5 additions, 49 deletions
...oodlightcontroller/staticflowentry/StaticFlowEntries.java
with
5 additions
and
49 deletions
src/main/java/net/floodlightcontroller/staticflowentry/StaticFlowEntries.java
+
5
−
49
View file @
bb497f4f
...
...
@@ -24,10 +24,9 @@ import java.util.Map;
import
net.floodlightcontroller.core.annotations.LogMessageCategory
;
import
net.floodlightcontroller.core.util.AppCookie
;
import
net.floodlightcontroller.staticflowentry.web.StaticFlowEntryPusherResource
;
import
net.floodlightcontroller.util.ActionUtils
;
import
net.floodlightcontroller.util.InstructionUtils
;
import
net.floodlightcontroller.util.MatchUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -322,7 +321,8 @@ public class StaticFlowEntries {
}
// end switch-case
}
// end while
if
(!(
checkActions
(
entry
)))
int
result
=
StaticFlowEntryPusherResource
.
checkActions
(
entry
);
if
(
result
==
-
1
)
throw
new
Exception
(
"Invalid action/instructions"
);
return
entry
;
...
...
@@ -601,52 +601,8 @@ public class StaticFlowEntries {
}
}
else
{
log
.
debug
(
"Got IP protocol of '{}' and tp-src of '{}' and tp-dst of '"
+
tpDstPort
+
"' via SFP REST API"
,
ipProto
,
tpSrcPort
);
}
checkActions
(
entry
);
}
return
entry
;
}
/**
* Validates actions/instructions
* @param Map containing the fields of the flow
* @return state indicating whether a flow is valid or not
*/
private
static
boolean
checkActions
(
Map
<
String
,
Object
>
entry
)
{
ip6
=
false
;
ip4
=
false
;
String
actions
=
null
;
if
(
entry
.
containsKey
(
StaticFlowEntryPusher
.
COLUMN_ACTIONS
)
||
entry
.
containsKey
(
StaticFlowEntryPusher
.
COLUMN_INSTR_APPLY_ACTIONS
)
||
entry
.
containsKey
(
StaticFlowEntryPusher
.
COLUMN_INSTR_WRITE_ACTIONS
))
{
if
(
entry
.
containsKey
(
StaticFlowEntryPusher
.
COLUMN_ACTIONS
))
{
actions
=
(
String
)
entry
.
get
(
StaticFlowEntryPusher
.
COLUMN_ACTIONS
);
}
else
if
(
entry
.
containsKey
(
StaticFlowEntryPusher
.
COLUMN_INSTR_APPLY_ACTIONS
))
{
actions
=
(
String
)
entry
.
get
(
StaticFlowEntryPusher
.
COLUMN_INSTR_APPLY_ACTIONS
);
}
else
if
(
entry
.
containsKey
(
StaticFlowEntryPusher
.
COLUMN_INSTR_WRITE_ACTIONS
))
{
actions
=
(
String
)
entry
.
get
(
StaticFlowEntryPusher
.
COLUMN_INSTR_WRITE_ACTIONS
);
}
if
(
actions
.
contains
(
MatchUtils
.
STR_ICMPV6_CODE
)
||
actions
.
contains
(
MatchUtils
.
STR_ICMPV6_TYPE
)
||
actions
.
contains
(
MatchUtils
.
STR_IPV6_DST
)
||
actions
.
contains
(
MatchUtils
.
STR_IPV6_SRC
)
||
actions
.
contains
(
MatchUtils
.
STR_IPV6_FLOW_LABEL
)
||
actions
.
contains
(
MatchUtils
.
STR_IPV6_ND_SSL
)
||
actions
.
contains
(
MatchUtils
.
STR_IPV6_ND_TARGET
)
||
actions
.
contains
(
MatchUtils
.
STR_IPV6_ND_TTL
))
{
ip6
=
true
;
}
if
(
actions
.
contains
(
MatchUtils
.
STR_NW_SRC
)
||
actions
.
contains
(
MatchUtils
.
STR_NW_DST
)
||
actions
.
contains
(
MatchUtils
.
STR_ARP_OPCODE
)
||
actions
.
contains
(
MatchUtils
.
STR_ARP_SHA
)
||
actions
.
contains
(
MatchUtils
.
STR_ARP_DHA
)
||
actions
.
contains
(
MatchUtils
.
STR_ARP_SPA
)
||
actions
.
contains
(
MatchUtils
.
STR_ARP_DPA
)
||
actions
.
contains
(
MatchUtils
.
STR_ICMP_CODE
)
||
actions
.
contains
(
MatchUtils
.
STR_ICMP_TYPE
))
{
ip4
=
true
;
}
}
if
(
ip6
==
true
&&
ip4
==
true
)
{
return
false
;
}
return
true
;
}
}
}
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