iPXE
Functions
nslookup.h File Reference

Standalone name resolution. More...

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER)
 
int nslookup (const char *name, const char *setting_name)
 Perform (blocking) standalone name resolution. More...
 

Detailed Description

Standalone name resolution.

Definition in file nslookup.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER  )

◆ nslookup()

int nslookup ( const char *  name,
const char *  setting_name 
)

Perform (blocking) standalone name resolution.

Parameters
nameName to resolve
setting_nameSetting name
Return values
rcReturn status code

Definition at line 191 of file nslookup.c.

191  {
192  int rc;
193 
194  /* Perform name resolution */
195  if ( ( rc = resolv_setting ( &monojob, name, setting_name ) ) == 0 )
196  rc = monojob_wait ( NULL, 0 );
197  if ( rc != 0 ) {
198  printf ( "Could not resolve %s: %s\n", name, strerror ( rc ) );
199  return rc;
200  }
201 
202  return 0;
203 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
const char * name
Definition: ath9k_hw.c:1984
int printf(const char *fmt,...)
Write a formatted string to the console.
Definition: vsprintf.c:464
int monojob_wait(const char *string, unsigned long timeout)
Wait for single foreground job to complete.
Definition: monojob.c:81
static int resolv_setting(struct interface *job, const char *name, const char *setting_name)
Initiate standalone name resolution.
Definition: nslookup.c:149
struct interface monojob
Definition: monojob.c:56
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
int setting_name(struct settings *settings, const struct setting *setting, char *buf, size_t len)
Return full setting name.
Definition: settings.c:1606
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321

References monojob, monojob_wait(), name, NULL, printf(), rc, resolv_setting(), setting_name(), and strerror().

Referenced by resolv_setting().