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
tom
2014-09-23 11:24:33 -0700
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
f9cd5cb51bd136c15d590aebdfdecff473c3b892
f9cd5cb5
2 parents
0872a174
43c182cb
Merge remote-tracking branch 'origin/master'
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 @
f9cd5cb
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 @
f9cd5cb
...
...
@@ -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 @
f9cd5cb
...
...
@@ -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