В модель пакета добавлена информация, исходящий ли он
This commit is contained in:
@@ -149,15 +149,17 @@ public class PcapWorker {
|
||||
String sourceIpAndPort = sourceIpString + ":" + sourcePort;
|
||||
String destIpAndPort = destIpString + ":" + destPort;
|
||||
|
||||
boolean incoming = destIpString.equals(localIp);
|
||||
|
||||
UnfinishedStream stream = new UnfinishedStream(sourceIp, destIp, sourcePort, destPort, protocol);
|
||||
|
||||
ru.serega6531.packmate.model.Packet packet = ru.serega6531.packmate.model.Packet.builder()
|
||||
.tempId(packetIdCounter++)
|
||||
.timestamp(System.currentTimeMillis())
|
||||
.incoming(incoming)
|
||||
.content(content)
|
||||
.build();
|
||||
|
||||
|
||||
if (unfinishedStreams.containsKey(stream)) {
|
||||
unfinishedStreams.get(stream).add(packet);
|
||||
} else {
|
||||
|
||||
@@ -40,6 +40,8 @@ public class Packet {
|
||||
|
||||
private long timestamp;
|
||||
|
||||
private boolean incoming; // true если от клиента к серверу, иначе false
|
||||
|
||||
private byte[] content;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user