iPXE
Data Structures | Functions | Variables
resolv.c File Reference

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...
 

Detailed Description

Name resolution.

Definition in file resolv.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ resolv_done()

void resolv_done ( struct interface intf,
struct sockaddr sa 
)

Name resolved.

Parameters
intfObject interface
saCompleted socket address (if successful)

Definition at line 55 of file resolv.c.

55  {
56  struct interface *dest;
57  resolv_done_TYPE ( void * ) *op =
58  intf_get_dest_op ( intf, resolv_done, &dest );
59  void *object = intf_object ( dest );
60 
61  DBGC ( INTF_COL ( intf ), "INTF " INTF_INTF_FMT " resolv_done\n",
62  INTF_INTF_DBG ( intf, dest ) );
63 
64  if ( op ) {
65  op ( object, sa );
66  } else {
67  /* Default is to ignore resolutions */
68  }
69 
70  intf_put ( dest );
71 }
#define INTF_INTF_FMT
printf() format string for INTF_INTF_DBG()
Definition: interface.h:240
struct sockaddr sa
Definition: dns.c:68
void resolv_done(struct interface *intf, struct sockaddr *sa)
Name resolved.
Definition: resolv.c:55
#define INTF_INTF_DBG(intf, dest)
printf() arguments for representing an object interface pair
Definition: interface.h:249
#define INTF_COL(intf)
Find debugging colourisation for an object interface.
Definition: interface.h:226
#define DBGC(...)
Definition: compiler.h:505
void * intf_object(struct interface *intf)
Get pointer to object containing object interface.
Definition: interface.c:154
An object interface.
Definition: interface.h:109
static void * dest
Definition: strings.h:176
static uint16_t struct vmbus_xfer_pages_operations * op
Definition: netvsc.h:327
void intf_put(struct interface *intf)
Decrement reference count on an object interface.
Definition: interface.c:144
#define resolv_done_TYPE(object_type)
Definition: resolv.h:45
#define intf_get_dest_op(intf, type, dest)
Get object interface destination and operation method.
Definition: interface.h:214

References DBGC, dest, 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().

◆ numeric_step()

static void numeric_step ( struct numeric_resolv numeric)
static

Definition at line 94 of file resolv.c.

94  {
95 
96  if ( numeric->rc == 0 )
97  resolv_done ( &numeric->resolv, &numeric->sa );
98  intf_shutdown ( &numeric->resolv, numeric->rc );
99 }
void intf_shutdown(struct interface *intf, int rc)
Shut down an object interface.
Definition: interface.c:273
void resolv_done(struct interface *intf, struct sockaddr *sa)
Name resolved.
Definition: resolv.c:55
struct interface resolv
Name resolution interface.
Definition: resolv.c:85
int rc
Overall status code.
Definition: resolv.c:91
struct sockaddr sa
Completed socket address.
Definition: resolv.c:89

References intf_shutdown(), numeric_resolv::rc, numeric_resolv::resolv, resolv_done(), and numeric_resolv::sa.

◆ numeric_resolv()

static int numeric_resolv ( struct interface resolv,
const char *  name,
struct sockaddr sa 
)
static

Definition at line 104 of file resolv.c.

105  {
106  struct numeric_resolv *numeric;
107 
108  /* Allocate and initialise structure */
109  numeric = zalloc ( sizeof ( *numeric ) );
110  if ( ! numeric )
111  return -ENOMEM;
112  ref_init ( &numeric->refcnt, NULL );
113  intf_init ( &numeric->resolv, &null_intf_desc, &numeric->refcnt );
115  &numeric->refcnt );
116  memcpy ( &numeric->sa, sa, sizeof ( numeric->sa ) );
117 
118  /* Attempt to resolve name */
119  numeric->rc = sock_aton ( name, &numeric->sa );
120 
121  /* Attach to parent interface, mortalise self, and return */
122  intf_plug_plug ( &numeric->resolv, resolv );
123  ref_put ( &numeric->refcnt );
124  return 0;
125 }
const char * name
Definition: ath9k_hw.c:1984
A numeric name resolver.
Definition: resolv.c:81
struct interface_descriptor null_intf_desc
Null interface descriptor.
Definition: interface.c:61
struct sockaddr sa
Definition: dns.c:68
#define ref_init(refcnt, free)
Initialise a reference counter.
Definition: refcnt.h:64
struct interface resolv
Name resolution interface.
Definition: resolv.c:85
static void process_init(struct process *process, struct process_descriptor *desc, struct refcnt *refcnt)
Initialise process and add to process list.
Definition: process.h:161
int rc
Overall status code.
Definition: resolv.c:91
void intf_plug_plug(struct interface *a, struct interface *b)
Plug two object interfaces together.
Definition: interface.c:102
struct refcnt refcnt
Reference counter.
Definition: resolv.c:83
int sock_aton(const char *string, struct sockaddr *sa)
Parse socket address.
Definition: socket.c:59
#define ENOMEM
Not enough space.
Definition: errno.h:534
void * memcpy(void *dest, const void *src, size_t len) __nonnull
void * zalloc(size_t size)
Allocate cleared memory.
Definition: malloc.c:624
struct process process
Process.
Definition: resolv.c:87
int resolv(struct interface *resolv, const char *name, struct sockaddr *sa)
Start name resolution.
Definition: resolv.c:257
static struct process_descriptor numeric_process_desc
Definition: resolv.c:101
static void intf_init(struct interface *intf, struct interface_descriptor *desc, struct refcnt *refcnt)
Initialise an object interface.
Definition: interface.h:173
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
#define ref_put(refcnt)
Drop reference to object.
Definition: refcnt.h:106
struct sockaddr sa
Completed socket address.
Definition: resolv.c:89

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, numeric_resolv::sa, sa, sock_aton(), and zalloc().

◆ __resolver()

struct resolver numeric_resolver __resolver ( RESOLV_NUMERIC  )

◆ resmux_try()

static int resmux_try ( struct resolv_mux mux)
static

Try current child name resolver.

Parameters
muxName resolution multiplexer
Return values
rcReturn status code

Definition at line 166 of file resolv.c.

166  {
167  struct resolver *resolver = mux->resolver;
168  int rc;
169 
170  DBGC ( mux, "RESOLV %p trying method %s\n", mux, resolver->name );
171 
172  if ( ( rc = resolver->resolv ( &mux->child, mux->name,
173  &mux->sa ) ) != 0 ) {
174  DBGC ( mux, "RESOLV %p could not use method %s: %s\n",
175  mux, resolver->name, strerror ( rc ) );
176  return rc;
177  }
178 
179  return 0;
180 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
struct resolver * resolver
Current child resolver.
Definition: resolv.c:149
#define DBGC(...)
Definition: compiler.h:505
struct sockaddr sa
Socket address to complete.
Definition: resolv.c:152
char name[0]
Name to be resolved.
Definition: resolv.c:157
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
int(* resolv)(struct interface *resolv, const char *name, struct sockaddr *sa)
Start name resolution.
Definition: resolv.h:28
A name resolver.
Definition: resolv.h:18
const char * name
Name of this resolver (e.g.
Definition: resolv.h:20
struct interface child
Child name resolution interface.
Definition: resolv.c:147

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().

◆ resmux_close()

static void resmux_close ( struct resolv_mux mux,
int  rc 
)
static

Close name resolution multiplexer.

Parameters
muxName resolution multiplexer
rcReason for close

Definition at line 188 of file resolv.c.

188  {
189 
190  /* Shut down all interfaces */
191  intf_shutdown ( &mux->child, rc );
192  intf_shutdown ( &mux->parent, rc );
193 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
void intf_shutdown(struct interface *intf, int rc)
Shut down an object interface.
Definition: interface.c:273
struct interface parent
Parent name resolution interface.
Definition: resolv.c:144
struct interface child
Child name resolution interface.
Definition: resolv.c:147

References resolv_mux::child, intf_shutdown(), resolv_mux::parent, and rc.

Referenced by resmux_child_close().

◆ resmux_child_close()

static void resmux_child_close ( struct resolv_mux mux,
int  rc 
)
static

Child finished resolution.

Parameters
muxName resolution multiplexer
rcReturn status code

Definition at line 201 of file resolv.c.

201  {
202 
203  /* Restart child interface */
204  intf_restart ( &mux->child, rc );
205 
206  /* If this resolution succeeded, stop now */
207  if ( rc == 0 ) {
208  DBGC ( mux, "RESOLV %p succeeded using method %s\n",
209  mux, mux->resolver->name );
210  goto finished;
211  }
212 
213  /* Attempt next child resolver, if possible */
214  mux->resolver++;
215  if ( mux->resolver >= table_end ( RESOLVERS ) ) {
216  DBGC ( mux, "RESOLV %p failed to resolve name\n", mux );
217  goto finished;
218  }
219  if ( ( rc = resmux_try ( mux ) ) != 0 )
220  goto finished;
221 
222  /* Next resolver is now running */
223  return;
224 
225  finished:
226  resmux_close ( mux, rc );
227 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
void intf_restart(struct interface *intf, int rc)
Shut down and restart an object interface.
Definition: interface.c:337
static void resmux_close(struct resolv_mux *mux, int rc)
Close name resolution multiplexer.
Definition: resolv.c:188
struct resolver * resolver
Current child resolver.
Definition: resolv.c:149
#define DBGC(...)
Definition: compiler.h:505
static int resmux_try(struct resolv_mux *mux)
Try current child name resolver.
Definition: resolv.c:166
const char * name
Name of this resolver (e.g.
Definition: resolv.h:20
#define table_end(table)
Get end of linker table.
Definition: tables.h:289
struct interface child
Child name resolution interface.
Definition: resolv.c:147
#define RESOLVERS
Resolvers table.
Definition: resolv.h:39

References resolv_mux::child, DBGC, intf_restart(), resolver::name, rc, resmux_close(), resmux_try(), resolv_mux::resolver, RESOLVERS, and table_end.

◆ resolv()

int resolv ( struct interface resolv,
const char *  name,
struct sockaddr sa 
)

Start name resolution.

Parameters
resolvName resolution interface
nameName to resolve
saSocket address to complete
Return values
rcReturn status code

Definition at line 257 of file resolv.c.

258  {
259  struct resolv_mux *mux;
260  size_t name_len = ( strlen ( name ) + 1 );
261  int rc;
262 
263  /* Allocate and initialise structure */
264  mux = zalloc ( sizeof ( *mux ) + name_len );
265  if ( ! mux )
266  return -ENOMEM;
267  ref_init ( &mux->refcnt, NULL );
268  intf_init ( &mux->parent, &resmux_parent_desc, &mux->refcnt );
269  intf_init ( &mux->child, &resmux_child_desc, &mux->refcnt );
270  mux->resolver = table_start ( RESOLVERS );
271  if ( sa )
272  memcpy ( &mux->sa, sa, sizeof ( mux->sa ) );
273  memcpy ( mux->name, name, name_len );
274 
275  DBGC ( mux, "RESOLV %p attempting to resolve \"%s\"\n", mux, name );
276 
277  /* Start first resolver in chain. There will always be at
278  * least one resolver (the numeric resolver), so no need to
279  * check for the zero-resolvers-available case.
280  */
281  if ( ( rc = resmux_try ( mux ) ) != 0 )
282  goto err;
283 
284  /* Attach parent interface, mortalise self, and return */
285  intf_plug_plug ( &mux->parent, resolv );
286  ref_put ( &mux->refcnt );
287  return 0;
288 
289  err:
290  ref_put ( &mux->refcnt );
291  return rc;
292 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
const char * name
Definition: ath9k_hw.c:1984
struct resolver * resolver
Current child resolver.
Definition: resolv.c:149
struct sockaddr sa
Definition: dns.c:68
#define table_start(table)
Get start of linker table.
Definition: tables.h:271
#define ref_init(refcnt, free)
Initialise a reference counter.
Definition: refcnt.h:64
#define DBGC(...)
Definition: compiler.h:505
void intf_plug_plug(struct interface *a, struct interface *b)
Plug two object interfaces together.
Definition: interface.c:102
A name resolution multiplexer.
Definition: resolv.c:140
struct sockaddr sa
Socket address to complete.
Definition: resolv.c:152
struct interface parent
Parent name resolution interface.
Definition: resolv.c:144
static int resmux_try(struct resolv_mux *mux)
Try current child name resolver.
Definition: resolv.c:166
#define ENOMEM
Not enough space.
Definition: errno.h:534
void * memcpy(void *dest, const void *src, size_t len) __nonnull
char name[0]
Name to be resolved.
Definition: resolv.c:157
void * zalloc(size_t size)
Allocate cleared memory.
Definition: malloc.c:624
static struct interface_descriptor resmux_child_desc
Name resolution multiplexer child interface descriptor.
Definition: resolv.c:235
size_t strlen(const char *src)
Get length of string.
Definition: string.c:213
struct refcnt refcnt
Reference counter.
Definition: resolv.c:142
int resolv(struct interface *resolv, const char *name, struct sockaddr *sa)
Start name resolution.
Definition: resolv.c:257
static struct interface_descriptor resmux_parent_desc
Name resolution multiplexer parent interface descriptor.
Definition: resolv.c:245
static void intf_init(struct interface *intf, struct interface_descriptor *desc, struct refcnt *refcnt)
Initialise an object interface.
Definition: interface.h:173
struct interface child
Child name resolution interface.
Definition: resolv.c:147
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
#define RESOLVERS
Resolvers table.
Definition: resolv.h:39
#define ref_put(refcnt)
Drop reference to object.
Definition: refcnt.h:106

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().

◆ named_close()

static void named_close ( struct named_socket named,
int  rc 
)
static

Terminate named socket opener.

Parameters
namedNamed socket
rcReason for termination

Definition at line 323 of file resolv.c.

323  {
324  /* Shut down interfaces */
325  intf_shutdown ( &named->resolv, rc );
326  intf_shutdown ( &named->xfer, rc );
327 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
struct interface xfer
Data transfer interface.
Definition: resolv.c:306
void intf_shutdown(struct interface *intf, int rc)
Shut down an object interface.
Definition: interface.c:273
struct interface resolv
Name resolution interface.
Definition: resolv.c:308

References intf_shutdown(), rc, named_socket::resolv, and named_socket::xfer.

Referenced by named_resolv_done().

◆ named_window()

static size_t named_window ( struct named_socket *named  __unused)
static

Check flow control window.

Parameters
namedNamed socket
Return values
lenLength of window

Definition at line 335 of file resolv.c.

335  {
336  /* Not ready for data until we have redirected away */
337  return 0;
338 }

◆ named_resolv_done()

static void named_resolv_done ( struct named_socket named,
struct sockaddr sa 
)
static

Name resolved.

Parameters
namedNamed socket
saCompleted socket address

Definition at line 357 of file resolv.c.

358  {
359  int rc;
360 
361  /* Nullify data transfer interface */
362  intf_nullify ( &named->xfer );
363 
364  /* Redirect data-xfer interface */
365  if ( ( rc = xfer_redirect ( &named->xfer, LOCATION_SOCKET,
366  named->semantics, sa,
367  ( named->have_local ?
368  &named->local : NULL ) ) ) != 0 ) {
369  /* Redirection failed - do not unplug data-xfer interface */
370  DBGC ( named, "NAMED %p could not redirect: %s\n",
371  named, strerror ( rc ) );
372  } else {
373  /* Redirection succeeded - unplug data-xfer interface */
374  DBGC ( named, "NAMED %p redirected successfully\n", named );
375  intf_unplug ( &named->xfer );
376  }
377 
378  /* Terminate named socket opener */
379  named_close ( named, rc );
380 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
struct interface xfer
Data transfer interface.
Definition: resolv.c:306
struct sockaddr sa
Definition: dns.c:68
int semantics
Communication semantics (e.g.
Definition: resolv.c:310
int have_local
Stored local socket address exists.
Definition: resolv.c:314
#define DBGC(...)
Definition: compiler.h:505
struct sockaddr local
Stored local socket address, if applicable.
Definition: resolv.c:312
void intf_unplug(struct interface *intf)
Unplug an object interface.
Definition: interface.c:112
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
void intf_nullify(struct interface *intf)
Ignore all further operations on an object interface.
Definition: interface.c:124
Location is a socket.
Definition: open.h:43
static void named_close(struct named_socket *named, int rc)
Terminate named socket opener.
Definition: resolv.c:323
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
int xfer_redirect(struct interface *intf, int type,...)
Send redirection event.
Definition: xfer.c:237

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().

◆ xfer_open_named_socket()

int xfer_open_named_socket ( struct interface xfer,
int  semantics,
struct sockaddr peer,
const char *  name,
struct sockaddr local 
)

Open named socket.

Parameters
semanticsCommunication semantics (e.g. SOCK_STREAM)
peerPeer socket address to complete
nameName to resolve
localLocal socket address, or NULL
Return values
rcReturn status code

Definition at line 402 of file resolv.c.

404  {
405  struct named_socket *named;
406  int rc;
407 
408  /* Allocate and initialise structure */
409  named = zalloc ( sizeof ( *named ) );
410  if ( ! named )
411  return -ENOMEM;
412  ref_init ( &named->refcnt, NULL );
413  intf_init ( &named->xfer, &named_xfer_desc, &named->refcnt );
414  intf_init ( &named->resolv, &named_resolv_desc, &named->refcnt );
415  named->semantics = semantics;
416  if ( local ) {
417  memcpy ( &named->local, local, sizeof ( named->local ) );
418  named->have_local = 1;
419  }
420 
421  DBGC ( named, "NAMED %p opening \"%s\"\n",
422  named, name );
423 
424  /* Start name resolution */
425  if ( ( rc = resolv ( &named->resolv, name, peer ) ) != 0 )
426  goto err;
427 
428  /* Attach parent interface, mortalise self, and return */
429  intf_plug_plug ( &named->xfer, xfer );
430  ref_put ( &named->refcnt );
431  return 0;
432 
433  err:
434  ref_put ( &named->refcnt );
435  return rc;
436 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
const char * name
Definition: ath9k_hw.c:1984
struct interface xfer
Data transfer interface.
Definition: resolv.c:306
int semantics
Communication semantics (e.g.
Definition: resolv.c:310
#define ref_init(refcnt, free)
Initialise a reference counter.
Definition: refcnt.h:64
struct refcnt refcnt
Reference counter.
Definition: resolv.c:304
int have_local
Stored local socket address exists.
Definition: resolv.c:314
#define DBGC(...)
Definition: compiler.h:505
void intf_plug_plug(struct interface *a, struct interface *b)
Plug two object interfaces together.
Definition: interface.c:102
static struct interface_descriptor named_resolv_desc
Named socket opener resolver interface descriptor.
Definition: resolv.c:389
#define ENOMEM
Not enough space.
Definition: errno.h:534
void * memcpy(void *dest, const void *src, size_t len) __nonnull
struct sockaddr local
Stored local socket address, if applicable.
Definition: resolv.c:312
A named socket.
Definition: resolv.c:302
void * zalloc(size_t size)
Allocate cleared memory.
Definition: malloc.c:624
struct interface resolv
Name resolution interface.
Definition: resolv.c:308
int resolv(struct interface *resolv, const char *name, struct sockaddr *sa)
Start name resolution.
Definition: resolv.c:257
static struct interface_descriptor named_xfer_desc
Named socket opener data transfer interface descriptor.
Definition: resolv.c:347
static void intf_init(struct interface *intf, struct interface_descriptor *desc, struct refcnt *refcnt)
Initialise an object interface.
Definition: interface.h:173
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
#define ref_put(refcnt)
Drop reference to object.
Definition: refcnt.h:106

References DBGC, ENOMEM, named_socket::have_local, intf_init(), intf_plug_plug(), named_socket::local, memcpy(), name, named_resolv_desc, named_xfer_desc, NULL, 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().

Variable Documentation

◆ numeric_process_desc

struct process_descriptor numeric_process_desc
static
Initial value:
=
A process.
Definition: process.h:17
A numeric name resolver.
Definition: resolv.c:81
#define PROC_DESC_ONCE(object_type, process, _step)
Define a process descriptor for a process that runs only once.
Definition: process.h:97
static void numeric_step(struct numeric_resolv *numeric)
Definition: resolv.c:94

Definition at line 101 of file resolv.c.

Referenced by numeric_resolv().

◆ resmux_child_op

struct interface_operation resmux_child_op[]
static
Initial value:
= {
}
void intf_close(struct interface *intf, int rc)
Close an object interface.
Definition: interface.c:244
A name resolution multiplexer.
Definition: resolv.c:140
#define INTF_OP(op_type, object_type, op_func)
Define an object interface operation.
Definition: interface.h:32
static void resmux_child_close(struct resolv_mux *mux, int rc)
Child finished resolution.
Definition: resolv.c:201

Name resolution multiplexer child interface operations.

Definition at line 230 of file resolv.c.

◆ resmux_child_desc

struct interface_descriptor resmux_child_desc
static
Initial value:
=
parent )
static struct interface_operation resmux_child_op[]
Name resolution multiplexer child interface operations.
Definition: resolv.c:230
A name resolution multiplexer.
Definition: resolv.c:140
#define INTF_DESC_PASSTHRU(object_type, intf, operations, passthru)
Define an object interface descriptor with pass-through interface.
Definition: interface.h:82

Name resolution multiplexer child interface descriptor.

Definition at line 235 of file resolv.c.

Referenced by resolv().

◆ resmux_parent_op

struct interface_operation resmux_parent_op[]
static
Initial value:
= {
}
void intf_close(struct interface *intf, int rc)
Close an object interface.
Definition: interface.c:244
static void resmux_close(struct resolv_mux *mux, int rc)
Close name resolution multiplexer.
Definition: resolv.c:188
A name resolution multiplexer.
Definition: resolv.c:140
#define INTF_OP(op_type, object_type, op_func)
Define an object interface operation.
Definition: interface.h:32

Name resolution multiplexer parent interface operations.

Definition at line 240 of file resolv.c.

◆ resmux_parent_desc

struct interface_descriptor resmux_parent_desc
static
Initial value:
=
child )
A name resolution multiplexer.
Definition: resolv.c:140
static struct interface_operation resmux_parent_op[]
Name resolution multiplexer parent interface operations.
Definition: resolv.c:240
#define INTF_DESC_PASSTHRU(object_type, intf, operations, passthru)
Define an object interface descriptor with pass-through interface.
Definition: interface.h:82

Name resolution multiplexer parent interface descriptor.

Definition at line 245 of file resolv.c.

Referenced by resolv().

◆ named_xfer_ops

struct interface_operation named_xfer_ops[]
static
Initial value:
= {
}
void intf_close(struct interface *intf, int rc)
Close an object interface.
Definition: interface.c:244
static size_t named_window(struct named_socket *named __unused)
Check flow control window.
Definition: resolv.c:335
size_t xfer_window(struct interface *intf)
Check flow control window.
Definition: xfer.c:115
A named socket.
Definition: resolv.c:302
#define INTF_OP(op_type, object_type, op_func)
Define an object interface operation.
Definition: interface.h:32
static void named_close(struct named_socket *named, int rc)
Terminate named socket opener.
Definition: resolv.c:323

Named socket opener data transfer interface operations.

Definition at line 341 of file resolv.c.

◆ named_xfer_desc

struct interface_descriptor named_xfer_desc
static
Initial value:
=
struct interface xfer
Data transfer interface.
Definition: resolv.c:306
static struct interface_operation named_xfer_ops[]
Named socket opener data transfer interface operations.
Definition: resolv.c:341
A named socket.
Definition: resolv.c:302
int resolv(struct interface *resolv, const char *name, struct sockaddr *sa)
Start name resolution.
Definition: resolv.c:257
#define INTF_DESC_PASSTHRU(object_type, intf, operations, passthru)
Define an object interface descriptor with pass-through interface.
Definition: interface.h:82

Named socket opener data transfer interface descriptor.

Definition at line 347 of file resolv.c.

Referenced by xfer_open_named_socket().

◆ named_resolv_op

struct interface_operation named_resolv_op[]
static
Initial value:
= {
}
static void named_resolv_done(struct named_socket *named, struct sockaddr *sa)
Name resolved.
Definition: resolv.c:357
void intf_close(struct interface *intf, int rc)
Close an object interface.
Definition: interface.c:244
void resolv_done(struct interface *intf, struct sockaddr *sa)
Name resolved.
Definition: resolv.c:55
A named socket.
Definition: resolv.c:302
#define INTF_OP(op_type, object_type, op_func)
Define an object interface operation.
Definition: interface.h:32
static void named_close(struct named_socket *named, int rc)
Terminate named socket opener.
Definition: resolv.c:323

Named socket opener resolver interface operations.

Definition at line 383 of file resolv.c.

◆ named_resolv_desc

struct interface_descriptor named_resolv_desc
static
Initial value:
=
xfer )
struct interface xfer
Data transfer interface.
Definition: resolv.c:306
A named socket.
Definition: resolv.c:302
static struct interface_operation named_resolv_op[]
Named socket opener resolver interface operations.
Definition: resolv.c:383
int resolv(struct interface *resolv, const char *name, struct sockaddr *sa)
Start name resolution.
Definition: resolv.c:257
#define INTF_DESC_PASSTHRU(object_type, intf, operations, passthru)
Define an object interface descriptor with pass-through interface.
Definition: interface.h:82

Named socket opener resolver interface descriptor.

Definition at line 389 of file resolv.c.

Referenced by xfer_open_named_socket().