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-10-18 01:38:11 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
32cc1c008091d504c6bc99bb015f2aaafe213ac0
32cc1c00
1 parent
a0e47543
Fix for creating IpPrefixes with wrong prefix length
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
providers/host/src/main/java/org/onlab/onos/provider/host/impl/HostLocationProvider.java
providers/host/src/main/java/org/onlab/onos/provider/host/impl/HostLocationProvider.java
View file @
32cc1c0
package
org
.
onlab
.
onos
.
provider
.
host
.
impl
;
import
static
org
.
slf4j
.
LoggerFactory
.
getLogger
;
import
org.apache.felix.scr.annotations.Activate
;
import
org.apache.felix.scr.annotations.Component
;
import
org.apache.felix.scr.annotations.Deactivate
;
...
...
@@ -21,16 +23,12 @@ import org.onlab.onos.net.provider.AbstractProvider;
import
org.onlab.onos.net.provider.ProviderId
;
import
org.onlab.onos.net.topology.Topology
;
import
org.onlab.onos.net.topology.TopologyService
;
import
org.onlab.packet.ARP
;
import
org.onlab.packet.Ethernet
;
import
org.onlab.packet.IpPrefix
;
import
org.onlab.packet.VlanId
;
import
org.slf4j.Logger
;
import
static
org
.
slf4j
.
LoggerFactory
.
getLogger
;
/**
* Provider which uses an OpenFlow controller to detect network
* end-station hosts.
...
...
@@ -106,7 +104,8 @@ public class HostLocationProvider extends AbstractProvider implements HostProvid
// Potentially a new or moved host
if
(
eth
.
getEtherType
()
==
Ethernet
.
TYPE_ARP
)
{
ARP
arp
=
(
ARP
)
eth
.
getPayload
();
IpPrefix
ip
=
IpPrefix
.
valueOf
(
arp
.
getSenderProtocolAddress
());
IpPrefix
ip
=
IpPrefix
.
valueOf
(
arp
.
getSenderProtocolAddress
(),
IpPrefix
.
MAX_INET_MASK
);
HostDescription
hdescr
=
new
DefaultHostDescription
(
eth
.
getSourceMAC
(),
vlan
,
hloc
,
ip
);
providerService
.
hostDetected
(
hid
,
hdescr
);
...
...
Please
register
or
login
to post a comment