// NewUdp creates and returns a new Udp. func NewUdp(p protos.Protocols) (*Udp, error) { portMap, err := buildPortsMap(p.GetAllUdp()) if err != nil { return nil, err } udp := &Udp{protocols: p, portMap: portMap} logp.Debug("udp", "Port map: %v", portMap) return udp, nil }