public static void Icmpv4Parsing()
        {
            FileUtil.NormalizeLineEndings("snmp", "snmp_normalized1");
            Icmpv4StatisticsTable table = StringParsingHelpers.ParseIcmpv4FromSnmpFile("snmp_normalized1");

            Assert.Equal(1, table.InMsgs);
            Assert.Equal(2, table.InErrors);
            Assert.Equal(3, table.InCsumErrors);
            Assert.Equal(4, table.InDestUnreachs);
            Assert.Equal(5, table.InTimeExcds);
            Assert.Equal(6, table.InParmProbs);
            Assert.Equal(7, table.InSrcQuenchs);
            Assert.Equal(8, table.InRedirects);
            Assert.Equal(9, table.InEchos);
            Assert.Equal(10, table.InEchoReps);
            Assert.Equal(20, table.InTimestamps);
            Assert.Equal(30, table.InTimeStampReps);
            Assert.Equal(40, table.InAddrMasks);
            Assert.Equal(50, table.InAddrMaskReps);
            Assert.Equal(60, table.OutMsgs);
            Assert.Equal(70, table.OutErrors);
            Assert.Equal(80, table.OutDestUnreachs);
            Assert.Equal(90, table.OutTimeExcds);
            Assert.Equal(100, table.OutParmProbs);
            Assert.Equal(255, table.OutSrcQuenchs);
            Assert.Equal(1024, table.OutRedirects);
            Assert.Equal(256, table.OutEchos);
            Assert.Equal(9001, table.OutEchoReps);
            Assert.Equal(42, table.OutTimestamps);
            Assert.Equal(4100414, table.OutTimestampReps);
            Assert.Equal(2147483647, table.OutAddrMasks);
            Assert.Equal(0, table.OutAddrMaskReps);
        }
        public void Icmpv4Parsing()
        {
            string fileName = GetTestFilePath();

            FileUtil.NormalizeLineEndings("NetworkFiles/snmp", fileName);
            Icmpv4StatisticsTable table = StringParsingHelpers.ParseIcmpv4FromSnmpFile(fileName);

            Assert.Equal(1L, table.InMsgs);
            Assert.Equal(2L, table.InErrors);
            Assert.Equal(3L, table.InCsumErrors);
            Assert.Equal(4L, table.InDestUnreachs);
            Assert.Equal(5L, table.InTimeExcds);
            Assert.Equal(6L, table.InParmProbs);
            Assert.Equal(7L, table.InSrcQuenchs);
            Assert.Equal(8L, table.InRedirects);
            Assert.Equal(9L, table.InEchos);
            Assert.Equal(10L, table.InEchoReps);
            Assert.Equal(20L, table.InTimestamps);
            Assert.Equal(30L, table.InTimeStampReps);
            Assert.Equal(40L, table.InAddrMasks);
            Assert.Equal(50L, table.InAddrMaskReps);
            Assert.Equal(60L, table.OutMsgs);
            Assert.Equal(70L, table.OutErrors);
            Assert.Equal(80L, table.OutDestUnreachs);
            Assert.Equal(90L, table.OutTimeExcds);
            Assert.Equal(100L, table.OutParmProbs);
            Assert.Equal(255L, table.OutSrcQuenchs);
            Assert.Equal(1024L, table.OutRedirects);
            Assert.Equal(256L, table.OutEchos);
            Assert.Equal(9001L, table.OutEchoReps);
            Assert.Equal(42L, table.OutTimestamps);
            Assert.Equal(4100414L, table.OutTimestampReps);
            Assert.Equal(2147483647L, table.OutAddrMasks);
            Assert.Equal(0L, table.OutAddrMaskReps);
        }
Пример #3
0
 // The table is a fairly large struct (108 bytes), pass it by reference
 public LinuxIcmpV4Statistics()
 {
     _table = StringParsingHelpers.ParseIcmpv4FromSnmpFile(NetworkFiles.SnmpV4StatsFile);
 }
 // The table is a fairly large struct (108 bytes), pass it by reference
 public LinuxIcmpV4Statistics()
 {
     _table = StringParsingHelpers.ParseIcmpv4FromSnmpFile(NetworkFiles.SnmpV4StatsFile);
 }