iPXE
|
Name resolution. More...
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <ipxe/xfer.h>
#include <ipxe/open.h>
#include <ipxe/process.h>
#include <ipxe/socket.h>
#include <ipxe/resolv.h>
Go to the source code of this file.
Data Structures | |
struct | numeric_resolv |
A numeric name resolver. More... | |
struct | resolv_mux |
A name resolution multiplexer. More... | |
struct | named_socket |
A named socket. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
void | resolv_done (struct interface *intf, struct sockaddr *sa) |
Name resolved. More... | |
static void | numeric_step (struct numeric_resolv *numeric) |
static int | numeric_resolv (struct interface *resolv, const char *name, struct sockaddr *sa) |
struct resolver numeric_resolver | __resolver (RESOLV_NUMERIC) |
static int | resmux_try (struct resolv_mux *mux) |
Try current child name resolver. More... | |
static void | resmux_close (struct resolv_mux *mux, int rc) |
Close name resolution multiplexer. More... | |
static void | resmux_child_close (struct resolv_mux *mux, int rc) |
Child finished resolution. More... | |
int | resolv (struct interface *resolv, const char *name, struct sockaddr *sa) |
Start name resolution. More... | |
static void | named_close (struct named_socket *named, int rc) |
Terminate named socket opener. More... | |
static size_t | named_window (struct named_socket *named __unused) |
Check flow control window. More... | |
static void | named_resolv_done (struct named_socket *named, struct sockaddr *sa) |
Name resolved. More... | |
int | xfer_open_named_socket (struct interface *xfer, int semantics, struct sockaddr *peer, const char *name, struct sockaddr *local) |
Open named socket. More... | |
Variables | |
static struct process_descriptor | numeric_process_desc |
static struct interface_operation | resmux_child_op [] |
Name resolution multiplexer child interface operations. More... | |
static struct interface_descriptor | resmux_child_desc |
Name resolution multiplexer child interface descriptor. More... | |
static struct interface_operation | resmux_parent_op [] |
Name resolution multiplexer parent interface operations. More... | |
static struct interface_descriptor | resmux_parent_desc |
Name resolution multiplexer parent interface descriptor. More... | |
static struct interface_operation | named_xfer_ops [] |
Named socket opener data transfer interface operations. More... | |
static struct interface_descriptor | named_xfer_desc |
Named socket opener data transfer interface descriptor. More... | |
static struct interface_operation | named_resolv_op [] |
Named socket opener resolver interface operations. More... | |
static struct interface_descriptor | named_resolv_desc |
Named socket opener resolver interface descriptor. More... | |
Name resolution.
Definition in file resolv.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
Name resolved.
intf | Object interface |
sa | Completed socket address (if successful) |
Definition at line 55 of file resolv.c.
References DBGC, dest, interface::intf, INTF_COL, intf_get_dest_op, INTF_INTF_DBG, INTF_INTF_FMT, intf_object(), intf_put(), op, resolv_done(), resolv_done_TYPE, and sa.
Referenced by dns_resolved(), numeric_step(), and resolv_done().
|
static |
Definition at line 94 of file resolv.c.
References intf_shutdown(), numeric_resolv::rc, numeric_resolv::resolv, resolv_done(), and numeric_resolv::sa.
|
static |
Definition at line 104 of file resolv.c.
References ENOMEM, intf_init(), intf_plug_plug(), memcpy(), name, NULL, null_intf_desc, numeric_process_desc, numeric_resolv::process, process_init(), numeric_resolv::rc, ref_init, ref_put, numeric_resolv::refcnt, resolv(), numeric_resolv::resolv, sa, numeric_resolv::sa, sock_aton(), and zalloc().
struct resolver numeric_resolver __resolver | ( | RESOLV_NUMERIC | ) |
|
static |
Try current child name resolver.
mux | Name resolution multiplexer |
rc | Return status code |
Definition at line 166 of file resolv.c.
References resolv_mux::child, DBGC, resolver::name, resolv_mux::name, rc, resolver::resolv, resolv_mux::resolver, resolv_mux::sa, and strerror().
Referenced by resmux_child_close(), and resolv().
|
static |
Close name resolution multiplexer.
mux | Name resolution multiplexer |
rc | Reason for close |
Definition at line 188 of file resolv.c.
References resolv_mux::child, intf_shutdown(), resolv_mux::parent, and rc.
Referenced by resmux_child_close().
|
static |
Child finished resolution.
mux | Name resolution multiplexer |
rc | Return status code |
Definition at line 201 of file resolv.c.
References resolv_mux::child, DBGC, intf_restart(), resolver::name, rc, resmux_close(), resmux_try(), resolv_mux::resolver, RESOLVERS, and table_end.
Start name resolution.
resolv | Name resolution interface |
name | Name to resolve |
sa | Socket address to complete |
rc | Return status code |
Definition at line 257 of file resolv.c.
References resolv_mux::child, DBGC, ENOMEM, intf_init(), intf_plug_plug(), memcpy(), resolv_mux::name, name, NULL, resolv_mux::parent, rc, ref_init, ref_put, resolv_mux::refcnt, resmux_child_desc, resmux_parent_desc, resmux_try(), resolv(), resolv_mux::resolver, RESOLVERS, resolv_mux::sa, sa, strlen(), table_start, and zalloc().
Referenced by comboot_resolv(), dns_resolv(), numeric_resolv(), resolv(), resolv_setting(), and xfer_open_named_socket().
|
static |
Terminate named socket opener.
named | Named socket |
rc | Reason for termination |
Definition at line 323 of file resolv.c.
References intf_shutdown(), rc, named_socket::resolv, and named_socket::xfer.
Referenced by named_resolv_done().
|
static |
|
static |
Name resolved.
named | Named socket |
sa | Completed socket address |
Definition at line 357 of file resolv.c.
References DBGC, named_socket::have_local, intf_nullify(), intf_unplug(), named_socket::local, LOCATION_SOCKET, named_close(), NULL, rc, sa, named_socket::semantics, strerror(), named_socket::xfer, and xfer_redirect().
int xfer_open_named_socket | ( | struct interface * | xfer, |
int | semantics, | ||
struct sockaddr * | peer, | ||
const char * | name, | ||
struct sockaddr * | local | ||
) |
Open named socket.
semantics | Communication semantics (e.g. SOCK_STREAM) |
peer | Peer socket address to complete |
name | Name to resolve |
local | Local socket address, or NULL |
rc | Return status code |
Definition at line 402 of file resolv.c.
References DBGC, ENOMEM, named_socket::have_local, intf_init(), intf_plug_plug(), named_socket::local, memcpy(), name, named_resolv_desc, named_xfer_desc, NULL, peer, rc, ref_init, ref_put, named_socket::refcnt, named_socket::resolv, resolv(), named_socket::semantics, named_socket::xfer, and zalloc().
Referenced by apply_syslogs_settings(), create_pinger(), ftp_open(), http_connect(), iscsi_open_connection(), nfs_connect(), slam_open(), start_ntp(), tcp_open_uri(), tftp_reopen(), and udp_open_uri().
|
static |
Definition at line 101 of file resolv.c.
Referenced by numeric_resolv().
|
static |
Name resolution multiplexer child interface operations.
|
static |
Name resolution multiplexer child interface descriptor.
Definition at line 235 of file resolv.c.
Referenced by resolv().
|
static |
Name resolution multiplexer parent interface operations.
|
static |
Name resolution multiplexer parent interface descriptor.
Definition at line 245 of file resolv.c.
Referenced by resolv().
|
static |
Named socket opener data transfer interface operations.
|
static |
Named socket opener data transfer interface descriptor.
Definition at line 347 of file resolv.c.
Referenced by xfer_open_named_socket().
|
static |
Named socket opener resolver interface operations.
|
static |
Named socket opener resolver interface descriptor.
Definition at line 389 of file resolv.c.
Referenced by xfer_open_named_socket().