use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentation in project genius by opendaylight.
the class HwvtepSouthboundUtils method createRemoteUcastMac.
/**
* Create remote ucast mac.
*
* @param nodeId
* the node id
* @param mac
* the mac
* @param ipAddress
* the ip address
* @param logicalSwitchName
* the logical switch name
* @param physicalLocatorAug
* the physical locator aug
* @return the remote ucast macs
*/
public static RemoteUcastMacs createRemoteUcastMac(NodeId nodeId, String mac, IpAddress ipAddress, String logicalSwitchName, HwvtepPhysicalLocatorAugmentation physicalLocatorAug) {
HwvtepLogicalSwitchRef lsRef = new HwvtepLogicalSwitchRef(createLogicalSwitchesInstanceIdentifier(nodeId, new HwvtepNodeName(logicalSwitchName)));
HwvtepPhysicalLocatorRef phyLocRef = new HwvtepPhysicalLocatorRef(createPhysicalLocatorInstanceIdentifier(nodeId, physicalLocatorAug));
RemoteUcastMacs remoteUcastMacs = new RemoteUcastMacsBuilder().setMacEntryKey(new MacAddress(mac)).setIpaddr(ipAddress).setLogicalSwitchRef(lsRef).setLocatorRef(phyLocRef).build();
return remoteUcastMacs;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentation in project genius by opendaylight.
the class HwvtepUtils method getPhysicalLocator.
/**
* Gets the physical locator.
*
* @param broker
* the broker
* @param datastoreType
* the datastore type
* @param nodeId
* the node id
* @param phyLocatorIp
* the phy locator ip
* @return the physical locator
*/
public static HwvtepPhysicalLocatorAugmentation getPhysicalLocator(DataBroker broker, LogicalDatastoreType datastoreType, NodeId nodeId, final IpAddress phyLocatorIp) {
HwvtepPhysicalLocatorAugmentation phyLocatorAug = HwvtepSouthboundUtils.createHwvtepPhysicalLocatorAugmentation(String.valueOf(phyLocatorIp.getValue()));
InstanceIdentifier<HwvtepPhysicalLocatorAugmentation> iid = HwvtepSouthboundUtils.createPhysicalLocatorInstanceIdentifier(nodeId, phyLocatorAug).augmentation(HwvtepPhysicalLocatorAugmentation.class);
return MDSALUtil.read(broker, datastoreType, iid).orNull();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentation in project genius by opendaylight.
the class HwvtepUtils method installUcastMacs.
/**
* Installs a list of Mac Addresses as remote Ucast address in an external
* device using the hwvtep-southbound.
*
* @param deviceNodeId
* NodeId if the ExternalDevice where the macs must be installed
* in.
* @param macAddresses
* List of Mac addresses to be installed in the external device.
* @param logicalSwitchName
* the logical switch name
* @param remoteVtepIp
* VTEP's IP in this OVS used for the tunnel with external
* device.
*/
public static ListenableFuture<Void> installUcastMacs(DataBroker broker, String deviceNodeId, List<PhysAddress> macAddresses, String logicalSwitchName, IpAddress remoteVtepIp) {
NodeId nodeId = new NodeId(deviceNodeId);
HwvtepPhysicalLocatorAugmentation phyLocatorAug = HwvtepSouthboundUtils.createHwvtepPhysicalLocatorAugmentation(String.valueOf(remoteVtepIp.getValue()));
List<RemoteUcastMacs> macs = new ArrayList<>();
for (PhysAddress mac : macAddresses) {
// TODO: Query ARP cache to get IP address corresponding to
// the MAC
// IpAddress ipAddress = null;
macs.add(HwvtepSouthboundUtils.createRemoteUcastMac(nodeId, mac.getValue().toLowerCase(Locale.getDefault()), /*ipAddress*/
null, logicalSwitchName, phyLocatorAug));
}
return HwvtepUtils.addRemoteUcastMacs(broker, nodeId, macs);
}
Aggregations