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
72a5a556
Commit
72a5a556
authored
10 years ago
by
sanjivininaikar
Browse files
Options
Downloads
Patches
Plain Diff
Update StaticFlowEntries.java
Bugs fixed
parent
b8f84411
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
+12
-9
12 additions, 9 deletions
...oodlightcontroller/staticflowentry/StaticFlowEntries.java
with
12 additions
and
9 deletions
src/main/java/net/floodlightcontroller/staticflowentry/StaticFlowEntries.java
+
12
−
9
View file @
72a5a556
...
...
@@ -24,7 +24,6 @@ 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
;
...
...
@@ -60,6 +59,9 @@ import org.projectfloodlight.openflow.types.U64;
public
class
StaticFlowEntries
{
protected
static
Logger
log
=
LoggerFactory
.
getLogger
(
StaticFlowEntries
.
class
);
private
static
final
int
INFINITE_TIMEOUT
=
0
;
public
static
boolean
ip6
=
false
;
public
static
boolean
ip4
=
false
;
/**
* This function generates a random hash for the bottom half of the cookie
...
...
@@ -341,7 +343,7 @@ public class StaticFlowEntries {
* @return The map of the storage entry
* @throws IOException If there was an error parsing the JSON
*/
public
static
Map
<
String
,
Object
>
jsonToStorageEntry
(
String
fmJson
)
throws
IOException
,
Exception
{
public
static
Map
<
String
,
Object
>
jsonToStorageEntry
(
String
fmJson
)
throws
IOException
{
Map
<
String
,
Object
>
entry
=
new
HashMap
<
String
,
Object
>();
MappingJsonFactory
f
=
new
MappingJsonFactory
();
JsonParser
jp
;
...
...
@@ -600,9 +602,7 @@ 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
);
}
if
(!(
checkActions
(
entry
)))
throw
new
Exception
(
"Invalid action/instructions"
);
checkActions
(
entry
);
return
entry
;
}
...
...
@@ -612,8 +612,11 @@ public class StaticFlowEntries {
* @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
))
{
...
...
@@ -630,17 +633,17 @@ public class StaticFlowEntries {
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
))
{
StaticFlowEntryPusherResource
.
ip6
=
true
;
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
))
{
StaticFlowEntryPusherResource
.
ip4
=
true
;
ip4
=
true
;
}
}
if
(
StaticFlowEntryPusherResource
.
ip
4
==
true
&&
StaticFlowEntryPusherResource
.
ip
6
==
true
)
{
if
(
ip
6
==
true
&&
ip
4
==
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