@Test public void testMissingOptionsTemplate() throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(bos); out.writeShort(9); out.writeShort(1); out.writeInt(10); out.writeInt(20); out.writeInt(1); out.writeInt(20); out.writeShort(260); out.writeShort(8); out.writeShort(7); out.writeShort(765); List<TSDRLogRecord> records = parseRecords(bos.toByteArray()); assertEquals(0, records.size()); bos = new ByteArrayOutputStream(); out = new DataOutputStream(bos); out.writeShort(9); out.writeShort(1); out.writeInt(30); out.writeInt(40); out.writeInt(2); out.writeInt(20); out.writeShort(1); out.writeShort(24); out.writeShort(260); out.writeShort(4); out.writeShort(4); out.writeShort(4); out.writeShort(2); out.writeShort(41); out.writeShort(2); assertEquals(0, parseRecords(bos.toByteArray()).size()); assertEquals(1, records.size()); Map<String, String> attrs = toMap(records.get(0).getRecordAttributes()); assertEquals(Long.valueOf(20L * 1000), records.get(0).getTimeStamp()); assertEquals("10", attrs.remove("sys_uptime")); assertEquals("1", attrs.remove("package_sequence")); assertEquals("20", attrs.remove("source_id")); assertEquals("765", attrs.remove("TOTAL_PKTS_EXP")); assertEquals("Options record for Cache 7", records.get(0).getRecordFullText()); }
@Override public void parseRecords() { while (recordCounter < totalRecordCount && !endOfData()) { final OptionalInt possibleCount = parseNextRecords(); if (!possibleCount.isPresent()) { return; } recordCounter += possibleCount.getAsInt(); } missingTemplateCache.checkTemplates(); }
NetflowV9PacketParser extends AbstractNetflowPacketParser { @Override public void parseRecords() { while (recordCounter < totalRecordCount && !endOfData()) { final OptionalInt possibleCount = parseNextRecords(); if (!possibleCount.isPresent()) { return; } recordCounter += possibleCount.getAsInt(); } missingTemplateCache.checkTemplates(); } }
NetflowV9PacketParser extends AbstractNetflowPacketParser { @Override public void parseRecords() { while (recordCounter < totalRecordCount && !endOfData()) { final OptionalInt possibleCount = parseNextRecords(); if (!possibleCount.isPresent()) { return; } recordCounter += possibleCount.getAsInt(); } missingTemplateCache.checkTemplates(); } NetflowV9PacketParser(byte[] data, int initialPosition, String sourceIP, FlowsetTemplateCache flowsetTemplateCache,
            OptionsTemplateCache optionsTemplateCache, MissingTemplateCache missingTemplateCache,
            TSDRLogRecordBuilder recordBuilder, Consumer<TSDRLogRecordBuilder> callback); private  NetflowV9PacketParser(NetflowV9PacketParser other, int fromPosition, int bytesToCopy); }
NetflowV9PacketParser extends AbstractNetflowPacketParser { @Override public void parseRecords() { while (recordCounter < totalRecordCount && !endOfData()) { final OptionalInt possibleCount = parseNextRecords(); if (!possibleCount.isPresent()) { return; } recordCounter += possibleCount.getAsInt(); } missingTemplateCache.checkTemplates(); } NetflowV9PacketParser(byte[] data, int initialPosition, String sourceIP, FlowsetTemplateCache flowsetTemplateCache,
            OptionsTemplateCache optionsTemplateCache, MissingTemplateCache missingTemplateCache,
            TSDRLogRecordBuilder recordBuilder, Consumer<TSDRLogRecordBuilder> callback); private  NetflowV9PacketParser(NetflowV9PacketParser other, int fromPosition, int bytesToCopy); @Override void parseRecords(); }
NetflowV9PacketParser extends AbstractNetflowPacketParser { @Override public void parseRecords() { while (recordCounter < totalRecordCount && !endOfData()) { final OptionalInt possibleCount = parseNextRecords(); if (!possibleCount.isPresent()) { return; } recordCounter += possibleCount.getAsInt(); } missingTemplateCache.checkTemplates(); } NetflowV9PacketParser(byte[] data, int initialPosition, String sourceIP, FlowsetTemplateCache flowsetTemplateCache,
            OptionsTemplateCache optionsTemplateCache, MissingTemplateCache missingTemplateCache,
            TSDRLogRecordBuilder recordBuilder, Consumer<TSDRLogRecordBuilder> callback); private  NetflowV9PacketParser(NetflowV9PacketParser other, int fromPosition, int bytesToCopy); @Override void parseRecords();  }