Data Structures | Functions | Variables
comboot_resolv.c File Reference
#include <errno.h>
#include <comboot.h>
#include <ipxe/in.h>
#include <ipxe/list.h>
#include <ipxe/process.h>
#include <ipxe/resolv.h>

Go to the source code of this file.

Data Structures

struct  comboot_resolver


static void comboot_resolv_close (struct comboot_resolver *comboot_resolver, int rc)
static void comboot_resolv_done (struct comboot_resolver *comboot_resolver, struct sockaddr *sa)
int comboot_resolv (const char *name, struct in_addr *address)


static struct interface_operation comboot_resolv_op []
static struct interface_descriptor comboot_resolv_desc
static struct comboot_resolver comboot_resolver

Function Documentation



◆ comboot_resolv_close()

static void comboot_resolv_close ( struct comboot_resolver comboot_resolver,
int  rc 

Definition at line 16 of file comboot_resolv.c.

17  {
20 }
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 intf

References comboot_resolver::intf, intf_shutdown(), comboot_resolver::rc, and rc.

◆ comboot_resolv_done()

static void comboot_resolv_done ( struct comboot_resolver comboot_resolver,
struct sockaddr sa 

Definition at line 22 of file comboot_resolv.c.

23  {
24  struct sockaddr_in *sin;
26  if ( sa->sa_family == AF_INET ) {
27  sin = ( ( struct sockaddr_in * ) sa );
29  }
30 }
sa_family_t sa_family
Socket address family.
Definition: socket.h:101
IPv4 socket address.
Definition: in.h:82
struct sockaddr sa
Definition: syslog.c:55
struct in_addr addr
struct in_addr sin_addr
IPv4 address.
Definition: in.h:98
struct sockaddr_in sin
Definition: syslog.c:57
#define AF_INET
IPv4 Internet addresses.
Definition: socket.h:63

References comboot_resolver::addr, AF_INET, sa, sockaddr::sa_family, sin, and sockaddr_in::sin_addr.

◆ comboot_resolv()

int comboot_resolv ( const char *  name,
struct in_addr address 

Definition at line 44 of file comboot_resolv.c.

44  {
45  int rc;
50  if ( ( rc = resolv ( &comboot_resolver.intf, name, NULL ) ) != 0 )
51  return rc;
53  while ( comboot_resolver.rc == -EINPROGRESS )
54  step();
57  return -EAFNOSUPPORT;
60  return comboot_resolver.rc;
61 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
const char * name
Definition: ath9k_hw.c:1984
uint64_t address
Base address.
Definition: ena.h:24
Address family not supported.
Definition: errno.h:313
Operation in progress.
Definition: errno.h:418
struct in_addr addr
uint32_t s_addr
Definition: in.h:40
void step(void)
Single-step a single process.
Definition: process.c:98
struct interface intf
int resolv(struct interface *resolv, const char *name, struct sockaddr *sa)
Start name resolution.
Definition: resolv.c:257
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References comboot_resolver::addr, address, EAFNOSUPPORT, EINPROGRESS, comboot_resolver::intf, name, NULL, comboot_resolver::rc, rc, resolv(), in_addr::s_addr, and step().

Referenced by int22().

Variable Documentation

◆ comboot_resolv_op

struct interface_operation comboot_resolv_op[]
Initial value:
= {
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
static void comboot_resolv_done(struct comboot_resolver *comboot_resolver, struct sockaddr *sa)
#define INTF_OP(op_type, object_type, op_func)
Define an object interface operation.
Definition: interface.h:32
static void comboot_resolv_close(struct comboot_resolver *comboot_resolver, int rc)

Definition at line 32 of file comboot_resolv.c.

◆ comboot_resolv_desc

struct interface_descriptor comboot_resolv_desc
Initial value:
static struct interface_operation comboot_resolv_op[]
#define INTF_DESC(object_type, intf, operations)
Define an object interface descriptor.
Definition: interface.h:65

Definition at line 37 of file comboot_resolv.c.

◆ comboot_resolver

Initial value:
= {
#define INTF_INIT(descriptor)
Initialise a static object interface.
Definition: interface.h:187
static struct interface_descriptor comboot_resolv_desc

Definition at line 40 of file comboot_resolv.c.