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
7c2a954f
Commit
7c2a954f
authored
12 years ago
by
Kanzhe Jiang
Browse files
Options
Downloads
Patches
Plain Diff
integrate with topo
parent
917e0a96
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/devicemanager/internal/DeviceManagerImpl.java
+32
-40
32 additions, 40 deletions
...tcontroller/devicemanager/internal/DeviceManagerImpl.java
with
32 additions
and
40 deletions
src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java
+
32
−
40
View file @
7c2a954f
...
...
@@ -673,14 +673,6 @@ public class DeviceManagerImpl implements
Map
<
String
,
String
>
removedControllerNodeIPs
)
{
// no-op
}
// **********************
// IFlowReconcileListener
// **********************
public
Command
reconcileFlows
(
ArrayList
<
OFMatchReconcile
>
ofmRcList
,
FloodlightContext
cntx
)
{
return
Command
.
CONTINUE
;
}
// ****************
// Internal methods
...
...
@@ -688,35 +680,35 @@ public class DeviceManagerImpl implements
protected
Command
processPacketInMessage
(
IOFSwitch
sw
,
OFPacketIn
pi
,
FloodlightContext
cntx
)
{
Ethernet
eth
=
IFloodlightProviderService
.
bcStore
.
get
(
cntx
,
IFloodlightProviderService
.
CONTEXT_PI_PAYLOAD
);
// Extract source entity information
Entity
srcEntity
=
getSourceEntityFromPacket
(
eth
,
sw
,
pi
.
getInPort
());
if
(
srcEntity
==
null
)
return
Command
.
STOP
;
// Learn/lookup device information
Device
srcDevice
=
learnDeviceByEntity
(
srcEntity
);
if
(
srcDevice
==
null
)
return
Command
.
STOP
;
// Store the source device in the context
fcStore
.
put
(
cntx
,
CONTEXT_SRC_DEVICE
,
srcDevice
);
// Find the device matching the destination from the entity
// classes of the source.
Entity
dstEntity
=
getDestEntityFromPacket
(
eth
);
if
(
dstEntity
!=
null
)
{
Device
dstDevice
=
findDestByEntity
(
srcDevice
,
dstEntity
);
if
(
dstDevice
!=
null
)
fcStore
.
put
(
cntx
,
CONTEXT_DST_DEVICE
,
dstDevice
);
}
return
Command
.
CONTINUE
;
Ethernet
eth
=
IFloodlightProviderService
.
bcStore
.
get
(
cntx
,
IFloodlightProviderService
.
CONTEXT_PI_PAYLOAD
);
// Extract source entity information
Entity
srcEntity
=
getSourceEntityFromPacket
(
eth
,
sw
.
getId
()
,
pi
.
getInPort
());
if
(
srcEntity
==
null
)
return
Command
.
STOP
;
// Learn/lookup device information
Device
srcDevice
=
learnDeviceByEntity
(
srcEntity
);
if
(
srcDevice
==
null
)
return
Command
.
STOP
;
// Store the source device in the context
fcStore
.
put
(
cntx
,
CONTEXT_SRC_DEVICE
,
srcDevice
);
// Find the device matching the destination from the entity
// classes of the source.
Entity
dstEntity
=
getDestEntityFromPacket
(
eth
);
if
(
dstEntity
!=
null
)
{
Device
dstDevice
=
findDestByEntity
(
srcDevice
,
dstEntity
);
if
(
dstDevice
!=
null
)
fcStore
.
put
(
cntx
,
CONTEXT_DST_DEVICE
,
dstDevice
);
}
return
Command
.
CONTINUE
;
}
/**
...
...
@@ -777,7 +769,7 @@ public class DeviceManagerImpl implements
* @return the entity from the packet
*/
private
Entity
getSourceEntityFromPacket
(
Ethernet
eth
,
IOFSwitch
sw
,
long
swdpid
,
int
port
)
{
byte
[]
dlAddrArr
=
eth
.
getSourceMACAddress
();
long
dlAddr
=
Ethernet
.
toLong
(
dlAddrArr
);
...
...
@@ -787,7 +779,7 @@ public class DeviceManagerImpl implements
return
null
;
boolean
learnap
=
true
;
if
(!
isValidAttachmentPoint
(
sw
.
getId
()
,
(
short
)
port
))
{
if
(!
isValidAttachmentPoint
(
sw
dpid
,
(
short
)
port
))
{
// If this is an internal port or we otherwise don't want
// to learn on these ports. In the future, we should
// handle this case by labeling flows with something that
...
...
@@ -802,7 +794,7 @@ public class DeviceManagerImpl implements
return
new
Entity
(
dlAddr
,
((
vlan
>=
0
)
?
vlan
:
null
),
((
nwSrc
!=
0
)
?
nwSrc
:
null
),
(
learnap
?
sw
.
getId
()
:
null
),
(
learnap
?
sw
dpid
:
null
),
(
learnap
?
port
:
null
),
new
Date
());
}
...
...
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