@Ignore @Test public void assembleSessionTest(){ Date date = new Date(); InetAddress iAdr = null; InetAddress iAdr1 = null; try { iAdr = InetAddress.getByAddress(new byte[]{89,10,1,1}); iAdr1 = InetAddress.getByAddress(new byte[]{89,10,1,1}); } catch (UnknownHostException e) { e.printStackTrace(); } Set<InetAddress> inetSet = new HashSet<InetAddress>(); inetSet.add(iAdr); inetSet.add(iAdr1); IPPacket ipPack = Mockito.mock(IPPacket.class); Mockito.when(ipPack.getDestinationIPAddress()).thenReturn(iAdr1); Mockito.when(ipPack.getSourceIPAddress()).thenReturn(iAdr); Mockito.when(ipPack.getLen()).thenReturn(20); Mockito.when(ipPack.getPacketLength()).thenReturn(20); Mockito.when(ipPack.getPayloadLen()).thenReturn(20); DomainNameSystem dns = Mockito.mock(DomainNameSystem.class); Mockito.when(dns.getIpAddresses()).thenReturn(inetSet); Mockito.when(dns.getDomainName()).thenReturn("www.att.com"); Mockito.when(dns.isResponse()).thenReturn(true); Mockito.when(dns.getCname()).thenReturn("ATT"); Mockito.when(dns.getPacket()).thenReturn(ipPack); UDPPacket udpPacket = Mockito.mock(UDPPacket.class); Mockito.when(udpPacket.isDNSPacket()).thenReturn(true); Mockito.when(udpPacket.getDns()).thenReturn(dns); Mockito.when(udpPacket.getSourcePort()).thenReturn(83); Mockito.when(udpPacket.getDestinationPort()).thenReturn(84); Mockito.when(udpPacket.getSourceIPAddress()).thenReturn(iAdr); Mockito.when(udpPacket.getDestinationIPAddress()).thenReturn(iAdr1); PacketInfo packetInfo1 = Mockito.mock(PacketInfo.class); Mockito.when(packetInfo1.getPacket()).thenReturn(udpPacket); Mockito.when(packetInfo1.getDir()).thenReturn(PacketDirection.UPLINK); Mockito.when(packetInfo1.getPayloadLen()).thenReturn(10); Mockito.when(packetInfo1.getLen()).thenReturn(10); Mockito.when(packetInfo1.getAppName()).thenReturn("Test1"); Mockito.when(packetInfo1.getTcpFlagString()).thenReturn("TestString"); InetAddress iAdr2 = null; InetAddress iAdr3 = null; try { iAdr2 = InetAddress.getByAddress(new byte[]{89,10,1,1}); iAdr3 = InetAddress.getByAddress(new byte[]{89,10,1,1}); } catch (UnknownHostException e) { e.printStackTrace(); } TCPPacket tcpPacket = Mockito.mock(TCPPacket.class); Mockito.when(tcpPacket.getSourcePort()).thenReturn(81); Mockito.when(tcpPacket.getDestinationPort()).thenReturn(82); Mockito.when(tcpPacket.getDestinationIPAddress()).thenReturn(iAdr2); Mockito.when(tcpPacket.getSourceIPAddress()).thenReturn(iAdr2); Mockito.when(tcpPacket.getAckNumber()).thenReturn(0L); Mockito.when(tcpPacket.getLen()).thenReturn(50); Mockito.when(tcpPacket.isSYN()).thenReturn(true); Mockito.when(tcpPacket.isFIN()).thenReturn(true); Mockito.when(tcpPacket.isRST()).thenReturn(true); Mockito.when(tcpPacket.getSequenceNumber()).thenReturn(20L); Mockito.when(tcpPacket.getTimeStamp()).thenReturn((double)date.getTime()-3000); PacketInfo packetInfo2 = Mockito.mock(PacketInfo.class); Mockito.when(packetInfo2.getPacket()).thenReturn(tcpPacket); Mockito.when(packetInfo2.getDir()).thenReturn(PacketDirection.UPLINK); Mockito.when(packetInfo2.getTcpInfo()).thenReturn(TcpInfo.TCP_ESTABLISH); Mockito.when(packetInfo2.getPayloadLen()).thenReturn(20); Mockito.when(packetInfo2.getLen()).thenReturn(15); Mockito.when(packetInfo2.getAppName()).thenReturn("Test2"); Mockito.when(packetInfo2.getTcpFlagString()).thenReturn("Test2String"); TCPPacket tcpPacket2 = Mockito.mock(TCPPacket.class); Mockito.when(tcpPacket2.getSourcePort()).thenReturn(95); Mockito.when(tcpPacket2.getDestinationPort()).thenReturn(99); Mockito.when(tcpPacket2.getDestinationIPAddress()).thenReturn(iAdr3); Mockito.when(tcpPacket2.getSourceIPAddress()).thenReturn(iAdr3); Mockito.when(tcpPacket.getAckNumber()).thenReturn(0L); Mockito.when(tcpPacket2.isSYN()).thenReturn(true); Mockito.when(tcpPacket2.isFIN()).thenReturn(true); Mockito.when(tcpPacket2.isRST()).thenReturn(true); Mockito.when(tcpPacket.getSequenceNumber()).thenReturn(1L); Mockito.when(tcpPacket2.getTimeStamp()).thenReturn(10000d); PacketInfo packetInfo3 = Mockito.mock(PacketInfo.class); Mockito.when(packetInfo3.getPacket()).thenReturn(tcpPacket2); Mockito.when(packetInfo3.getDir()).thenReturn(PacketDirection.DOWNLINK); Mockito.when(packetInfo3.getTcpInfo()).thenReturn(TcpInfo.TCP_ACK_RECOVER); Mockito.when(packetInfo3.getPayloadLen()).thenReturn(30); Mockito.when(packetInfo3.getLen()).thenReturn(20); Mockito.when(packetInfo3.getAppName()).thenReturn("Test3"); Mockito.when(packetInfo3.getTcpFlagString()).thenReturn("Test3String"); InetAddress iAdr4 = Mockito.mock(InetAddress.class); InetAddress iAdr5 = Mockito.mock(InetAddress.class); Mockito.when(iAdr4.getAddress()).thenReturn(new byte[]{89,10,5,1}); Mockito.when(iAdr4.getHostAddress()).thenReturn("@microfoft"); Mockito.when(iAdr4.getHostName()).thenReturn("microfoft"); Mockito.when(iAdr5.getAddress()).thenReturn(new byte[]{72,12,23,1}); Mockito.when(iAdr5.getHostAddress()).thenReturn("@apple"); Mockito.when(iAdr5.getHostName()).thenReturn("apple"); Set<InetAddress> inetSet1 = new HashSet<InetAddress>(); inetSet1.add(iAdr4); inetSet1.add(iAdr5); IPPacket ipPack1 = Mockito.mock(IPPacket.class); Mockito.when(ipPack1.getDestinationIPAddress()).thenReturn(iAdr5); Mockito.when(ipPack1.getSourceIPAddress()).thenReturn(iAdr4); Mockito.when(ipPack1.getLen()).thenReturn(30); Mockito.when(ipPack1.getPacketLength()).thenReturn(40); Mockito.when(ipPack1.getPayloadLen()).thenReturn(40); DomainNameSystem dns1 = Mockito.mock(DomainNameSystem.class); Mockito.when(dns1.getIpAddresses()).thenReturn(inetSet); Mockito.when(dns1.getDomainName()).thenReturn("www.att.com"); Mockito.when(dns1.isResponse()).thenReturn(false); Mockito.when(dns1.getCname()).thenReturn("ATT"); Mockito.when(dns1.getPacket()).thenReturn(ipPack1); UDPPacket udpPacket1 = Mockito.mock(UDPPacket.class); Mockito.when(udpPacket1.isDNSPacket()).thenReturn(true); Mockito.when(udpPacket1.getDns()).thenReturn(dns1); Mockito.when(udpPacket1.getSourcePort()).thenReturn(90); Mockito.when(udpPacket1.getSourceIPAddress()).thenReturn(iAdr4); Mockito.when(udpPacket1.getDestinationPort()).thenReturn(91); Mockito.when(udpPacket1.getDestinationIPAddress()).thenReturn(iAdr5); PacketInfo packetInfo4 = Mockito.mock(PacketInfo.class); Mockito.when(packetInfo4.getPacket()).thenReturn(udpPacket); Mockito.when(packetInfo4.getDir()).thenReturn(PacketDirection.DOWNLINK); Mockito.when(packetInfo4.getPayloadLen()).thenReturn(30); Mockito.when(packetInfo4.getLen()).thenReturn(10); Mockito.when(packetInfo4.getAppName()).thenReturn("Test2"); Mockito.when(packetInfo4.getTcpFlagString()).thenReturn("TestString2"); PacketInfo packetInfo5 = Mockito.mock(PacketInfo.class); Mockito.when(packetInfo5.getPacket()).thenReturn(tcpPacket); Mockito.when(packetInfo5.getDir()).thenReturn(PacketDirection.DOWNLINK); Mockito.when(packetInfo5.getTcpInfo()).thenReturn(TcpInfo.TCP_ESTABLISH); Mockito.when(packetInfo5.getPayloadLen()).thenReturn(20); Mockito.when(packetInfo5.getLen()).thenReturn(15); Mockito.when(packetInfo5.getAppName()).thenReturn("Test2"); Mockito.when(packetInfo5.getTcpFlagString()).thenReturn("Test2String"); UDPPacket udpPacket2 = Mockito.mock(UDPPacket.class); Mockito.when(udpPacket2.isDNSPacket()).thenReturn(true); Mockito.when(udpPacket2.getDns()).thenReturn(dns1); Mockito.when(udpPacket2.getSourcePort()).thenReturn(90); Mockito.when(udpPacket2.getSourceIPAddress()).thenReturn(iAdr4); Mockito.when(udpPacket2.getDestinationPort()).thenReturn(91); Mockito.when(udpPacket2.getDestinationIPAddress()).thenReturn(iAdr5); PacketInfo packetInfo6 = Mockito.mock(PacketInfo.class); Mockito.when(packetInfo6.getPacket()).thenReturn(udpPacket); Mockito.when(packetInfo6.getDir()).thenReturn(PacketDirection.UNKNOWN); Mockito.when(packetInfo6.getPayloadLen()).thenReturn(30); Mockito.when(packetInfo6.getLen()).thenReturn(10); Mockito.when(packetInfo6.getAppName()).thenReturn("Test2"); Mockito.when(packetInfo6.getTcpFlagString()).thenReturn("TestString2"); List<PacketInfo> packetsList = new ArrayList<PacketInfo>(); packetsList.add(packetInfo1); packetsList.add(packetInfo2); packetsList.add(packetInfo3); packetsList.add(packetInfo4); packetsList.add(packetInfo5); packetsList.add(packetInfo6); List<Session> sessionsList = sessionMgr.processPacketsAndAssembleSessions(packetsList); assertEquals(5,sessionsList.size()); }
public List<Session> processPacketsAndAssembleSessions(List<PacketInfo> packets) { List<Session> sessions = new ArrayList<>(); List<PacketInfo> udpPackets = new ArrayList<>(); Map<InetAddress, String> hostMap = new HashMap<>(); Map<String, Session> udpSessions = new LinkedHashMap<>(); Map<String, PacketInfo> dnsRequestDomains = new HashMap<>(); Map<String, List<Session>> tcpSessions = new LinkedHashMap<>(); Map<InetAddress, PacketInfo> dnsResponsePackets = new HashMap<>(); if (packets != null) { for (PacketInfo packetInfo : packets) { Packet packet = packetInfo.getPacket(); if (packet instanceof UDPPacket) { udpPackets.add(packetInfo); if (((UDPPacket) packet).isDNSPacket()) { DomainNameSystem dns = ((UDPPacket) packet).getDns(); if (dns != null && dns.isResponse()) { for (InetAddress inet : dns.getIpAddresses()) { hostMap.put(inet, dns.getDomainName()); dnsResponsePackets.put(inet, packetInfo); } } else if (dns != null && !dns.isResponse()) { dnsRequestDomains.put(dns.getDomainName(), packetInfo); } } associatePacketToUDPSessionAndPopulateCollections(sessions, udpSessions, packetInfo, (UDPPacket) packet); } if (packet instanceof TCPPacket) { TCPPacket tcpPacket = (TCPPacket) packet; packetInfo.setTcpInfo(null); Session session = associatePacketToTCPSessionAndPopulateCollections(sessions, tcpSessions, packetInfo, tcpPacket); populateTCPPacketInfo(packetInfo, tcpPacket); session.setSsl(session.isSsl() ? session.isSsl() : tcpPacket.isSsl()); if (tcpPacket.isDecrypted()) { tcpPacket.setDataOffset(0); session.setDecrypted(true); } if (session.getDnsResponsePacket() == null && dnsResponsePackets.containsKey(session.getRemoteIP())) { session.setDnsResponsePacket(dnsResponsePackets.get(session.getRemoteIP())); session.setDomainName((((UDPPacket) (session.getDnsResponsePacket()).getPacket()).getDns()).getDomainName()); } if (session.getDnsRequestPacket() == null && StringUtils.isNotBlank(session.getDomainName()) && dnsRequestDomains.containsKey(session.getDomainName())) { session.setRemoteHostName(session.getDomainName()); session.setDnsRequestPacket(dnsRequestDomains.get(session.getDomainName())); } else { session.setRemoteHostName(hostMap.get(session.getRemoteIP())); } if (tcpPacket.isSslHandshake()) { session.setLastSslHandshakePacket(packetInfo); } if (packetInfo.getAppName() != null) { session.getAppNames().add(packetInfo.getAppName()); } } } } Collections.sort(sessions); analyzeRequestResponses(sessions); return sessions; }
SessionManagerImpl implements ISessionManager { public List<Session> processPacketsAndAssembleSessions(List<PacketInfo> packets) { List<Session> sessions = new ArrayList<>(); List<PacketInfo> udpPackets = new ArrayList<>(); Map<InetAddress, String> hostMap = new HashMap<>(); Map<String, Session> udpSessions = new LinkedHashMap<>(); Map<String, PacketInfo> dnsRequestDomains = new HashMap<>(); Map<String, List<Session>> tcpSessions = new LinkedHashMap<>(); Map<InetAddress, PacketInfo> dnsResponsePackets = new HashMap<>(); if (packets != null) { for (PacketInfo packetInfo : packets) { Packet packet = packetInfo.getPacket(); if (packet instanceof UDPPacket) { udpPackets.add(packetInfo); if (((UDPPacket) packet).isDNSPacket()) { DomainNameSystem dns = ((UDPPacket) packet).getDns(); if (dns != null && dns.isResponse()) { for (InetAddress inet : dns.getIpAddresses()) { hostMap.put(inet, dns.getDomainName()); dnsResponsePackets.put(inet, packetInfo); } } else if (dns != null && !dns.isResponse()) { dnsRequestDomains.put(dns.getDomainName(), packetInfo); } } associatePacketToUDPSessionAndPopulateCollections(sessions, udpSessions, packetInfo, (UDPPacket) packet); } if (packet instanceof TCPPacket) { TCPPacket tcpPacket = (TCPPacket) packet; packetInfo.setTcpInfo(null); Session session = associatePacketToTCPSessionAndPopulateCollections(sessions, tcpSessions, packetInfo, tcpPacket); populateTCPPacketInfo(packetInfo, tcpPacket); session.setSsl(session.isSsl() ? session.isSsl() : tcpPacket.isSsl()); if (tcpPacket.isDecrypted()) { tcpPacket.setDataOffset(0); session.setDecrypted(true); } if (session.getDnsResponsePacket() == null && dnsResponsePackets.containsKey(session.getRemoteIP())) { session.setDnsResponsePacket(dnsResponsePackets.get(session.getRemoteIP())); session.setDomainName((((UDPPacket) (session.getDnsResponsePacket()).getPacket()).getDns()).getDomainName()); } if (session.getDnsRequestPacket() == null && StringUtils.isNotBlank(session.getDomainName()) && dnsRequestDomains.containsKey(session.getDomainName())) { session.setRemoteHostName(session.getDomainName()); session.setDnsRequestPacket(dnsRequestDomains.get(session.getDomainName())); } else { session.setRemoteHostName(hostMap.get(session.getRemoteIP())); } if (tcpPacket.isSslHandshake()) { session.setLastSslHandshakePacket(packetInfo); } if (packetInfo.getAppName() != null) { session.getAppNames().add(packetInfo.getAppName()); } } } } Collections.sort(sessions); analyzeRequestResponses(sessions); return sessions; } }
SessionManagerImpl implements ISessionManager { public List<Session> processPacketsAndAssembleSessions(List<PacketInfo> packets) { List<Session> sessions = new ArrayList<>(); List<PacketInfo> udpPackets = new ArrayList<>(); Map<InetAddress, String> hostMap = new HashMap<>(); Map<String, Session> udpSessions = new LinkedHashMap<>(); Map<String, PacketInfo> dnsRequestDomains = new HashMap<>(); Map<String, List<Session>> tcpSessions = new LinkedHashMap<>(); Map<InetAddress, PacketInfo> dnsResponsePackets = new HashMap<>(); if (packets != null) { for (PacketInfo packetInfo : packets) { Packet packet = packetInfo.getPacket(); if (packet instanceof UDPPacket) { udpPackets.add(packetInfo); if (((UDPPacket) packet).isDNSPacket()) { DomainNameSystem dns = ((UDPPacket) packet).getDns(); if (dns != null && dns.isResponse()) { for (InetAddress inet : dns.getIpAddresses()) { hostMap.put(inet, dns.getDomainName()); dnsResponsePackets.put(inet, packetInfo); } } else if (dns != null && !dns.isResponse()) { dnsRequestDomains.put(dns.getDomainName(), packetInfo); } } associatePacketToUDPSessionAndPopulateCollections(sessions, udpSessions, packetInfo, (UDPPacket) packet); } if (packet instanceof TCPPacket) { TCPPacket tcpPacket = (TCPPacket) packet; packetInfo.setTcpInfo(null); Session session = associatePacketToTCPSessionAndPopulateCollections(sessions, tcpSessions, packetInfo, tcpPacket); populateTCPPacketInfo(packetInfo, tcpPacket); session.setSsl(session.isSsl() ? session.isSsl() : tcpPacket.isSsl()); if (tcpPacket.isDecrypted()) { tcpPacket.setDataOffset(0); session.setDecrypted(true); } if (session.getDnsResponsePacket() == null && dnsResponsePackets.containsKey(session.getRemoteIP())) { session.setDnsResponsePacket(dnsResponsePackets.get(session.getRemoteIP())); session.setDomainName((((UDPPacket) (session.getDnsResponsePacket()).getPacket()).getDns()).getDomainName()); } if (session.getDnsRequestPacket() == null && StringUtils.isNotBlank(session.getDomainName()) && dnsRequestDomains.containsKey(session.getDomainName())) { session.setRemoteHostName(session.getDomainName()); session.setDnsRequestPacket(dnsRequestDomains.get(session.getDomainName())); } else { session.setRemoteHostName(hostMap.get(session.getRemoteIP())); } if (tcpPacket.isSslHandshake()) { session.setLastSslHandshakePacket(packetInfo); } if (packetInfo.getAppName() != null) { session.getAppNames().add(packetInfo.getAppName()); } } } } Collections.sort(sessions); analyzeRequestResponses(sessions); return sessions; } SessionManagerImpl(); }
SessionManagerImpl implements ISessionManager { public List<Session> processPacketsAndAssembleSessions(List<PacketInfo> packets) { List<Session> sessions = new ArrayList<>(); List<PacketInfo> udpPackets = new ArrayList<>(); Map<InetAddress, String> hostMap = new HashMap<>(); Map<String, Session> udpSessions = new LinkedHashMap<>(); Map<String, PacketInfo> dnsRequestDomains = new HashMap<>(); Map<String, List<Session>> tcpSessions = new LinkedHashMap<>(); Map<InetAddress, PacketInfo> dnsResponsePackets = new HashMap<>(); if (packets != null) { for (PacketInfo packetInfo : packets) { Packet packet = packetInfo.getPacket(); if (packet instanceof UDPPacket) { udpPackets.add(packetInfo); if (((UDPPacket) packet).isDNSPacket()) { DomainNameSystem dns = ((UDPPacket) packet).getDns(); if (dns != null && dns.isResponse()) { for (InetAddress inet : dns.getIpAddresses()) { hostMap.put(inet, dns.getDomainName()); dnsResponsePackets.put(inet, packetInfo); } } else if (dns != null && !dns.isResponse()) { dnsRequestDomains.put(dns.getDomainName(), packetInfo); } } associatePacketToUDPSessionAndPopulateCollections(sessions, udpSessions, packetInfo, (UDPPacket) packet); } if (packet instanceof TCPPacket) { TCPPacket tcpPacket = (TCPPacket) packet; packetInfo.setTcpInfo(null); Session session = associatePacketToTCPSessionAndPopulateCollections(sessions, tcpSessions, packetInfo, tcpPacket); populateTCPPacketInfo(packetInfo, tcpPacket); session.setSsl(session.isSsl() ? session.isSsl() : tcpPacket.isSsl()); if (tcpPacket.isDecrypted()) { tcpPacket.setDataOffset(0); session.setDecrypted(true); } if (session.getDnsResponsePacket() == null && dnsResponsePackets.containsKey(session.getRemoteIP())) { session.setDnsResponsePacket(dnsResponsePackets.get(session.getRemoteIP())); session.setDomainName((((UDPPacket) (session.getDnsResponsePacket()).getPacket()).getDns()).getDomainName()); } if (session.getDnsRequestPacket() == null && StringUtils.isNotBlank(session.getDomainName()) && dnsRequestDomains.containsKey(session.getDomainName())) { session.setRemoteHostName(session.getDomainName()); session.setDnsRequestPacket(dnsRequestDomains.get(session.getDomainName())); } else { session.setRemoteHostName(hostMap.get(session.getRemoteIP())); } if (tcpPacket.isSslHandshake()) { session.setLastSslHandshakePacket(packetInfo); } if (packetInfo.getAppName() != null) { session.getAppNames().add(packetInfo.getAppName()); } } } } Collections.sort(sessions); analyzeRequestResponses(sessions); return sessions; } SessionManagerImpl(); @Autowired void setByteArrayLineReader(IByteArrayLineReader reader); void setiOSSecureTracePath(String tracePath); List<Session> processPacketsAndAssembleSessions(List<PacketInfo> packets); }
SessionManagerImpl implements ISessionManager { public List<Session> processPacketsAndAssembleSessions(List<PacketInfo> packets) { List<Session> sessions = new ArrayList<>(); List<PacketInfo> udpPackets = new ArrayList<>(); Map<InetAddress, String> hostMap = new HashMap<>(); Map<String, Session> udpSessions = new LinkedHashMap<>(); Map<String, PacketInfo> dnsRequestDomains = new HashMap<>(); Map<String, List<Session>> tcpSessions = new LinkedHashMap<>(); Map<InetAddress, PacketInfo> dnsResponsePackets = new HashMap<>(); if (packets != null) { for (PacketInfo packetInfo : packets) { Packet packet = packetInfo.getPacket(); if (packet instanceof UDPPacket) { udpPackets.add(packetInfo); if (((UDPPacket) packet).isDNSPacket()) { DomainNameSystem dns = ((UDPPacket) packet).getDns(); if (dns != null && dns.isResponse()) { for (InetAddress inet : dns.getIpAddresses()) { hostMap.put(inet, dns.getDomainName()); dnsResponsePackets.put(inet, packetInfo); } } else if (dns != null && !dns.isResponse()) { dnsRequestDomains.put(dns.getDomainName(), packetInfo); } } associatePacketToUDPSessionAndPopulateCollections(sessions, udpSessions, packetInfo, (UDPPacket) packet); } if (packet instanceof TCPPacket) { TCPPacket tcpPacket = (TCPPacket) packet; packetInfo.setTcpInfo(null); Session session = associatePacketToTCPSessionAndPopulateCollections(sessions, tcpSessions, packetInfo, tcpPacket); populateTCPPacketInfo(packetInfo, tcpPacket); session.setSsl(session.isSsl() ? session.isSsl() : tcpPacket.isSsl()); if (tcpPacket.isDecrypted()) { tcpPacket.setDataOffset(0); session.setDecrypted(true); } if (session.getDnsResponsePacket() == null && dnsResponsePackets.containsKey(session.getRemoteIP())) { session.setDnsResponsePacket(dnsResponsePackets.get(session.getRemoteIP())); session.setDomainName((((UDPPacket) (session.getDnsResponsePacket()).getPacket()).getDns()).getDomainName()); } if (session.getDnsRequestPacket() == null && StringUtils.isNotBlank(session.getDomainName()) && dnsRequestDomains.containsKey(session.getDomainName())) { session.setRemoteHostName(session.getDomainName()); session.setDnsRequestPacket(dnsRequestDomains.get(session.getDomainName())); } else { session.setRemoteHostName(hostMap.get(session.getRemoteIP())); } if (tcpPacket.isSslHandshake()) { session.setLastSslHandshakePacket(packetInfo); } if (packetInfo.getAppName() != null) { session.getAppNames().add(packetInfo.getAppName()); } } } } Collections.sort(sessions); analyzeRequestResponses(sessions); return sessions; } SessionManagerImpl(); @Autowired void setByteArrayLineReader(IByteArrayLineReader reader); void setiOSSecureTracePath(String tracePath); List<Session> processPacketsAndAssembleSessions(List<PacketInfo> packets);  }