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 14:54:58 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0e12fadd5b9b745e94ed25bd0654901e218313c6
0e12fadd
1 parent
23022f7b
Fixed issues with reading masked IP addresses from Loxi
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
8 deletions
apps/sdnip/src/main/java/org/onlab/onos/sdnip/Router.java
providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowEntryBuilder.java
apps/sdnip/src/main/java/org/onlab/onos/sdnip/Router.java
View file @
0e12fad
...
...
@@ -133,6 +133,10 @@ public class Router implements RouteListener {
*/
public
void
start
()
{
// TODO hack to enable SDN-IP now for testing
isElectedLeader
=
true
;
isActivatedLeader
=
true
;
bgpUpdatesExecutor
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
...
...
providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowEntryBuilder.java
View file @
0e12fad
...
...
@@ -35,6 +35,7 @@ import org.projectfloodlight.openflow.protocol.instruction.OFInstructionApplyAct
import
org.projectfloodlight.openflow.protocol.match.Match
;
import
org.projectfloodlight.openflow.protocol.match.MatchField
;
import
org.projectfloodlight.openflow.types.IPv4Address
;
import
org.projectfloodlight.openflow.types.Masked
;
import
org.slf4j.Logger
;
import
com.google.common.collect.Lists
;
...
...
@@ -218,23 +219,35 @@ public class FlowEntryBuilder {
builder
.
matchEthType
((
short
)
ethType
);
break
;
case
IPV4_DST:
IPv4Address
di
=
match
.
get
(
MatchField
.
IPV4_DST
);
IpPrefix
dip
;
if
(
di
.
isCidrMask
())
{
dip
=
IpPrefix
.
valueOf
(
di
.
getInt
(),
di
.
asCidrMaskLength
());
if
(
match
.
isPartiallyMasked
(
MatchField
.
IPV4_DST
))
{
Masked
<
IPv4Address
>
maskedIp
=
match
.
getMasked
(
MatchField
.
IPV4_DST
);
dip
=
IpPrefix
.
valueOf
(
maskedIp
.
getValue
().
getInt
(),
maskedIp
.
getMask
().
asCidrMaskLength
());
}
else
{
dip
=
IpPrefix
.
valueOf
(
di
.
getInt
(),
IpPrefix
.
MAX_INET_MASK
);
dip
=
IpPrefix
.
valueOf
(
match
.
get
(
MatchField
.
IPV4_DST
).
getInt
(),
IpPrefix
.
MAX_INET_MASK
);
}
builder
.
matchIPDst
(
dip
);
break
;
case
IPV4_SRC:
IPv4Address
si
=
match
.
get
(
MatchField
.
IPV4_SRC
);
IpPrefix
sip
;
if
(
si
.
isCidrMask
())
{
sip
=
IpPrefix
.
valueOf
(
si
.
getInt
(),
si
.
asCidrMaskLength
());
if
(
match
.
isPartiallyMasked
(
MatchField
.
IPV4_SRC
))
{
Masked
<
IPv4Address
>
maskedIp
=
match
.
getMasked
(
MatchField
.
IPV4_SRC
);
sip
=
IpPrefix
.
valueOf
(
maskedIp
.
getValue
().
getInt
(),
maskedIp
.
getMask
().
asCidrMaskLength
());
}
else
{
sip
=
IpPrefix
.
valueOf
(
si
.
getInt
(),
IpPrefix
.
MAX_INET_MASK
);
sip
=
IpPrefix
.
valueOf
(
match
.
get
(
MatchField
.
IPV4_SRC
).
getInt
(),
IpPrefix
.
MAX_INET_MASK
);
}
builder
.
matchIPSrc
(
sip
);
break
;
case
IP_PROTO:
...
...
Please
register
or
login
to post a comment