@Test public void setAroJpcapLibNameTest() { reader.setAroJpcapLibName("Windows", "64"); String libname = reader.getAroJpcapLibFileName(); assertEquals("jpcap64.dll", libname); reader.setAroJpcapLibName("Windows", "86"); libname = reader.getAroJpcapLibFileName(); assertEquals("jpcap.dll", libname); reader.setAroJpcapLibName("Linux", "amd64"); libname = reader.getAroJpcapLibFileName(); assertEquals("libjpcap64.so", libname); reader.setAroJpcapLibName("Linux", "i386"); libname = reader.getAroJpcapLibFileName(); assertEquals("libjpcap32.so", libname); reader.setAroJpcapLibName("MacOS", "64"); libname = reader.getAroJpcapLibFileName(); assertEquals("libjpcap.jnilib", libname); reader.setAroJpcapLibName(null, null); }
public void setAroJpcapLibName(String osname, String osarch) { LOGGER.info("OS: " + osname); LOGGER.info("OS Arch: " + osarch); if (osname != null && osarch != null) { if (osname.contains(windowsOS) && osarch.contains("64")) { aroJpcapLibName = "jpcap64"; aroJpcapLibFileName = aroJpcapLibName + windowsExtn; } else if (osname.contains(windowsOS)) { aroJpcapLibName = "jpcap"; aroJpcapLibFileName = aroJpcapLibName + windowsExtn; } else if (osname.contains(linuxOS) && osarch.contains("amd64")) { aroJpcapLibName = "jpcap64"; aroJpcapLibFileName = "lib" + aroJpcapLibName + unixExtn; } else if (osname.contains(linuxOS) && osarch.contains("i386")) { aroJpcapLibName = "jpcap32"; aroJpcapLibFileName = "lib" + aroJpcapLibName + unixExtn; } else { aroJpcapLibName = "jpcap"; aroJpcapLibFileName = "lib" + aroJpcapLibName + ".jnilib"; } } LOGGER.info("ARO Jpcap DLL lib file name: " + aroJpcapLibFileName); }
PacketReaderImpl implements IPacketReader, INativePacketSubscriber { public void setAroJpcapLibName(String osname, String osarch) { LOGGER.info("OS: " + osname); LOGGER.info("OS Arch: " + osarch); if (osname != null && osarch != null) { if (osname.contains(windowsOS) && osarch.contains("64")) { aroJpcapLibName = "jpcap64"; aroJpcapLibFileName = aroJpcapLibName + windowsExtn; } else if (osname.contains(windowsOS)) { aroJpcapLibName = "jpcap"; aroJpcapLibFileName = aroJpcapLibName + windowsExtn; } else if (osname.contains(linuxOS) && osarch.contains("amd64")) { aroJpcapLibName = "jpcap64"; aroJpcapLibFileName = "lib" + aroJpcapLibName + unixExtn; } else if (osname.contains(linuxOS) && osarch.contains("i386")) { aroJpcapLibName = "jpcap32"; aroJpcapLibFileName = "lib" + aroJpcapLibName + unixExtn; } else { aroJpcapLibName = "jpcap"; aroJpcapLibFileName = "lib" + aroJpcapLibName + ".jnilib"; } } LOGGER.info("ARO Jpcap DLL lib file name: " + aroJpcapLibFileName); } }
PacketReaderImpl implements IPacketReader, INativePacketSubscriber { public void setAroJpcapLibName(String osname, String osarch) { LOGGER.info("OS: " + osname); LOGGER.info("OS Arch: " + osarch); if (osname != null && osarch != null) { if (osname.contains(windowsOS) && osarch.contains("64")) { aroJpcapLibName = "jpcap64"; aroJpcapLibFileName = aroJpcapLibName + windowsExtn; } else if (osname.contains(windowsOS)) { aroJpcapLibName = "jpcap"; aroJpcapLibFileName = aroJpcapLibName + windowsExtn; } else if (osname.contains(linuxOS) && osarch.contains("amd64")) { aroJpcapLibName = "jpcap64"; aroJpcapLibFileName = "lib" + aroJpcapLibName + unixExtn; } else if (osname.contains(linuxOS) && osarch.contains("i386")) { aroJpcapLibName = "jpcap32"; aroJpcapLibFileName = "lib" + aroJpcapLibName + unixExtn; } else { aroJpcapLibName = "jpcap"; aroJpcapLibFileName = "lib" + aroJpcapLibName + ".jnilib"; } } LOGGER.info("ARO Jpcap DLL lib file name: " + aroJpcapLibFileName); } PacketReaderImpl(); }
PacketReaderImpl implements IPacketReader, INativePacketSubscriber { public void setAroJpcapLibName(String osname, String osarch) { LOGGER.info("OS: " + osname); LOGGER.info("OS Arch: " + osarch); if (osname != null && osarch != null) { if (osname.contains(windowsOS) && osarch.contains("64")) { aroJpcapLibName = "jpcap64"; aroJpcapLibFileName = aroJpcapLibName + windowsExtn; } else if (osname.contains(windowsOS)) { aroJpcapLibName = "jpcap"; aroJpcapLibFileName = aroJpcapLibName + windowsExtn; } else if (osname.contains(linuxOS) && osarch.contains("amd64")) { aroJpcapLibName = "jpcap64"; aroJpcapLibFileName = "lib" + aroJpcapLibName + unixExtn; } else if (osname.contains(linuxOS) && osarch.contains("i386")) { aroJpcapLibName = "jpcap32"; aroJpcapLibFileName = "lib" + aroJpcapLibName + unixExtn; } else { aroJpcapLibName = "jpcap"; aroJpcapLibFileName = "lib" + aroJpcapLibName + ".jnilib"; } } LOGGER.info("ARO Jpcap DLL lib file name: " + aroJpcapLibFileName); } PacketReaderImpl(); void setAdapter(PCapAdapter adapter); @Override void readPacket(String packetfile, IPacketListener listener); void setVOLibName(); void setAroJpcapLibName(String osname, String osarch); String getAroJpcapLibFileName(); String getAroWebPLibName(); void setAroWebPLib(String osname, String osarch); String getAroWebPLibFileName(); @Override void receive(int datalink, long seconds, long microSeconds, int len, byte[] data); }
PacketReaderImpl implements IPacketReader, INativePacketSubscriber { public void setAroJpcapLibName(String osname, String osarch) { LOGGER.info("OS: " + osname); LOGGER.info("OS Arch: " + osarch); if (osname != null && osarch != null) { if (osname.contains(windowsOS) && osarch.contains("64")) { aroJpcapLibName = "jpcap64"; aroJpcapLibFileName = aroJpcapLibName + windowsExtn; } else if (osname.contains(windowsOS)) { aroJpcapLibName = "jpcap"; aroJpcapLibFileName = aroJpcapLibName + windowsExtn; } else if (osname.contains(linuxOS) && osarch.contains("amd64")) { aroJpcapLibName = "jpcap64"; aroJpcapLibFileName = "lib" + aroJpcapLibName + unixExtn; } else if (osname.contains(linuxOS) && osarch.contains("i386")) { aroJpcapLibName = "jpcap32"; aroJpcapLibFileName = "lib" + aroJpcapLibName + unixExtn; } else { aroJpcapLibName = "jpcap"; aroJpcapLibFileName = "lib" + aroJpcapLibName + ".jnilib"; } } LOGGER.info("ARO Jpcap DLL lib file name: " + aroJpcapLibFileName); } PacketReaderImpl(); void setAdapter(PCapAdapter adapter); @Override void readPacket(String packetfile, IPacketListener listener); void setVOLibName(); void setAroJpcapLibName(String osname, String osarch); String getAroJpcapLibFileName(); String getAroWebPLibName(); void setAroWebPLib(String osname, String osarch); String getAroWebPLibFileName(); @Override void receive(int datalink, long seconds, long microSeconds, int len, byte[] data); public String windowsOS; public String windowsExtn; public String linuxOS; }