use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress in project genius by opendaylight.
the class InterfaceStateHelper method buildStateFromInterfaceInfo.
public static Interface buildStateFromInterfaceInfo(InterfaceInfo interfaceInfo) {
BigInteger dpId = interfaceInfo.getDpId();
int portno = interfaceInfo.getPortNo();
NodeConnectorId nodeConnectorId = new NodeConnectorId("openflow:" + dpId.toString() + ":" + portno);
return new InterfaceBuilder().setType(Other.class).setIfIndex(interfaceInfo.getInterfaceTag()).setAdminStatus(AdminStatus.Up).setOperStatus(OperStatus.Up).setLowerLayerIf(Lists.newArrayList(nodeConnectorId.getValue())).setPhysAddress(new PhysAddress(interfaceInfo.getMacAddress())).setKey(new InterfaceKey(interfaceInfo.getInterfaceName())).setStatistics(new StatisticsBuilder().setDiscontinuityTime(new DateAndTime(DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(ZonedDateTime.now()))).build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress in project netvirt by opendaylight.
the class ElanL2GatewayUtils method scheduleAddDpnMacsInExtDevice.
public void scheduleAddDpnMacsInExtDevice(final String elanName, BigInteger dpId, final List<PhysAddress> staticMacAddresses, final L2GatewayDevice externalDevice) {
NodeId nodeId = new NodeId(externalDevice.getHwvtepNodeId());
final IpAddress dpnTepIp = elanItmUtils.getSourceDpnTepIp(dpId, nodeId);
LOG.trace("Dpn Tep IP: {} for dpnId: {} and nodeId: {}", dpnTepIp, dpId, nodeId);
if (dpnTepIp == null) {
LOG.error("could not install dpn mac in l2gw TEP IP not found for dpnId {} and nodeId {}", dpId, nodeId);
return;
}
// TODO: to be batched in genius
HwvtepUtils.installUcastMacs(broker, externalDevice.getHwvtepNodeId(), staticMacAddresses, elanName, dpnTepIp);
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress in project netvirt by opendaylight.
the class ElanUtils method getPhysAddress.
public static List<PhysAddress> getPhysAddress(List<String> macAddress) {
Preconditions.checkNotNull(macAddress, "macAddress cannot be null");
List<PhysAddress> physAddresses = new ArrayList<>();
for (String mac : macAddress) {
physAddresses.add(new PhysAddress(mac));
}
return physAddresses;
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress in project netvirt by opendaylight.
the class ElanUtils method getElanInterfaceMacAddresses.
/**
* Gets the elan interface mac addresses.
*
* @param interfaceName
* the interface name
* @return the elan interface mac addresses
*/
public List<PhysAddress> getElanInterfaceMacAddresses(String interfaceName) {
List<PhysAddress> macAddresses = new ArrayList<>();
ElanInterfaceMac elanInterfaceMac = getElanInterfaceMacByInterfaceName(interfaceName);
if (elanInterfaceMac != null && elanInterfaceMac.getMacEntry() != null) {
List<MacEntry> macEntries = elanInterfaceMac.getMacEntry();
for (MacEntry macEntry : macEntries) {
macAddresses.add(macEntry.getMacAddress());
}
}
return macAddresses;
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress in project netvirt by opendaylight.
the class ElanUtils method getStaticMacEntries.
public static List<StaticMacEntries> getStaticMacEntries(List<String> staticMacAddresses) {
if (isEmpty(staticMacAddresses)) {
return Collections.EMPTY_LIST;
}
StaticMacEntriesBuilder staticMacEntriesBuilder = new StaticMacEntriesBuilder();
List<StaticMacEntries> staticMacEntries = new ArrayList<>();
List<PhysAddress> physAddressList = getPhysAddress(staticMacAddresses);
for (PhysAddress physAddress : physAddressList) {
staticMacEntries.add(staticMacEntriesBuilder.setMacAddress(physAddress).build());
}
return staticMacEntries;
}
Aggregations