/** * Converts Ipv4Address to byte array. * * @param address Ipv4Address to be converted * @return byte array */ public static byte[] bytesForAddress(final Ipv4Address address) { return IetfInetUtil.INSTANCE.ipv4AddressBytes(address); }
protected static void writeIpv4Address(final Ipv4Address address, final ByteBuf out) { out.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(address)); } }
byte[] addressValue = IetfInetUtil.INSTANCE.ipv4AddressBytes(ipv4PrefixEntry.getKey());
@Override public void serialize(final Action action, final ByteBuf outBuffer) { super.serialize(action, outBuffer); outBuffer.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes( ((SetNwSrcCase) action.getActionChoice()).getSetNwSrcAction().getIpAddress())); }
@Override public void serialize(final Action action, final ByteBuf outBuffer) { super.serialize(action, outBuffer); outBuffer.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes( ((SetNwDstCase) action.getActionChoice()).getSetNwDstAction().getIpAddress())); }
/** * Serializes ofp_match (OpenFlow v1.0) * @param outBuffer output ByteBuf * @param match match to be serialized */ @Override public void serialize(final MatchV10 match, final ByteBuf outBuffer) { outBuffer.writeInt(encodeWildcards(match.getWildcards(), match.getNwSrcMask(), match.getNwDstMask())); outBuffer.writeShort(match.getInPort()); outBuffer.writeBytes(IetfYangUtil.INSTANCE.bytesFor(match.getDlSrc())); outBuffer.writeBytes(IetfYangUtil.INSTANCE.bytesFor(match.getDlDst())); outBuffer.writeShort(match.getDlVlan()); outBuffer.writeByte(match.getDlVlanPcp()); outBuffer.writeZero(PADDING_IN_MATCH); outBuffer.writeShort(match.getDlType()); outBuffer.writeByte(match.getNwTos()); outBuffer.writeByte(match.getNwProto()); outBuffer.writeZero(PADDING_IN_MATCH_2); outBuffer.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(match.getNwSrc())); outBuffer.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(match.getNwDst())); outBuffer.writeShort(match.getTpSrc()); outBuffer.writeShort(match.getTpDst()); }