Improve logging, support pre-authorized ports

This commit is contained in:
Daniel
2019-05-10 11:57:18 +02:00
parent 55ef385dcb
commit e72ed023db
5 changed files with 118 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
package network
import (
"context"
"errors"
"fmt"
"net"
@@ -235,9 +236,9 @@ var (
)
// GetCommunicationByDNSRequest returns the matching communication from the internal storage.
func GetCommunicationByDNSRequest(ip net.IP, port uint16, fqdn string) (*Communication, error) {
func GetCommunicationByDNSRequest(ctx context.Context, ip net.IP, port uint16, fqdn string) (*Communication, error) {
// get Process
proc, err := process.GetProcessByEndpoints(ip, port, dnsAddress, dnsPort, packet.UDP)
proc, err := process.GetProcessByEndpoints(ctx, ip, port, dnsAddress, dnsPort, packet.UDP)
if err != nil {
return nil, err
}