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
Ayaka Koshibe
2014-09-25 15:43:04 -0700
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
6e89e1b0548f5ea8b78faf94cd1b74e3f2887937
6e89e1b0
2 parents
b70d34b8
5e3cc583
Merge branch 'master' of
ssh://gerrit.onlab.us:29418/onos-next
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
287 additions
and
33 deletions
cli/src/main/java/org/onlab/onos/cli/net/FlowsListCommand.java
cli/src/main/java/org/onlab/onos/cli/net/HostIdCompleter.java
cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml
core/api/src/main/java/org/onlab/onos/net/flow/criteria/Criteria.java
core/api/src/main/java/org/onlab/onos/net/flow/instructions/Instructions.java
core/api/src/main/java/org/onlab/onos/net/flow/instructions/L2ModificationInstruction.java
core/api/src/main/java/org/onlab/onos/net/flow/instructions/L3ModificationInstruction.java
core/api/src/main/java/org/onlab/onos/store/Timestamp.java
core/net/src/main/java/org/onlab/onos/net/flow/impl/FlowRuleManager.java
core/store/src/main/java/org/onlab/onos/store/impl/OnosTimestamp.java
core/store/src/main/java/org/onlab/onos/store/impl/StoreManager.java
core/store/src/main/java/org/onlab/onos/store/serializers/DefaultPortSerializer.java
core/store/src/main/java/org/onlab/onos/store/serializers/DeviceIdSerializer.java
core/store/src/main/java/org/onlab/onos/store/serializers/IpPrefixSerializer.java
core/store/src/main/java/org/onlab/onos/store/serializers/OnosTimestampSerializer.java
core/store/src/main/java/org/onlab/onos/store/serializers/PortNumberSerializer.java
core/store/src/main/java/org/onlab/onos/store/serializers/ProviderIdSerializer.java
providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowModBuilder.java
cli/src/main/java/org/onlab/onos/cli/net/FlowsListCommand.java
View file @
6e89e1b
package
org
.
onlab
.
onos
.
cli
.
net
;
import
com.google.common.collect.Maps
;
import
static
com
.
google
.
common
.
collect
.
Lists
.
newArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.karaf.shell.commands.Argument
;
import
org.apache.karaf.shell.commands.Command
;
import
org.onlab.onos.cli.AbstractShellCommand
;
import
org.onlab.onos.net.Device
;
import
org.onlab.onos.net.DeviceId
;
import
org.onlab.onos.net.device.DeviceService
;
import
org.onlab.onos.net.flow.FlowRule
;
import
org.onlab.onos.net.flow.FlowRuleService
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
google
.
common
.
collect
.
Lists
.
newArrayList
;
import
com.google.common.collect.Maps
;
/**
* Lists all currently-known hosts.
...
...
@@ -22,14 +25,20 @@ description = "Lists all currently-known flows.")
public
class
FlowsListCommand
extends
AbstractShellCommand
{
private
static
final
String
FMT
=
" id=%s, selector=%s, treatment=%s, state=%s"
;
" id=%s, state=%s, bytes=%s, packets=%s, duration=%s, priority=%s"
;
private
static
final
String
TFMT
=
" treatment=%s"
;
private
static
final
String
SFMT
=
" selector=%s"
;
@Argument
(
index
=
0
,
name
=
"uri"
,
description
=
"Device ID"
,
required
=
false
,
multiValued
=
false
)
String
uri
=
null
;
@Override
protected
void
execute
()
{
DeviceService
deviceService
=
get
(
DeviceService
.
class
);
FlowRuleService
service
=
get
(
FlowRuleService
.
class
);
Map
<
Device
,
List
<
FlowRule
>>
flows
=
getSortedFlows
(
deviceService
,
service
);
for
(
Device
d
:
deviceService
.
getDevices
())
{
for
(
Device
d
:
flows
.
keySet
())
{
printFlows
(
d
,
flows
.
get
(
d
));
}
}
...
...
@@ -42,8 +51,10 @@ public class FlowsListCommand extends AbstractShellCommand {
*/
protected
Map
<
Device
,
List
<
FlowRule
>>
getSortedFlows
(
DeviceService
deviceService
,
FlowRuleService
service
)
{
Map
<
Device
,
List
<
FlowRule
>>
flows
=
Maps
.
newHashMap
();
List
<
FlowRule
>
rules
;
for
(
Device
d
:
deviceService
.
getDevices
())
{
List
<
FlowRule
>
rules
=
newArrayList
();
Iterable
<
Device
>
devices
=
uri
==
null
?
deviceService
.
getDevices
()
:
Collections
.
singletonList
(
deviceService
.
getDevice
(
DeviceId
.
deviceId
(
uri
)));
for
(
Device
d
:
devices
)
{
rules
=
newArrayList
(
service
.
getFlowEntries
(
d
.
id
()));
Collections
.
sort
(
rules
,
Comparators
.
FLOW_RULE_COMPARATOR
);
flows
.
put
(
d
,
rules
);
...
...
@@ -58,8 +69,15 @@ public class FlowsListCommand extends AbstractShellCommand {
*/
protected
void
printFlows
(
Device
d
,
List
<
FlowRule
>
flows
)
{
print
(
"Device: "
+
d
.
id
());
if
(
flows
==
null
|
flows
.
isEmpty
())
{
print
(
" %s"
,
"No flows installed."
);
return
;
}
for
(
FlowRule
f
:
flows
)
{
print
(
FMT
,
f
.
id
().
value
(),
f
.
selector
(),
f
.
treatment
(),
f
.
state
());
print
(
FMT
,
Long
.
toHexString
(
f
.
id
().
value
()),
f
.
state
(),
f
.
bytes
(),
f
.
packets
(),
f
.
lifeMillis
(),
f
.
priority
());
print
(
SFMT
,
f
.
selector
().
criteria
());
print
(
TFMT
,
f
.
treatment
().
instructions
());
}
}
...
...
cli/src/main/java/org/onlab/onos/cli/net/HostIdCompleter.java
View file @
6e89e1b
package
org
.
onlab
.
onos
.
cli
.
net
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.SortedSet
;
import
org.apache.karaf.shell.console.Completer
;
import
org.apache.karaf.shell.console.completer.StringsCompleter
;
import
org.onlab.onos.cli.AbstractShellCommand
;
import
org.onlab.onos.net.Host
;
import
org.onlab.onos.net.host.HostService
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.SortedSet
;
public
class
HostIdCompleter
implements
Completer
{
@Override
...
...
cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml
View file @
6e89e1b
...
...
@@ -72,6 +72,9 @@
<command>
<action
class=
"org.onlab.onos.cli.net.FlowsListCommand"
/>
<completers>
<ref
component-id=
"deviceIdCompleter"
/>
</completers>
</command>
<command>
...
...
core/api/src/main/java/org/onlab/onos/net/flow/criteria/Criteria.java
View file @
6e89e1b
package
org
.
onlab
.
onos
.
net
.
flow
.
criteria
;
import
static
com
.
google
.
common
.
base
.
MoreObjects
.
toStringHelper
;
import
org.onlab.onos.net.PortNumber
;
import
org.onlab.onos.net.flow.criteria.Criterion.Type
;
import
org.onlab.packet.IpPrefix
;
...
...
@@ -129,6 +131,12 @@ public final class Criteria {
public
PortNumber
port
()
{
return
this
.
port
;
}
@Override
public
String
toString
()
{
return
toStringHelper
(
type
().
toString
())
.
add
(
"port"
,
port
).
toString
();
}
}
...
...
@@ -149,6 +157,13 @@ public final class Criteria {
public
MacAddress
mac
()
{
return
this
.
mac
;
}
@Override
public
String
toString
()
{
return
toStringHelper
(
type
().
toString
())
.
add
(
"mac"
,
mac
).
toString
();
}
}
public
static
final
class
EthTypeCriterion
implements
Criterion
{
...
...
@@ -168,6 +183,12 @@ public final class Criteria {
return
ethType
;
}
@Override
public
String
toString
()
{
return
toStringHelper
(
type
().
toString
())
.
add
(
"ethType"
,
Long
.
toHexString
(
ethType
)).
toString
();
}
}
...
...
@@ -190,6 +211,11 @@ public final class Criteria {
return
this
.
ip
;
}
@Override
public
String
toString
()
{
return
toStringHelper
(
type
().
toString
())
.
add
(
"ip"
,
ip
).
toString
();
}
}
...
...
@@ -211,6 +237,12 @@ public final class Criteria {
return
proto
;
}
@Override
public
String
toString
()
{
return
toStringHelper
(
type
().
toString
())
.
add
(
"protocol"
,
Long
.
toHexString
(
proto
)).
toString
();
}
}
...
...
@@ -231,6 +263,12 @@ public final class Criteria {
return
vlanPcp
;
}
@Override
public
String
toString
()
{
return
toStringHelper
(
type
().
toString
())
.
add
(
"pcp"
,
Long
.
toHexString
(
vlanPcp
)).
toString
();
}
}
...
...
@@ -252,6 +290,12 @@ public final class Criteria {
return
vlanId
;
}
@Override
public
String
toString
()
{
return
toStringHelper
(
type
().
toString
())
.
add
(
"id"
,
vlanId
).
toString
();
}
}
...
...
core/api/src/main/java/org/onlab/onos/net/flow/instructions/Instructions.java
View file @
6e89e1b
package
org
.
onlab
.
onos
.
net
.
flow
.
instructions
;
import
static
com
.
google
.
common
.
base
.
MoreObjects
.
toStringHelper
;
import
static
com
.
google
.
common
.
base
.
Preconditions
.
checkNotNull
;
import
org.onlab.onos.net.PortNumber
;
...
...
@@ -47,7 +48,7 @@ public final class Instructions {
*/
public
static
L2ModificationInstruction
modL2Src
(
MacAddress
addr
)
{
checkNotNull
(
addr
,
"Src l2 address cannot be null"
);
return
new
ModEtherInstruction
(
L2SubType
.
L2
_SRC
,
addr
);
return
new
ModEtherInstruction
(
L2SubType
.
ETH
_SRC
,
addr
);
}
/**
...
...
@@ -57,7 +58,7 @@ public final class Instructions {
*/
public
static
L2ModificationInstruction
modL2Dst
(
MacAddress
addr
)
{
checkNotNull
(
addr
,
"Dst l2 address cannot be null"
);
return
new
L2ModificationInstruction
.
ModEtherInstruction
(
L2SubType
.
L2
_DST
,
addr
);
return
new
L2ModificationInstruction
.
ModEtherInstruction
(
L2SubType
.
ETH
_DST
,
addr
);
}
/**
...
...
@@ -87,7 +88,7 @@ public final class Instructions {
*/
public
static
L3ModificationInstruction
modL3Src
(
IpPrefix
addr
)
{
checkNotNull
(
addr
,
"Src l3 address cannot be null"
);
return
new
ModIPInstruction
(
L3SubType
.
L3
_SRC
,
addr
);
return
new
ModIPInstruction
(
L3SubType
.
IP
_SRC
,
addr
);
}
/**
...
...
@@ -97,7 +98,7 @@ public final class Instructions {
*/
public
static
L3ModificationInstruction
modL3Dst
(
IpPrefix
addr
)
{
checkNotNull
(
addr
,
"Dst l3 address cannot be null"
);
return
new
ModIPInstruction
(
L3SubType
.
L3
_DST
,
addr
);
return
new
ModIPInstruction
(
L3SubType
.
IP
_DST
,
addr
);
}
...
...
@@ -110,6 +111,12 @@ public final class Instructions {
public
Type
type
()
{
return
Type
.
DROP
;
}
@Override
public
String
toString
()
{
return
toStringHelper
(
type
()).
toString
();
}
}
...
...
@@ -128,6 +135,11 @@ public final class Instructions {
public
Type
type
()
{
return
Type
.
OUTPUT
;
}
@Override
public
String
toString
()
{
return
toStringHelper
(
type
().
toString
())
.
add
(
"port"
,
port
).
toString
();
}
}
}
...
...
core/api/src/main/java/org/onlab/onos/net/flow/instructions/L2ModificationInstruction.java
View file @
6e89e1b
package
org
.
onlab
.
onos
.
net
.
flow
.
instructions
;
import
static
com
.
google
.
common
.
base
.
MoreObjects
.
toStringHelper
;
import
org.onlab.packet.MacAddress
;
import
org.onlab.packet.VlanId
;
...
...
@@ -15,12 +17,12 @@ public abstract class L2ModificationInstruction implements Instruction {
/**
* Ether src modification.
*/
L2
_SRC
,
ETH
_SRC
,
/**
* Ether dst modification.
*/
L2
_DST
,
ETH
_DST
,
/**
* VLAN id modification.
...
...
@@ -66,6 +68,13 @@ public abstract class L2ModificationInstruction implements Instruction {
return
this
.
mac
;
}
@Override
public
String
toString
()
{
return
toStringHelper
(
subtype
().
toString
())
.
add
(
"mac"
,
mac
).
toString
();
}
}
/**
...
...
@@ -88,6 +97,12 @@ public abstract class L2ModificationInstruction implements Instruction {
return
this
.
vlanId
;
}
@Override
public
String
toString
()
{
return
toStringHelper
(
subtype
().
toString
())
.
add
(
"id"
,
vlanId
).
toString
();
}
}
/**
...
...
@@ -110,6 +125,12 @@ public abstract class L2ModificationInstruction implements Instruction {
return
this
.
vlanPcp
;
}
@Override
public
String
toString
()
{
return
toStringHelper
(
subtype
().
toString
())
.
add
(
"pcp"
,
Long
.
toHexString
(
vlanPcp
)).
toString
();
}
}
...
...
core/api/src/main/java/org/onlab/onos/net/flow/instructions/L3ModificationInstruction.java
View file @
6e89e1b
package
org
.
onlab
.
onos
.
net
.
flow
.
instructions
;
import
static
com
.
google
.
common
.
base
.
MoreObjects
.
toStringHelper
;
import
org.onlab.packet.IpPrefix
;
/**
...
...
@@ -14,12 +16,12 @@ public abstract class L3ModificationInstruction implements Instruction {
/**
* Ether src modification.
*/
L3
_SRC
,
IP
_SRC
,
/**
* Ether dst modification.
*/
L3
_DST
IP
_DST
//TODO: remaining types
}
...
...
@@ -58,5 +60,11 @@ public abstract class L3ModificationInstruction implements Instruction {
return
this
.
ip
;
}
@Override
public
String
toString
()
{
return
toStringHelper
(
subtype
().
toString
())
.
add
(
"ip"
,
ip
).
toString
();
}
}
}
...
...
core/api/src/main/java/org/onlab/onos/store/Timestamp.java
0 → 100644
View file @
6e89e1b
package
org
.
onlab
.
onos
.
store
;
/**
* Opaque version structure.
*/
public
interface
Timestamp
extends
Comparable
<
Timestamp
>
{
}
core/net/src/main/java/org/onlab/onos/net/flow/impl/FlowRuleManager.java
View file @
6e89e1b
...
...
@@ -252,7 +252,6 @@ implements FlowRuleService, FlowRuleProviderRegistry {
}
}
for
(
FlowRule
rule
:
storedRules
)
{
log
.
info
(
"missing rule is {}"
,
rule
);
// there are rules in the store that aren't on the switch
flowMissing
(
rule
);
...
...
core/store/src/main/java/org/onlab/onos/store/impl/OnosTimestamp.java
0 → 100644
View file @
6e89e1b
package
org
.
onlab
.
onos
.
store
.
impl
;
import
static
com
.
google
.
common
.
base
.
Preconditions
.
checkNotNull
;
import
static
com
.
google
.
common
.
base
.
Preconditions
.
checkArgument
;
import
java.util.Objects
;
import
org.onlab.onos.net.ElementId
;
import
org.onlab.onos.store.Timestamp
;
import
com.google.common.base.MoreObjects
;
import
com.google.common.collect.ComparisonChain
;
// If it is store specific, implement serializable interfaces?
/**
* Default implementation of Timestamp.
*/
public
final
class
OnosTimestamp
implements
Timestamp
{
private
final
ElementId
id
;
private
final
int
termNumber
;
private
final
int
sequenceNumber
;
/**
* Default version tuple.
*
* @param id identifier of the element
* @param termNumber the mastership termNumber
* @param sequenceNumber the sequenceNumber number within the termNumber
*/
public
OnosTimestamp
(
ElementId
id
,
int
termNumber
,
int
sequenceNumber
)
{
this
.
id
=
checkNotNull
(
id
);
this
.
termNumber
=
termNumber
;
this
.
sequenceNumber
=
sequenceNumber
;
}
@Override
public
int
compareTo
(
Timestamp
o
)
{
checkArgument
(
o
instanceof
OnosTimestamp
,
"Must be OnosTimestamp"
,
o
);
OnosTimestamp
that
=
(
OnosTimestamp
)
o
;
checkArgument
(
this
.
id
.
equals
(
that
.
id
),
"Cannot compare version for different element this:%s, that:%s"
,
this
,
that
);
return
ComparisonChain
.
start
()
.
compare
(
this
.
termNumber
,
that
.
termNumber
)
.
compare
(
this
.
sequenceNumber
,
that
.
sequenceNumber
)
.
result
();
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
id
,
termNumber
,
sequenceNumber
);
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
obj
)
{
return
true
;
}
if
(!(
obj
instanceof
OnosTimestamp
))
{
return
false
;
}
OnosTimestamp
that
=
(
OnosTimestamp
)
obj
;
return
Objects
.
equals
(
this
.
id
,
that
.
id
)
&&
Objects
.
equals
(
this
.
termNumber
,
that
.
termNumber
)
&&
Objects
.
equals
(
this
.
sequenceNumber
,
that
.
sequenceNumber
);
}
@Override
public
String
toString
()
{
return
MoreObjects
.
toStringHelper
(
getClass
())
.
add
(
"id"
,
id
)
.
add
(
"termNumber"
,
termNumber
)
.
add
(
"sequenceNumber"
,
sequenceNumber
)
.
toString
();
}
/**
* Returns the element.
*
* @return element identifier
*/
public
ElementId
id
()
{
return
id
;
}
/**
* Returns the termNumber.
*
* @return termNumber
*/
public
int
termNumber
()
{
return
termNumber
;
}
/**
* Returns the sequenceNumber number.
*
* @return sequenceNumber
*/
public
int
sequenceNumber
()
{
return
sequenceNumber
;
}
}
core/store/src/main/java/org/onlab/onos/store/impl/StoreManager.java
View file @
6e89e1b
...
...
@@ -4,7 +4,9 @@ import com.hazelcast.config.Config;
import
com.hazelcast.config.FileSystemXmlConfig
;
import
com.hazelcast.core.Hazelcast
;
import
com.hazelcast.core.HazelcastInstance
;
import
de.javakaffee.kryoserializers.URISerializer
;
import
org.apache.felix.scr.annotations.Activate
;
import
org.apache.felix.scr.annotations.Component
;
import
org.apache.felix.scr.annotations.Deactivate
;
...
...
@@ -26,6 +28,7 @@ import org.onlab.onos.store.serializers.DefaultPortSerializer;
import
org.onlab.onos.store.serializers.DeviceIdSerializer
;
import
org.onlab.onos.store.serializers.IpPrefixSerializer
;
import
org.onlab.onos.store.serializers.NodeIdSerializer
;
import
org.onlab.onos.store.serializers.OnosTimestampSerializer
;
import
org.onlab.onos.store.serializers.PortNumberSerializer
;
import
org.onlab.onos.store.serializers.ProviderIdSerializer
;
import
org.onlab.packet.IpPrefix
;
...
...
@@ -90,6 +93,7 @@ public class StoreManager implements StoreService {
.
register
(
DeviceId
.
class
,
new
DeviceIdSerializer
())
.
register
(
PortNumber
.
class
,
new
PortNumberSerializer
())
.
register
(
DefaultPort
.
class
,
new
DefaultPortSerializer
())
.
register
(
OnosTimestamp
.
class
,
new
OnosTimestampSerializer
())
.
build
()
.
populate
(
10
);
}
...
...
core/store/src/main/java/org/onlab/onos/store/serializers/DefaultPortSerializer.java
View file @
6e89e1b
...
...
@@ -9,7 +9,6 @@ import com.esotericsoftware.kryo.Serializer;
import
com.esotericsoftware.kryo.io.Input
;
import
com.esotericsoftware.kryo.io.Output
;
// TODO move to util, etc.
/**
* Kryo Serializer for {@link DefaultPort}.
*/
...
...
core/store/src/main/java/org/onlab/onos/store/serializers/DeviceIdSerializer.java
View file @
6e89e1b
...
...
@@ -9,7 +9,6 @@ import com.esotericsoftware.kryo.Serializer;
import
com.esotericsoftware.kryo.io.Input
;
import
com.esotericsoftware.kryo.io.Output
;
//TODO move to util, etc.
/**
* Kryo Serializer for {@link DeviceId}.
*/
...
...
core/store/src/main/java/org/onlab/onos/store/serializers/IpPrefixSerializer.java
View file @
6e89e1b
...
...
@@ -7,7 +7,6 @@ import com.esotericsoftware.kryo.Serializer;
import
com.esotericsoftware.kryo.io.Input
;
import
com.esotericsoftware.kryo.io.Output
;
// TODO move to util, etc.
/**
* Kryo Serializer for {@link IpPrefix}.
*/
...
...
core/store/src/main/java/org/onlab/onos/store/serializers/OnosTimestampSerializer.java
0 → 100644
View file @
6e89e1b
package
org
.
onlab
.
onos
.
store
.
serializers
;
import
org.onlab.onos.net.ElementId
;
import
org.onlab.onos.store.impl.OnosTimestamp
;
import
com.esotericsoftware.kryo.Kryo
;
import
com.esotericsoftware.kryo.Serializer
;
import
com.esotericsoftware.kryo.io.Input
;
import
com.esotericsoftware.kryo.io.Output
;
/**
* Kryo Serializer for {@link OnosTimestamp}.
*/
public
class
OnosTimestampSerializer
extends
Serializer
<
OnosTimestamp
>
{
/**
* Default constructor.
*/
public
OnosTimestampSerializer
()
{
// non-null, immutable
super
(
false
,
true
);
}
@Override
public
void
write
(
Kryo
kryo
,
Output
output
,
OnosTimestamp
object
)
{
kryo
.
writeClassAndObject
(
output
,
object
.
id
());
output
.
writeInt
(
object
.
termNumber
());
output
.
writeInt
(
object
.
sequenceNumber
());
}
@Override
public
OnosTimestamp
read
(
Kryo
kryo
,
Input
input
,
Class
<
OnosTimestamp
>
type
)
{
ElementId
id
=
(
ElementId
)
kryo
.
readClassAndObject
(
input
);
final
int
term
=
input
.
readInt
();
final
int
sequence
=
input
.
readInt
();
return
new
OnosTimestamp
(
id
,
term
,
sequence
);
}
}
core/store/src/main/java/org/onlab/onos/store/serializers/PortNumberSerializer.java
View file @
6e89e1b
...
...
@@ -7,7 +7,6 @@ import com.esotericsoftware.kryo.Serializer;
import
com.esotericsoftware.kryo.io.Input
;
import
com.esotericsoftware.kryo.io.Output
;
// TODO move to util, etc.
/**
* Serializer for {@link PortNumber}.
*/
...
...
core/store/src/main/java/org/onlab/onos/store/serializers/ProviderIdSerializer.java
View file @
6e89e1b
...
...
@@ -7,7 +7,6 @@ import com.esotericsoftware.kryo.Serializer;
import
com.esotericsoftware.kryo.io.Input
;
import
com.esotericsoftware.kryo.io.Output
;
//TODO move to util, etc.
/**
* Serializer for {@link ProviderId}.
*/
...
...
providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowModBuilder.java
View file @
6e89e1b
...
...
@@ -133,10 +133,10 @@ public class FlowModBuilder {
L3ModificationInstruction
l3m
=
(
L3ModificationInstruction
)
i
;
ModIPInstruction
ip
;
switch
(
l3m
.
subtype
())
{
case
L3
_DST:
case
IP
_DST:
ip
=
(
ModIPInstruction
)
i
;
return
factory
.
actions
().
setNwDst
(
IPv4Address
.
of
(
ip
.
ip
().
toInt
()));
case
L3
_SRC:
case
IP
_SRC:
ip
=
(
ModIPInstruction
)
i
;
return
factory
.
actions
().
setNwSrc
(
IPv4Address
.
of
(
ip
.
ip
().
toInt
()));
default
:
...
...
@@ -150,10 +150,10 @@ public class FlowModBuilder {
L2ModificationInstruction
l2m
=
(
L2ModificationInstruction
)
i
;
ModEtherInstruction
eth
;
switch
(
l2m
.
subtype
())
{
case
L2
_DST:
case
ETH
_DST:
eth
=
(
ModEtherInstruction
)
l2m
;
return
factory
.
actions
().
setDlDst
(
MacAddress
.
of
(
eth
.
mac
().
toLong
()));
case
L2
_SRC:
case
ETH
_SRC:
eth
=
(
ModEtherInstruction
)
l2m
;
return
factory
.
actions
().
setDlSrc
(
MacAddress
.
of
(
eth
.
mac
().
toLong
()));
case
VLAN_ID:
...
...
Please
register
or
login
to post a comment