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
b8f84411
Commit
b8f84411
authored
10 years ago
by
sanjivininaikar
Browse files
Options
Downloads
Patches
Plain Diff
Update StaticFlowEntryPusherResource.java
parent
887f4b00
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
+20
-24
20 additions, 24 deletions
...er/staticflowentry/web/StaticFlowEntryPusherResource.java
with
20 additions
and
24 deletions
src/main/java/net/floodlightcontroller/staticflowentry/web/StaticFlowEntryPusherResource.java
+
20
−
24
View file @
b8f84411
...
...
@@ -40,9 +40,6 @@ import net.floodlightcontroller.storage.IStorageSourceService;
@LogMessageCategory
(
"Static Flow Pusher"
)
public
class
StaticFlowEntryPusherResource
extends
ServerResource
{
protected
static
Logger
log
=
LoggerFactory
.
getLogger
(
StaticFlowEntryPusherResource
.
class
);
public
static
boolean
ip6
=
false
;
public
static
boolean
ip4
=
false
;
/**
* Validates if all the mandatory fields are set properly while adding an IPv6 flow
...
...
@@ -52,7 +49,7 @@ public class StaticFlowEntryPusherResource extends ServerResource {
private
int
checkMatch
(
Map
<
String
,
Object
>
rows
)
{
//sanjivini
//Initializing flags
//
Declaring &
Initializing flags
int
state
=
0
;
boolean
dl_type
=
false
;
boolean
nw_proto
=
false
;
...
...
@@ -61,7 +58,9 @@ public class StaticFlowEntryPusherResource extends ServerResource {
boolean
icmp6_code
=
false
;
boolean
nd_target
=
false
;
boolean
nd_sll
=
false
;
boolean
nd_tll
=
false
;
boolean
nd_tll
=
false
;
boolean
ip6
=
false
;
boolean
ip4
=
false
;
String
eth_type
=
null
;
String
nw_protocol
=
null
;
...
...
@@ -70,8 +69,7 @@ public class StaticFlowEntryPusherResource extends ServerResource {
//Determine the dl_type if set
if
(
rows
.
containsKey
(
StaticFlowEntryPusher
.
COLUMN_DL_TYPE
))
{
dl_type
=
true
;
eth_type
=
(
String
)
rows
.
get
(
StaticFlowEntryPusher
.
COLUMN_DL_TYPE
);
System
.
out
.
println
(
"$$$$$$$$$$$$$SAN dl_type: "
+
eth_type
);
eth_type
=
(
String
)
rows
.
get
(
StaticFlowEntryPusher
.
COLUMN_DL_TYPE
);
if
(
eth_type
.
equalsIgnoreCase
(
"0x86dd"
)
||
eth_type
.
equals
(
"34525"
))
{
ip6
=
true
;
}
...
...
@@ -80,7 +78,7 @@ System.out.println("$$$$$$$$$$$$$SAN dl_type: " + eth_type);
ip4
=
true
;
}
else
{
state
=
2
;
state
=
2
;
return
state
;
}
}
...
...
@@ -135,13 +133,13 @@ System.out.println("$$$$$$$$$$$$$SAN dl_type: " + eth_type);
if
(
dl_type
==
true
)
{
if
(!(
ip4
==
true
||
ip6
==
true
))
{
//invalid dl_type
state
=
2
;
state
=
2
;
return
state
;
}
}
else
{
//dl_type not set
state
=
1
;
state
=
1
;
return
state
;
}
}
...
...
@@ -149,13 +147,13 @@ System.out.println("$$$$$$$$$$$$$SAN dl_type: " + eth_type);
if
(
nw_proto
==
true
)
{
if
(!(
nw_protocol
.
equals
(
"58"
)
||
nw_protocol
.
equalsIgnoreCase
(
"0x3A"
)))
{
//invalid nw_proto
state
=
4
;
state
=
4
;
return
state
;
}
}
else
{
//nw_proto not set
state
=
3
;
state
=
3
;
return
state
;
}
}
...
...
@@ -166,7 +164,7 @@ System.out.println("$$$$$$$$$$$$$SAN dl_type: " + eth_type);
if
(
nd_target
==
true
)
{
if
(!(
icmp_type
==
135
||
icmp_type
==
136
))
{
//invalid icmp6_type
state
=
6
;
state
=
6
;
return
state
;
}
}
...
...
@@ -174,7 +172,7 @@ System.out.println("$$$$$$$$$$$$$SAN dl_type: " + eth_type);
else
if
(
nd_tll
==
true
)
{
if
(!(
icmp_type
==
136
))
{
//invalid icmp6_type
state
=
6
;
state
=
6
;
return
state
;
}
}
...
...
@@ -182,21 +180,24 @@ System.out.println("$$$$$$$$$$$$$SAN dl_type: " + eth_type);
else
if
(
nd_sll
==
true
)
{
if
(!(
icmp_type
==
135
))
{
//invalid icmp6_type
state
=
6
;
state
=
6
;
return
state
;
}
}
}
else
{
//icmp6_type not set
state
=
5
;
state
=
5
;
return
state
;
}
}
if
(
ip4
==
true
&&
ip6
==
true
)
{
if
((
ip4
==
true
&&
ip6
==
true
)
||
(
StaticFlowEntries
.
ip4
==
true
&&
StaticFlowEntries
.
ip6
==
true
)
||
(
StaticFlowEntries
.
ip4
==
true
&&
ip6
==
true
)
||
(
StaticFlowEntries
.
ip6
==
true
&&
ip4
==
true
))
{
//ipv4 & ipv6 conflict
state
=
7
;
state
=
7
;
return
state
;
}
...
...
@@ -283,12 +284,7 @@ System.out.println("$$$$$$$$$$$$$SAN dl_type: " + eth_type);
}
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
(
Exception
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