diff --git a/golang/internal/ui/header.go b/golang/internal/ui/header.go index fac0019cb..07d55c583 100644 --- a/golang/internal/ui/header.go +++ b/golang/internal/ui/header.go @@ -58,9 +58,9 @@ func (u *ui) updateHeader(v *gocui.View, window5m *client.StatSnapshot) { window5m.Pcap.IfDrops, ) dnsc := window5m.DNS.WirePackets - _, _ = fmt.Fprintf(v, "DNS Wire Pkts %d (%3.1f%%) | Rates Total %d/s %d/%d/%d/%d | UDP %d (%3.1f%%) | TCP %d (%3.1f%%) | IPv4 %d (%3.1f%%) | IPv6 %d (%3.1f%%) | Query %d (%3.1f%%) | Response %d (%3.1f%%)\n", + _, _ = fmt.Fprintf(v, "DNS Wire Pkts %d/%d | Rates Total %d/s %d/%d/%d/%d | UDP %d (%3.1f%%) | TCP %d (%3.1f%%) | IPv4 %d (%3.1f%%) | IPv6 %d (%3.1f%%) | Query %d (%3.1f%%) | Response %d (%3.1f%%)\n", + dnsc.Total-dnsc.Filtered, dnsc.Total, - (float64(dnsc.Total)/float64(pcounts.Total))*100, dnsc.Rates.Total.Live, dnsc.Rates.Total.P50, dnsc.Rates.Total.P90, diff --git a/golang/pkg/client/types.go b/golang/pkg/client/types.go index d591d939d..3d918fb1b 100644 --- a/golang/pkg/client/types.go +++ b/golang/pkg/client/types.go @@ -21,6 +21,7 @@ type NameCount struct { // DNSPayload contains the information specifically for the DNS protocol type DNSPayload struct { WirePackets struct { + Filtered int64 `mapstructure:"filtered"` Ipv4 int64 `mapstructure:"ipv4"` Ipv6 int64 `mapstructure:"ipv6"` Queries int64 `mapstructure:"queries"` diff --git a/src/Configurable.h b/src/Configurable.h index 24daee946..83db16f2f 100644 --- a/src/Configurable.h +++ b/src/Configurable.h @@ -131,10 +131,23 @@ class Configurable for (YAML::const_iterator it = config_yaml.begin(); it != config_yaml.end(); ++it) { auto key = it->first.as(); - if (!it->second.IsScalar()) { + if (!it->second.IsScalar() && !it->second.IsSequence()) { throw ConfigException(fmt::format("invalid value for key: {}", key)); } + if (it->second.IsSequence()) { + StringList sl; + for (std::size_t i = 0; i < it->second.size(); ++i) { + if (!it->second[i].IsScalar()) { + throw ConfigException(fmt::format("invalid value for sequence in key: {}", key)); + } + sl.push_back(it->second[i].as()); + } + _config[key] = sl; + continue; + } + + // otherwise, scalar auto value = it->second.as(); // the yaml library doesn't discriminate between scalar types, so we have to do that ourselves