@Override protected String getValue(final MacAddress macAddress) { return macAddress.getValue(); } }
static boolean macAddressEquals(final MacAddress statsMacAddress, final MacAddress storedMacAddress) { boolean verdict = true; final Boolean checkNullValues = checkNullValues(statsMacAddress, storedMacAddress); if (checkNullValues != null) { verdict = checkNullValues; } else { verdict = statsMacAddress.getValue().equalsIgnoreCase(storedMacAddress.getValue()); } return verdict; }
/** * Return a description about the specified MD-SAL action. * * @param name The name of the flow action. * @param mac A {@link MacAddress} instance. * @return A description about the specified MD-SAL action. */ protected final String getDescription(String name, MacAddress mac) { String addr = (mac == null) ? null : mac.getValue(); return new StringBuilder(name).append("(address="). append(addr).append(')').toString(); }
@Override public String apply(LocalUcastMacs localUcastMac) { return localUcastMac.getMacEntryKey().getValue(); } });
/** * Converts a {@link MacAddress} object into a byte array. * @param mac {@link MacAddress} Mac Address Object * @return mac as a byte array */ public static byte[] macToBytes(MacAddress mac) { return HexEncode.bytesFromHexString(mac.getValue()); }
public byte[] convertEthernetHeaderToByte(EthernetHeader ethPdu) { byte[] data = new byte[16]; Arrays.fill(data, (byte)0); ByteBuffer buf = ByteBuffer.wrap(data); buf.put(bytesFromHexString(ethPdu.getDestinationMac().getValue().toString())); buf.put(bytesFromHexString(ethPdu.getSourceMac().getValue().toString())); buf.putShort((short)ethPdu.getEthertype().intValue()); return data; }
public byte[] getBondSystemId() { byte[] systemId = HexEncode.bytesFromHexString(this.lacpNodeRef.getNodeSystemId().getValue()); return systemId; } public List<LacpPort> getSlaveList() {
public void setPartnerInfoFromPkt(PartnerInfo partInfo){ final byte[] nodeSysAddr; short portNum = partInfo.getPort().shortValue(); byte portState = (byte)partInfo.getState().shortValue(); int portPri = partInfo.getPortPriority().intValue(); short nodeKey = partInfo.getKey().shortValue(); nodeSysAddr = HexEncode.bytesFromHexString((partInfo.getSystemId().getValue())); int sysPri = partInfo.getSystemPriority().intValue(); partnerSystemInfo = new LacpBpduSysInfo(sysPri, nodeSysAddr, nodeKey, portPri, portNum, portState); }
@Override public void serialize(MatchEntry input, ByteBuf outBuffer) { serializeHeader(input, outBuffer); EncapEthSrcCaseValue value = ((EncapEthSrcCaseValue) input.getMatchEntryValue()); outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(value.getEncapEthSrcValues().getMacAddress().getValue())); }
@Override public void serialize(MatchEntry input, ByteBuf outBuffer) { serializeHeader(input, outBuffer); EthDstCaseValue ethDstCase = ((EthDstCaseValue) input.getMatchEntryValue()); outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(ethDstCase.getEthDstValues().getMacAddress().getValue())); }
@Override public void serialize(MatchEntry input, ByteBuf outBuffer) { serializeHeader(input, outBuffer); ArpThaCaseValue arpThaCase = ((ArpThaCaseValue) input.getMatchEntryValue()); outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(arpThaCase.getArpThaValues().getMacAddress().getValue())); }
@Override public void serialize(MatchEntry input, ByteBuf outBuffer) { serializeHeader(input, outBuffer); EthSrcCaseValue ethSrcCase = ((EthSrcCaseValue) input.getMatchEntryValue()); outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(ethSrcCase.getEthSrcValues().getMacAddress().getValue())); }
@Override public void serialize(MatchEntry input, ByteBuf outBuffer) { serializeHeader(input, outBuffer); EncapEthDstCaseValue value = ((EncapEthDstCaseValue) input.getMatchEntryValue()); outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(value.getEncapEthDstValues().getMacAddress().getValue())); }
@Override public void serialize(MatchEntry input, ByteBuf outBuffer) { serializeHeader(input, outBuffer); ArpShaCaseValue value = ((ArpShaCaseValue) input.getMatchEntryValue()); outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(value.getArpShaValues().getMacAddress().getValue())); }
public static Action createActionNxLoadArpShaAction(String mac, int order){ ActionBuilder ab = createActionBuilder(order); ab.setAction( nxLoadRegAction( new DstNxArpShaCaseBuilder().setNxArpSha(Boolean.TRUE).build(), new BigInteger(1, bytesFromHexString(new MacAddress(mac).getValue())), 47, false)); return ab.build(); }
private void createElanInterface(Port port, String name) { String elanInstanceName = port.getNetworkId().getValue(); List<PhysAddress> physAddresses = new ArrayList<>(); physAddresses.add(new PhysAddress(port.getMacAddress().getValue())); InstanceIdentifier<ElanInterface> id = InstanceIdentifier.builder(ElanInterfaces.class).child(ElanInterface .class, new ElanInterfaceKey(name)).build(); ElanInterface elanInterface = new ElanInterfaceBuilder().setElanInstanceName(elanInstanceName) .setName(name).setStaticMacEntries(physAddresses).setKey(new ElanInterfaceKey(name)).build(); MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION, id, elanInterface); LOG.debug("Creating new ELan Interface {}", elanInterface); }
public static Action createActionNxLoadEncapEthDst(String mac, int order) { ActionBuilder ab = createActionBuilder(order); ab.setAction( nxLoadRegAction( new DstNxEncapEthDstCaseBuilder().setNxEncapEthDst(Boolean.TRUE).build(), new BigInteger(1, bytesFromHexString(new MacAddress(mac).getValue())), 47, false ) ); return ab.build(); }
@Deprecated private static org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.RegisterEndpointInputBuilder createBasicEndpointInputBuilder( Port port) { return new org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.RegisterEndpointInputBuilder().setL2Context( new L2BridgeDomainId(port.getNetworkId().getValue())) .setMacAddress(new MacAddress(port.getMacAddress().getValue())) .setTenant(new TenantId(port.getTenantId().getValue())) .setTimestamp(System.currentTimeMillis()); }
public static Action createActionNxLoadEncapEthSrc(String value, int order) { ActionBuilder ab = createActionBuilder(order); ab.setAction( nxLoadRegAction( new DstNxEncapEthSrcCaseBuilder().setNxEncapEthSrc(Boolean.TRUE).build(), new BigInteger(1, bytesFromHexString(new MacAddress(value).getValue())), 47, false ) ); return ab.build(); }
private void unregisterEndpointAndRemoveMapping(UnregisterEndpointInput baseEpUnreg, Port port, ReadWriteTransaction rwTx) { boolean isUnregisteredBaseEndpoint = epRegistrator.unregisterEndpoint(baseEpUnreg); if (isUnregisteredBaseEndpoint) { UniqueId portId = new UniqueId(port.getUuid().getValue()); PortByBaseEndpointKey portByBaseEndpointKey = new PortByBaseEndpointKey(port.getMacAddress().getValue(), MacAddressType.class, new ContextId(port.getNetworkId().getValue()), MappingUtils.L2_BRDIGE_DOMAIN); LOG.trace("Removing Port-BaseEndpoint mapping for port {} (device owner {}) and endpoint {}", port.getUuid().getValue(), port.getDeviceOwner(), portByBaseEndpointKey); removeBaseEndpointMappings(portByBaseEndpointKey, portId, rwTx); } }