@Test public void testSystemId() throws Exception { result1 = IsisUtil.systemId(Bytes.toArray( IsisUtil.sourceAndLanIdToBytes(systemId))); assertThat(result1, is(systemId)); }
public static String systemId(byte[] bytes) { String systemId = ""; for (Byte byt : bytes) { String hexa = Integer.toHexString(Byte.toUnsignedInt(byt)); if (hexa.length() % 2 != 0) { hexa = "0" + hexa; } systemId = systemId + hexa; if (systemId.length() == 4 || systemId.length() == 9) { systemId = systemId + "."; } } return systemId; }
IsisUtil { public static String systemId(byte[] bytes) { String systemId = ""; for (Byte byt : bytes) { String hexa = Integer.toHexString(Byte.toUnsignedInt(byt)); if (hexa.length() % 2 != 0) { hexa = "0" + hexa; } systemId = systemId + hexa; if (systemId.length() == 4 || systemId.length() == 9) { systemId = systemId + "."; } } return systemId; } }
IsisUtil { public static String systemId(byte[] bytes) { String systemId = ""; for (Byte byt : bytes) { String hexa = Integer.toHexString(Byte.toUnsignedInt(byt)); if (hexa.length() % 2 != 0) { hexa = "0" + hexa; } systemId = systemId + hexa; if (systemId.length() == 4 || systemId.length() == 9) { systemId = systemId + "."; } } return systemId; } private  IsisUtil(); }
IsisUtil { public static String systemId(byte[] bytes) { String systemId = ""; for (Byte byt : bytes) { String hexa = Integer.toHexString(Byte.toUnsignedInt(byt)); if (hexa.length() % 2 != 0) { hexa = "0" + hexa; } systemId = systemId + hexa; if (systemId.length() == 4 || systemId.length() == 9) { systemId = systemId + "."; } } return systemId; } private  IsisUtil(); static boolean sameNetwork(Ip4Address ip1, Ip4Address ip2, byte[] mask); static String systemId(byte[] bytes); static String systemIdPlus(byte[] bytes); static String areaAddres(byte[] bytes); static List<Byte> areaAddressToBytes(String address); static int getPduHeaderLength(int pduType); static byte[] addLengthAndMarkItInReserved(byte[] isisPacket, int lengthBytePos1,
                                                      int lengthBytePos2, int reservedBytePos); static byte[] addChecksum(byte[] isisPacket, int checksumBytePos1, int checksumBytePos2); static byte[] framePacket(byte[] isisPacket, int interfaceIndex); static List<Byte> sourceAndLanIdToBytes(String id); static byte[] getPaddingTlvs(int currentLength); static byte[] convertToTwoBytes(int numberToConvert); static byte[] convertToFourBytes(int numberToConvert); static byte[] getP2pHelloPdu(IsisInterface isisInterface, boolean paddingEnabled); static byte[] getL1HelloPdu(IsisInterface isisInterface, boolean paddingEnabled); static byte[] getL2HelloPdu(IsisInterface isisInterface, boolean paddingEnabled); static int byteToInteger(byte[] bytesToConvert); static long byteToLong(byte[] bytesToConvert); static byte[] convertToFourBytes(long numberToConvert); static String toEightBitBinary(String binaryString); static String toFourBitBinary(String binaryString); static byte[] convertToThreeBytes(int numberToConvert); static String prefixConversion(byte[] bytes); static byte[] prefixToBytes(String prefix); static boolean checkIsDis(String systemId); static String removeTailingZeros(String systemId); }
IsisUtil { public static String systemId(byte[] bytes) { String systemId = ""; for (Byte byt : bytes) { String hexa = Integer.toHexString(Byte.toUnsignedInt(byt)); if (hexa.length() % 2 != 0) { hexa = "0" + hexa; } systemId = systemId + hexa; if (systemId.length() == 4 || systemId.length() == 9) { systemId = systemId + "."; } } return systemId; } private  IsisUtil(); static boolean sameNetwork(Ip4Address ip1, Ip4Address ip2, byte[] mask); static String systemId(byte[] bytes); static String systemIdPlus(byte[] bytes); static String areaAddres(byte[] bytes); static List<Byte> areaAddressToBytes(String address); static int getPduHeaderLength(int pduType); static byte[] addLengthAndMarkItInReserved(byte[] isisPacket, int lengthBytePos1,
                                                      int lengthBytePos2, int reservedBytePos); static byte[] addChecksum(byte[] isisPacket, int checksumBytePos1, int checksumBytePos2); static byte[] framePacket(byte[] isisPacket, int interfaceIndex); static List<Byte> sourceAndLanIdToBytes(String id); static byte[] getPaddingTlvs(int currentLength); static byte[] convertToTwoBytes(int numberToConvert); static byte[] convertToFourBytes(int numberToConvert); static byte[] getP2pHelloPdu(IsisInterface isisInterface, boolean paddingEnabled); static byte[] getL1HelloPdu(IsisInterface isisInterface, boolean paddingEnabled); static byte[] getL2HelloPdu(IsisInterface isisInterface, boolean paddingEnabled); static int byteToInteger(byte[] bytesToConvert); static long byteToLong(byte[] bytesToConvert); static byte[] convertToFourBytes(long numberToConvert); static String toEightBitBinary(String binaryString); static String toFourBitBinary(String binaryString); static byte[] convertToThreeBytes(int numberToConvert); static String prefixConversion(byte[] bytes); static byte[] prefixToBytes(String prefix); static boolean checkIsDis(String systemId); static String removeTailingZeros(String systemId); static final int ETHER_HEADER_LEN; static final int ID_SIX_BYTES; static final int ID_PLUS_ONE_BYTE; static final int ID_PLUS_TWO_BYTE; static final int THREE_BYTES; static final int TWO_BYTES; static final int SIX_BYTES; static final int EIGHT_BYTES; static final int FOUR_BYTES; static final int PADDING_FIXED_LENGTH; static final int TLVHEADERLENGTH; static final int INITIAL_BANDWIDTH; }