use of org.opendaylight.lispflowmapping.neutron.mappingmanager.PortData in project lispflowmapping by opendaylight.
the class PortDataProcessor method update.
@Override
public void update(Port port) {
final String hostId = port.getAugmentation(PortBindingExtension.class).getHostId();
if (hostId == null) {
LOG.error("Updating port to lisp mapping service failed. Port does not have a HostID. Port: {}", port.toString());
return;
}
List<FixedIps> fixedIPs = port.getFixedIps();
if (fixedIPs != null && fixedIPs.size() > 0) {
Eid eidAddress;
for (FixedIps ip : fixedIPs) {
eidAddress = getEid(port, ip);
PortData portData = new PortData(port.getUuid().getValue(), eidAddress);
hostInformationManager.addHostRelatedInfo(hostId, portData);
}
}
LOG.info("Neutron Port updated: Port name: " + port.getName() + " Port Fixed IP: " + (port.getFixedIps() != null ? port.getFixedIps().get(0) : "No Fixed IP assigned"));
LOG.debug("Neutron Port Updated : " + port.toString());
}
use of org.opendaylight.lispflowmapping.neutron.mappingmanager.PortData in project lispflowmapping by opendaylight.
the class PortDataProcessor method create.
@Override
public void create(Port port) {
// TODO Consider adding Port MAC -> Port fixed IP in MS
// host_ip exists in MS
LOG.debug("Neutron Port Created : " + port.toString());
final String hostId = port.getAugmentation(PortBindingExtension.class).getHostId();
if (hostId == null) {
LOG.error("Adding new Neutron port to lisp mapping service failed. Port does not have a HostID. Port: {}", port.toString());
return;
}
List<FixedIps> fixedIPs = port.getFixedIps();
if (fixedIPs != null && fixedIPs.size() > 0) {
Eid eidAddress;
for (FixedIps ip : fixedIPs) {
// TODO Add check/support for IPv6.
// Get subnet for this port, based on v4 or v6 decide address
// iana code.
eidAddress = getEid(port, ip);
PortData portData = new PortData(port.getUuid().getValue(), eidAddress);
hostInformationManager.addHostRelatedInfo(hostId, portData);
}
}
LOG.info("Neutron Port Created: Port name: " + port.getName() + " Port Fixed IP: " + (port.getFixedIps() != null ? port.getFixedIps().get(0) : "No Fixed IP assigned"));
}
Aggregations