mirror of https://github.com/ipxe/ipxe.git
[dns] Report current DNS query as job progress status message
Signed-off-by: Michael Brown <mcb30@ipxe.org>pull/66/head
parent
53f273af90
commit
9faf069126
|
@ -42,6 +42,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||||
#include <ipxe/tcpip.h>
|
#include <ipxe/tcpip.h>
|
||||||
#include <ipxe/settings.h>
|
#include <ipxe/settings.h>
|
||||||
#include <ipxe/features.h>
|
#include <ipxe/features.h>
|
||||||
|
#include <ipxe/job.h>
|
||||||
#include <ipxe/dhcp.h>
|
#include <ipxe/dhcp.h>
|
||||||
#include <ipxe/dhcpv6.h>
|
#include <ipxe/dhcpv6.h>
|
||||||
#include <ipxe/dns.h>
|
#include <ipxe/dns.h>
|
||||||
|
@ -867,6 +868,22 @@ static void dns_xfer_close ( struct dns_request *dns, int rc ) {
|
||||||
dns_done ( dns, 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 */
|
/** DNS socket interface operations */
|
||||||
static struct interface_operation dns_socket_operations[] = {
|
static struct interface_operation dns_socket_operations[] = {
|
||||||
INTF_OP ( xfer_deliver, struct dns_request *, dns_xfer_deliver ),
|
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 */
|
/** DNS resolver interface operations */
|
||||||
static struct interface_operation dns_resolv_op[] = {
|
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 ),
|
INTF_OP ( intf_close, struct dns_request *, dns_done ),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue