Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Jonathan Hart
2014-10-17 11:00:43 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
34bc61458e78d36c3a00d0ec81fb506af04b0853
34bc6145
1 parent
38b250d7
Added support for matching TCP ports and fixed flow stat IP address matching
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
6 deletions
providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowEntryBuilder.java
providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowModBuilder.java
providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowEntryBuilder.java
View file @
34bc614
...
...
@@ -223,7 +223,7 @@ public class FlowEntryBuilder {
if
(
di
.
isCidrMask
())
{
dip
=
IpPrefix
.
valueOf
(
di
.
getInt
(),
di
.
asCidrMaskLength
());
}
else
{
dip
=
IpPrefix
.
valueOf
(
di
.
getInt
());
dip
=
IpPrefix
.
valueOf
(
di
.
getInt
()
,
IpPrefix
.
MAX_INET_MASK
);
}
builder
.
matchIPDst
(
dip
);
break
;
...
...
@@ -233,7 +233,7 @@ public class FlowEntryBuilder {
if
(
si
.
isCidrMask
())
{
sip
=
IpPrefix
.
valueOf
(
si
.
getInt
(),
si
.
asCidrMaskLength
());
}
else
{
sip
=
IpPrefix
.
valueOf
(
si
.
getInt
());
sip
=
IpPrefix
.
valueOf
(
si
.
getInt
()
,
IpPrefix
.
MAX_INET_MASK
);
}
builder
.
matchIPSrc
(
sip
);
break
;
...
...
@@ -249,6 +249,12 @@ public class FlowEntryBuilder {
VlanId
vlanId
=
VlanId
.
vlanId
(
match
.
get
(
MatchField
.
VLAN_VID
).
getVlan
());
builder
.
matchVlanId
(
vlanId
);
break
;
case
TCP_DST:
builder
.
matchTcpDst
((
short
)
match
.
get
(
MatchField
.
TCP_DST
).
getPort
());
break
;
case
TCP_SRC:
builder
.
matchTcpSrc
((
short
)
match
.
get
(
MatchField
.
TCP_SRC
).
getPort
());
break
;
case
ARP_OP:
case
ARP_SHA:
case
ARP_SPA:
...
...
@@ -272,8 +278,6 @@ public class FlowEntryBuilder {
case
MPLS_TC:
case
SCTP_DST:
case
SCTP_SRC:
case
TCP_DST:
case
TCP_SRC:
case
TUNNEL_ID:
case
UDP_DST:
case
UDP_SRC:
...
...
providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowModBuilder.java
View file @
34bc614
...
...
@@ -15,6 +15,7 @@ import org.onlab.onos.net.flow.criteria.Criteria.EthTypeCriterion;
import
org.onlab.onos.net.flow.criteria.Criteria.IPCriterion
;
import
org.onlab.onos.net.flow.criteria.Criteria.IPProtocolCriterion
;
import
org.onlab.onos.net.flow.criteria.Criteria.PortCriterion
;
import
org.onlab.onos.net.flow.criteria.Criteria.TcpPortCriterion
;
import
org.onlab.onos.net.flow.criteria.Criteria.VlanIdCriterion
;
import
org.onlab.onos.net.flow.criteria.Criteria.VlanPcpCriterion
;
import
org.onlab.onos.net.flow.criteria.Criterion
;
...
...
@@ -42,6 +43,7 @@ import org.projectfloodlight.openflow.types.Masked;
import
org.projectfloodlight.openflow.types.OFBufferId
;
import
org.projectfloodlight.openflow.types.OFPort
;
import
org.projectfloodlight.openflow.types.OFVlanVidMatch
;
import
org.projectfloodlight.openflow.types.TransportPort
;
import
org.projectfloodlight.openflow.types.U64
;
import
org.projectfloodlight.openflow.types.VlanPcp
;
import
org.projectfloodlight.openflow.types.VlanVid
;
...
...
@@ -199,6 +201,7 @@ public class FlowModBuilder {
Match
.
Builder
mBuilder
=
factory
.
buildMatch
();
EthCriterion
eth
;
IPCriterion
ip
;
TcpPortCriterion
tp
;
for
(
Criterion
c
:
selector
.
criteria
())
{
switch
(
c
.
type
())
{
case
IN_PORT:
...
...
@@ -250,6 +253,14 @@ public class FlowModBuilder {
mBuilder
.
setExact
(
MatchField
.
VLAN_VID
,
OFVlanVidMatch
.
ofVlanVid
(
VlanVid
.
ofVlan
(
vid
.
vlanId
().
toShort
())));
break
;
case
TCP_DST:
tp
=
(
TcpPortCriterion
)
c
;
mBuilder
.
setExact
(
MatchField
.
TCP_DST
,
TransportPort
.
of
(
tp
.
tcpPort
()));
break
;
case
TCP_SRC:
tp
=
(
TcpPortCriterion
)
c
;
mBuilder
.
setExact
(
MatchField
.
TCP_SRC
,
TransportPort
.
of
(
tp
.
tcpPort
()));
break
;
case
ARP_OP:
case
ARP_SHA:
case
ARP_SPA:
...
...
@@ -276,8 +287,6 @@ public class FlowModBuilder {
case
PBB_ISID:
case
SCTP_DST:
case
SCTP_SRC:
case
TCP_DST:
case
TCP_SRC:
case
TUNNEL_ID:
case
UDP_DST:
case
UDP_SRC:
...
...
Please
register
or
login
to post a comment