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-09-23 11:13:42 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
43c182cb73952af02cfcfb6d6e3f4b6b9f1026ed
43c182cb
1 parent
ac60c089
Implemented storage for PortAddresses in HostStore
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
16 deletions
core/net/src/main/java/org/onlab/onos/net/host/impl/DefaultPortAddresses.java
core/net/src/main/java/org/onlab/onos/net/host/impl/HostManager.java
core/trivial/src/main/java/org/onlab/onos/net/trivial/impl/SimpleHostStore.java
core/net/src/main/java/org/onlab/onos/net/host/impl/DefaultPortAddresses.java
0 → 100644
View file @
43c182c
package
org
.
onlab
.
onos
.
net
.
host
.
impl
;
import
org.onlab.onos.net.ConnectPoint
;
import
org.onlab.onos.net.host.PortAddresses
;
import
org.onlab.packet.IpAddress
;
import
org.onlab.packet.MacAddress
;
public
class
DefaultPortAddresses
implements
PortAddresses
{
private
final
ConnectPoint
connectPoint
;
private
final
IpAddress
ipAddress
;
private
final
MacAddress
macAddress
;
public
DefaultPortAddresses
(
ConnectPoint
connectPoint
,
IpAddress
ip
,
MacAddress
mac
)
{
this
.
connectPoint
=
connectPoint
;
this
.
ipAddress
=
ip
;
this
.
macAddress
=
mac
;
}
@Override
public
ConnectPoint
connectPoint
()
{
return
connectPoint
;
}
@Override
public
IpAddress
ip
()
{
return
ipAddress
;
}
@Override
public
MacAddress
mac
()
{
return
macAddress
;
}
}
core/net/src/main/java/org/onlab/onos/net/host/impl/HostManager.java
View file @
43c182c
...
...
@@ -157,26 +157,22 @@ public class HostManager
@Override
public
void
bindAddressesToPort
(
IpAddress
ip
,
MacAddress
mac
,
ConnectPoint
connectPoint
)
{
// TODO Auto-generated method stub
store
.
updateAddressBindings
(
new
DefaultPortAddresses
(
connectPoint
,
ip
,
mac
));
}
@Override
public
void
unbindAddressesFromPort
(
ConnectPoint
connectPoint
)
{
// TODO Auto-generated method stub
store
.
removeAddressBindings
(
connectPoint
);
}
@Override
public
Set
<
PortAddresses
>
getAddressBindings
()
{
// TODO Auto-generated method stub
return
null
;
return
store
.
getAddressBindings
();
}
@Override
public
PortAddresses
getAddressBindingsForPort
(
ConnectPoint
connectPoint
)
{
// TODO Auto-generated method stub
return
null
;
return
store
.
getAddressBindingsForPort
(
connectPoint
);
}
// Personalized host provider service issued to the supplied provider.
...
...
core/trivial/src/main/java/org/onlab/onos/net/trivial/impl/SimpleHostStore.java
View file @
43c182c
...
...
@@ -51,6 +51,9 @@ public class SimpleHostStore implements HostStore {
// Hosts tracked by their location
private
final
Multimap
<
ConnectPoint
,
Host
>
locations
=
HashMultimap
.
create
();
private
final
Map
<
ConnectPoint
,
PortAddresses
>
portAddresses
=
new
ConcurrentHashMap
<>();
@Activate
public
void
activate
()
{
log
.
info
(
"Started"
);
...
...
@@ -195,26 +198,22 @@ public class SimpleHostStore implements HostStore {
@Override
public
void
updateAddressBindings
(
PortAddresses
addresses
)
{
// TODO Auto-generated method stub
portAddresses
.
put
(
addresses
.
connectPoint
(),
addresses
);
}
@Override
public
void
removeAddressBindings
(
ConnectPoint
connectPoint
)
{
// TODO Auto-generated method stub
portAddresses
.
remove
(
connectPoint
);
}
@Override
public
Set
<
PortAddresses
>
getAddressBindings
()
{
// TODO Auto-generated method stub
return
null
;
return
new
HashSet
<>(
portAddresses
.
values
());
}
@Override
public
PortAddresses
getAddressBindingsForPort
(
ConnectPoint
connectPoint
)
{
// TODO Auto-generated method stub
return
null
;
return
portAddresses
.
get
(
connectPoint
);
}
}
...
...
Please
register
or
login
to post a comment