use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.RemoteUcastMacs 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.hwvtep.global.attributes.RemoteUcastMacs in project genius by opendaylight.
the class HwvtepUtils method putRemoteUcastMac.
/**
* Put remote ucast mac in the transaction.
*
* @param transaction
* the transaction
* @param nodeId
* the node id
* @param remoteUcastMac
* the remote ucast mac
*/
public static void putRemoteUcastMac(final WriteTransaction transaction, final NodeId nodeId, RemoteUcastMacs remoteUcastMac) {
InstanceIdentifier<RemoteUcastMacs> iid = HwvtepSouthboundUtils.createInstanceIdentifier(nodeId).augmentation(HwvtepGlobalAugmentation.class).child(RemoteUcastMacs.class, new RemoteUcastMacsKey(remoteUcastMac.getLogicalSwitchRef(), remoteUcastMac.getMacEntryKey()));
transaction.put(LogicalDatastoreType.CONFIGURATION, iid, remoteUcastMac, true);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.RemoteUcastMacs 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