Commit 3bc90f74 authored by Bc. Matúš Husovský's avatar Bc. Matúš Husovský
Browse files

# Odstranene zbytocne vypisy

parent f0646192
......@@ -162,20 +162,20 @@ public class AccountingManager {
tempIdArray = data.getFieldValue(template.getFieldSpecifierPosition(elementID));
applicationIdArray = new byte[4];
applicationIdArray[0] = tempIdArray[1];
applicationIdArray[1] = tempIdArray[2];
applicationIdArray[2] = tempIdArray[3];
applicationIdArray[3] = 0;
applicationIdArray[0] = 0;
applicationIdArray[1] = tempIdArray[3];
applicationIdArray[2] = tempIdArray[2];
applicationIdArray[3] = tempIdArray[1];
applicationId = byteArrayToInt(applicationIdArray);
//hashKey = generateHashKey(sourceIPv4Address, destinationIPv4Address, protocolIdentifier, sourcePort, destinationPort, ipDiffServCodePoint, isMulticast);
//temporary
hashKey = generateHashKey(sourceIPv4AddressInet, destinationIPv4AddressInet,sourceMAC,destinationMAC, (short)0, sourcePort, destinationPort, (short)0, false, applicationId);
System.out.println(
/*System.out.println(
"Hash key: " + hashKey + " for" + sourceIPv4AddressInet.toString() +
' ' + destinationIPv4AddressInet.toString() + ' ' + sourcePort + ' ' + destinationPort
);
*/
elementID = 1;
octetDeltaCount = ByteBuffer.wrap(data.getFieldValue(template.getFieldSpecifierPosition(elementID))).getLong();
//elementID = 85;
......@@ -214,8 +214,6 @@ public class AccountingManager {
log.debug("src IP address: " + sourceIPv4AddressInet);
log.debug("dst IP address: " + destinationIPv4AddressInet);
log.debug("src MAC address: " + sourceMAC);
log.debug("dst MAC address: " + destinationMAC);
log.debug("src port:"+sourcePort);
log.debug("dst port"+destinationPort);
log.debug("octet delta count: " + octetDeltaCount);
......@@ -267,18 +265,20 @@ public class AccountingManager {
hash ^= protocol; hash ^= srcPort + 2015; hash ^= dstPort; hash ^= dscp; hash += (multicast ? 1009 : 2003);
return hash;
}
/*
public static int byteArrayToInt(byte[] b) {
return ByteBuffer.wrap(b).order(ByteOrder.LITTLE_ENDIAN).getInt();
//ten dalsi by mal byt rychlejsi
//return ByteBuffer.wrap(b).order(ByteOrder.LITTLE_ENDIAN).getInt();
return ByteBuffer.wrap(b).getInt();
}
/*
*/
public static int byteArrayToInt(byte[] encodedValue) {
int index = 0;
int value = 0 << Byte.SIZE * 3;
int value = encodedValue[index++] << Byte.SIZE * 3;
value ^= (encodedValue[index++] & 0xFF) << Byte.SIZE * 2;
value ^= (encodedValue[index++] & 0xFF) << Byte.SIZE * 1;
value ^= (encodedValue[index++] & 0xFF);
return value;
}
*/
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment