summaryrefslogtreecommitdiffstats
path: root/src/net
diff options
context:
space:
mode:
authorMichael Brown2017-09-06 12:46:13 +0200
committerMichael Brown2017-09-06 12:46:13 +0200
commit9faf069126b37cef87a47209b661de434d9e71cf (patch)
tree260bd21bceeea8c4be3de5c2643e84ed2818a945 /src/net
parent[resolv] Use pass-through interfaces for name resolution multiplexer (diff)
downloadipxe-9faf069126b37cef87a47209b661de434d9e71cf.tar.gz
ipxe-9faf069126b37cef87a47209b661de434d9e71cf.tar.xz
ipxe-9faf069126b37cef87a47209b661de434d9e71cf.zip
[dns] Report current DNS query as job progress status message
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net')
-rw-r--r--src/net/udp/dns.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/net/udp/dns.c b/src/net/udp/dns.c
index e849472d..897e0f85 100644
--- a/src/net/udp/dns.c
+++ b/src/net/udp/dns.c
@@ -42,6 +42,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <ipxe/tcpip.h>
#include <ipxe/settings.h>
#include <ipxe/features.h>
+#include <ipxe/job.h>
#include <ipxe/dhcp.h>
#include <ipxe/dhcpv6.h>
#include <ipxe/dns.h>
@@ -867,6 +868,22 @@ static void dns_xfer_close ( struct dns_request *dns, int rc ) {
dns_done ( dns, rc );
}
+/**
+ * Report job progress
+ *
+ * @v dns DNS request
+ * @v progress Progress report to fill in
+ * @ret ongoing_rc Ongoing job status code (if known)
+ */
+static int dns_progress ( struct dns_request *dns,
+ struct job_progress *progress ) {
+
+ /* Show current question as progress message */
+ dns_decode ( &dns->name, progress->message,
+ sizeof ( progress->message ) );
+ return 0;
+}
+
/** DNS socket interface operations */
static struct interface_operation dns_socket_operations[] = {
INTF_OP ( xfer_deliver, struct dns_request *, dns_xfer_deliver ),
@@ -879,6 +896,7 @@ static struct interface_descriptor dns_socket_desc =
/** DNS resolver interface operations */
static struct interface_operation dns_resolv_op[] = {
+ INTF_OP ( job_progress, struct dns_request *, dns_progress ),
INTF_OP ( intf_close, struct dns_request *, dns_done ),
};