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
da9fd95c
Commit
da9fd95c
authored
9 years ago
by
Lei Xu
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'upstream/master'
parents
7255ba97
e4e9098d
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/forwarding/Forwarding.java
+13
-4
13 additions, 4 deletions
.../java/net/floodlightcontroller/forwarding/Forwarding.java
with
13 additions
and
4 deletions
src/main/java/net/floodlightcontroller/forwarding/Forwarding.java
+
13
−
4
View file @
da9fd95c
...
@@ -374,7 +374,7 @@ public class Forwarding extends ForwardingBase implements IFloodlightModule, IOF
...
@@ -374,7 +374,7 @@ public class Forwarding extends ForwardingBase implements IFloodlightModule, IOF
protected
void
doDropFlow
(
IOFSwitch
sw
,
OFPacketIn
pi
,
IRoutingDecision
decision
,
FloodlightContext
cntx
)
{
protected
void
doDropFlow
(
IOFSwitch
sw
,
OFPacketIn
pi
,
IRoutingDecision
decision
,
FloodlightContext
cntx
)
{
OFPort
inPort
=
OFMessageUtils
.
getInPort
(
pi
);
OFPort
inPort
=
OFMessageUtils
.
getInPort
(
pi
);
Match
m
=
createMatchFromPacket
(
sw
,
inPort
,
cntx
);
Match
m
=
createMatchFromPacket
(
sw
,
inPort
,
pi
,
cntx
);
OFFlowMod
.
Builder
fmb
=
sw
.
getOFFactory
().
buildFlowAdd
();
OFFlowMod
.
Builder
fmb
=
sw
.
getOFFactory
().
buildFlowAdd
();
List
<
OFAction
>
actions
=
new
ArrayList
<
OFAction
>();
// set no action to drop
List
<
OFAction
>
actions
=
new
ArrayList
<
OFAction
>();
// set no action to drop
U64
flowSetId
=
flowSetIdRegistry
.
generateFlowSetId
();
U64
flowSetId
=
flowSetIdRegistry
.
generateFlowSetId
();
...
@@ -485,7 +485,7 @@ public class Forwarding extends ForwardingBase implements IFloodlightModule, IOF
...
@@ -485,7 +485,7 @@ public class Forwarding extends ForwardingBase implements IFloodlightModule, IOF
dstAp
.
getNodeId
(),
dstAp
.
getNodeId
(),
dstAp
.
getPortId
());
dstAp
.
getPortId
());
Match
m
=
createMatchFromPacket
(
sw
,
srcPort
,
cntx
);
Match
m
=
createMatchFromPacket
(
sw
,
srcPort
,
pi
,
cntx
);
if
(
path
!=
null
)
{
if
(
path
!=
null
)
{
if
(
log
.
isDebugEnabled
())
{
if
(
log
.
isDebugEnabled
())
{
...
@@ -536,11 +536,20 @@ public class Forwarding extends ForwardingBase implements IFloodlightModule, IOF
...
@@ -536,11 +536,20 @@ public class Forwarding extends ForwardingBase implements IFloodlightModule, IOF
* @param cntx, the current context which contains the deserialized packet
* @param cntx, the current context which contains the deserialized packet
* @return a composed Match object based on the provided information
* @return a composed Match object based on the provided information
*/
*/
protected
Match
createMatchFromPacket
(
IOFSwitch
sw
,
OFPort
inPort
,
FloodlightContext
cntx
)
{
protected
Match
createMatchFromPacket
(
IOFSwitch
sw
,
OFPort
inPort
,
OFPacketIn
pi
,
FloodlightContext
cntx
)
{
// The packet in match will only contain the port number.
// The packet in match will only contain the port number.
// We need to add in specifics for the hosts we're routing between.
// We need to add in specifics for the hosts we're routing between.
Ethernet
eth
=
IFloodlightProviderService
.
bcStore
.
get
(
cntx
,
IFloodlightProviderService
.
CONTEXT_PI_PAYLOAD
);
Ethernet
eth
=
IFloodlightProviderService
.
bcStore
.
get
(
cntx
,
IFloodlightProviderService
.
CONTEXT_PI_PAYLOAD
);
VlanVid
vlan
=
VlanVid
.
ofVlan
(
eth
.
getVlanID
());
VlanVid
vlan
=
null
;
if
(
pi
.
getVersion
().
compareTo
(
OFVersion
.
OF_11
)
>
0
&&
/* 1.0 and 1.1 do not have a match */
pi
.
getMatch
().
get
(
MatchField
.
VLAN_VID
)
!=
null
)
{
vlan
=
pi
.
getMatch
().
get
(
MatchField
.
VLAN_VID
).
getVlanVid
();
/* VLAN may have been popped by switch */
}
if
(
vlan
==
null
)
{
vlan
=
VlanVid
.
ofVlan
(
eth
.
getVlanID
());
/* VLAN might still be in packet */
}
MacAddress
srcMac
=
eth
.
getSourceMACAddress
();
MacAddress
srcMac
=
eth
.
getSourceMACAddress
();
MacAddress
dstMac
=
eth
.
getDestinationMACAddress
();
MacAddress
dstMac
=
eth
.
getDestinationMACAddress
();
...
...
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