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
d848660f
Commit
d848660f
authored
12 years ago
by
Gregor Maier
Browse files
Options
Downloads
Patches
Plain Diff
Fix indentation and add comments
[BSC-1838]
parent
e5415588
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
+38
-35
38 additions, 35 deletions
...tcontroller/devicemanager/internal/DeviceManagerImpl.java
with
38 additions
and
35 deletions
src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java
+
38
−
35
View file @
d848660f
...
...
@@ -408,43 +408,43 @@ IFlowReconcileListener, IInfoProvider, IHAListener {
IEntityClass
entityClass
=
reference
.
getEntityClass
();
ArrayList
<
Iterator
<
Device
>>
iterators
=
new
ArrayList
<
Iterator
<
Device
>>();
ClassState
classState
=
getClassState
(
entityClass
);
DeviceIndex
index
=
null
;
if
(
classState
.
secondaryIndexMap
.
size
()
>
0
)
{
EnumSet
<
DeviceField
>
keys
=
getEntityKeys
(
macAddress
,
vlan
,
ipv4Address
,
switchDPID
,
switchPort
);
index
=
classState
.
secondaryIndexMap
.
get
(
keys
);
}
Iterator
<
Device
>
iter
;
ClassState
classState
=
getClassState
(
entityClass
);
DeviceIndex
index
=
null
;
if
(
classState
.
secondaryIndexMap
.
size
()
>
0
)
{
EnumSet
<
DeviceField
>
keys
=
getEntityKeys
(
macAddress
,
vlan
,
ipv4Address
,
switchDPID
,
switchPort
);
index
=
classState
.
secondaryIndexMap
.
get
(
keys
);
}
Iterator
<
Device
>
iter
;
if
(
index
==
null
)
{
index
=
classState
.
classIndex
;
if
(
index
==
null
)
{
index
=
classState
.
classIndex
;
if
(
index
==
null
)
{
// scan all devices
return
new
DeviceIterator
(
deviceMap
.
values
().
iterator
(),
new
IEntityClass
[]
{
entityClass
},
macAddress
,
vlan
,
ipv4Address
,
switchDPID
,
switchPort
);
}
else
{
// scan the entire class
iter
=
new
DeviceIndexInterator
(
this
,
index
.
getAll
());
}
// scan all devices
return
new
DeviceIterator
(
deviceMap
.
values
().
iterator
(),
new
IEntityClass
[]
{
entityClass
},
macAddress
,
vlan
,
ipv4Address
,
switchDPID
,
switchPort
);
}
else
{
// index lookup
Entity
entity
=
new
Entity
((
macAddress
==
null
?
0
:
macAddress
),
vlan
,
ipv4Address
,
switchDPID
,
switchPort
,
null
);
iter
=
new
DeviceIndexInterator
(
this
,
index
.
queryByEntity
(
entity
));
// scan the entire class
iter
=
new
DeviceIndexInterator
(
this
,
index
.
getAll
());
}
iterators
.
add
(
iter
);
}
else
{
// index lookup
Entity
entity
=
new
Entity
((
macAddress
==
null
?
0
:
macAddress
),
vlan
,
ipv4Address
,
switchDPID
,
switchPort
,
null
);
iter
=
new
DeviceIndexInterator
(
this
,
index
.
queryByEntity
(
entity
));
}
iterators
.
add
(
iter
);
return
new
MultiIterator
<
Device
>(
iterators
.
iterator
());
}
...
...
@@ -779,7 +779,7 @@ IFlowReconcileListener, IInfoProvider, IHAListener {
boolean
learnap
=
true
;
if
(!
isValidAttachmentPoint
(
swdpid
,
(
short
)
port
))
{
// If this is an internal port or we otherwise don't want
//
FIXME:
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
// will give us the entity class. For now, we'll do our
...
...
@@ -1302,6 +1302,9 @@ IFlowReconcileListener, IInfoProvider, IHAListener {
Integer
ipv4Address
,
Long
switchDPID
,
Integer
switchPort
)
{
// FIXME: vlan==null is a valid search. Need to handle this
// case correctly. Note that the code will still work correctly.
// But we might do a full device search instead of using an index.
EnumSet
<
DeviceField
>
keys
=
EnumSet
.
noneOf
(
DeviceField
.
class
);
if
(
macAddress
!=
null
)
keys
.
add
(
DeviceField
.
MAC
);
if
(
vlan
!=
null
)
keys
.
add
(
DeviceField
.
VLAN
);
...
...
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