new: parsing UPNP discovery responses to get metadata about the endpoints

This commit is contained in:
evilsocket 2018-09-12 11:56:07 +02:00
parent 02f445c42c
commit 3d312a9cdf
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
2 changed files with 37 additions and 11 deletions

View file

@ -166,19 +166,13 @@ func (q *Queue) TrackError() {
func (q *Queue) getPacketMeta(pkt gopacket.Packet) map[string]string {
meta := make(map[string]string)
if mdns := MDNSGetMeta(pkt); mdns != nil {
for k, v := range mdns {
meta[k] = v
}
meta = mdns
} else if nbns := NBNSGetMeta(pkt); nbns != nil {
meta = nbns
} else if upnp := UPNPGetMeta(pkt); upnp != nil {
meta = upnp
}
if nbns := NBNSGetMeta(pkt); nbns != nil {
for k, v := range nbns {
meta[k] = v
}
}
return meta
}