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
dbbaf6a2
Commit
dbbaf6a2
authored
10 years ago
by
sanjivininaikar
Browse files
Options
Downloads
Patches
Plain Diff
Update MatchUtils.java
parent
cc15d70b
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/util/MatchUtils.java
+30
-22
30 additions, 22 deletions
src/main/java/net/floodlightcontroller/util/MatchUtils.java
with
30 additions
and
22 deletions
src/main/java/net/floodlightcontroller/util/MatchUtils.java
+
30
−
22
View file @
dbbaf6a2
...
...
@@ -102,7 +102,7 @@ public class MatchUtils {
public
static
final
String
STR_TUNNEL_ID
=
"tunnel_id"
;
public
static
final
String
STR_PBB_ISID
=
"pbb_isid"
;
public
static
final
String
SET_FIELD_DELIM
=
"->"
;
/**
...
...
@@ -301,23 +301,23 @@ public class MatchUtils {
* <TD>VALUE
* </TR>
* <TR>
* <TD>"in_port"
,"input_port"
* <TD>"in_port"
* <TD>integer
* </TR>
* <TR>
* <TD>"
dl
_src", "
dl
_dst"
* <TD>"
eth
_src", "
eth
_dst"
* <TD>hex-string
* </TR>
* <TR>
* <TD>"
dl
_type", "
dl
_vlan", "
dl
_vlan_pcp"
* <TD>"
eth
_type", "
eth
_vlan
_vid
", "
eth
_vlan_pcp"
* <TD>integer
* </TR>
* <TR>
* <TD>"
nw
_src", "
nw
_dst"
* <TD>"
ipv4
_src", "
ipv4
_dst"
* <TD>CIDR-style netmask
* </TR>
* <TR>
* <TD>"tp_src","tp_dst"
* <TD>"tp_src","tp_dst"
, "tcp_src", "tcp_dst", "udp_src", "udp_dst", etc.
* <TD>integer (max 64k)
* </TR>
* </TABLE>
...
...
@@ -339,14 +339,14 @@ public class MatchUtils {
if
(
match
.
equals
(
""
)
||
match
.
equalsIgnoreCase
(
"any"
)
||
match
.
equalsIgnoreCase
(
"all"
)
||
match
.
equals
(
"[]"
))
{
match
=
"Match[]"
;
}
// Split into pairs of key=value
String
[]
tokens
=
match
.
split
(
"[\\[,\\]]"
);
int
initArg
=
0
;
if
(
tokens
[
0
].
equals
(
"Match"
))
{
initArg
=
1
;
}
// Split up key=value pairs into [key, value], and insert into array-deque
int
i
;
String
[]
tmp
;
...
...
@@ -361,15 +361,15 @@ public class MatchUtils {
}
Match
.
Builder
mb
=
OFFactories
.
getFactory
(
ofVersion
).
buildMatch
();
//sanjivini
//Determine if the OF version is 1.0 before adding a flow
if
(
ofVersion
.
equals
(
OFVersion
.
OF_10
))
{
ver10
=
true
;
}
//sanjivini
while
(!
llValues
.
isEmpty
())
{
IpProtocol
ipProto
=
null
;
String
[]
key_value
=
llValues
.
pollFirst
();
// pop off the first element; this completely removes it from the queue.
...
...
@@ -398,7 +398,7 @@ public class MatchUtils {
}
break
;
case
STR_DL_VLAN_PCP:
if
(
key_value
[
1
].
startsWith
(
"0x"
))
{
if
(
key_value
[
1
].
startsWith
(
"0x"
))
{
mb
.
setExact
(
MatchField
.
VLAN_PCP
,
VlanPcp
.
of
(
U8
.
t
(
Short
.
valueOf
(
key_value
[
1
].
replaceFirst
(
"0x"
,
""
),
16
))));
}
else
{
mb
.
setExact
(
MatchField
.
VLAN_PCP
,
VlanPcp
.
of
(
U8
.
t
(
Short
.
valueOf
(
key_value
[
1
]))));
...
...
@@ -414,23 +414,26 @@ public class MatchUtils {
//sanjivini
case
STR_IPV6_DST:
if
(
ver10
==
true
)
{
throw
new
Exception
(
"OF Version incompatible"
);
throw
new
IllegalArgumentException
(
"OF Version incompatible"
);
//throw new Exception("OF Version incompatible");
}
mb
.
setMasked
(
MatchField
.
IPV6_DST
,
IPv6AddressWithMask
.
of
(
key_value
[
1
]));
break
;
case
STR_IPV6_SRC:
if
(
ver10
==
true
)
{
throw
new
Exception
(
"OF Version incompatible"
);
throw
new
IllegalArgumentException
(
"OF Version incompatible"
);
//throw new Exception("OF Version incompatible");
}
mb
.
setMasked
(
MatchField
.
IPV6_SRC
,
IPv6AddressWithMask
.
of
(
key_value
[
1
]));
break
;
case
STR_IPV6_FLOW_LABEL:
if
(
ver10
==
true
)
{
throw
new
Exception
(
"OF Version incompatible"
);
throw
new
IllegalArgumentException
(
"OF Version incompatible"
);
//throw new Exception("OF Version incompatible");
}
mb
.
setExact
(
MatchField
.
IPV6_FLABEL
,
IPv6FlowLabel
.
of
(
Integer
.
parseInt
(
key_value
[
1
])));
break
;
//sanjivini
//sanjivini
case
STR_NW_PROTO:
if
(
key_value
[
1
].
startsWith
(
"0x"
))
{
...
...
@@ -544,35 +547,40 @@ public class MatchUtils {
//sanjivini
case
STR_ICMPV6_TYPE:
if
(
ver10
==
true
)
{
throw
new
Exception
(
"OF Version incompatible"
);
throw
new
IllegalArgumentException
(
"OF Version incompatible"
);
//throw new Exception("OF Version incompatible");
}
mb
.
setExact
(
MatchField
.
ICMPV6_TYPE
,
U8
.
of
(
Short
.
parseShort
(
key_value
[
1
])));
break
;
case
STR_ICMPV6_CODE:
if
(
ver10
==
true
)
{
throw
new
Exception
(
"OF Version incompatible"
);
throw
new
IllegalArgumentException
(
"OF Version incompatible"
);
//throw new Exception("OF Version incompatible");
}
mb
.
setExact
(
MatchField
.
ICMPV6_CODE
,
U8
.
of
(
Short
.
parseShort
(
key_value
[
1
])));
break
;
case
STR_IPV6_ND_SSL:
if
(
ver10
==
true
)
{
throw
new
Exception
(
"OF Version incompatible"
);
throw
new
IllegalArgumentException
(
"OF Version incompatible"
);
//throw new Exception("OF Version incompatible");
}
mb
.
setExact
(
MatchField
.
IPV6_ND_SLL
,
MacAddress
.
of
(
key_value
[
1
]));
break
;
case
STR_IPV6_ND_TTL:
if
(
ver10
==
true
)
{
throw
new
Exception
(
"OF Version incompatible"
);
throw
new
IllegalArgumentException
(
"OF Version incompatible"
);
//throw new Exception("OF Version incompatible");
}
mb
.
setExact
(
MatchField
.
IPV6_ND_TLL
,
MacAddress
.
of
(
key_value
[
1
]));
break
;
case
STR_IPV6_ND_TARGET:
if
(
ver10
==
true
)
{
throw
new
Exception
(
"OF Version incompatible"
);
throw
new
IllegalArgumentException
(
"OF Version incompatible"
);
//throw new Exception("OF Version incompatible");
}
mb
.
setExact
(
MatchField
.
IPV6_ND_TARGET
,
IPv6Address
.
of
(
key_value
[
1
]));
break
;
//sanjivini
//sanjivini
case
STR_ARP_OPCODE:
if
(
key_value
[
1
].
startsWith
(
"0x"
))
{
...
...
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