comboot_resolv.c File Reference

#include <errno.h>
#include <comboot.h>
#include <gpxe/in.h>
#include <gpxe/list.h>
#include <gpxe/process.h>
#include <gpxe/resolv.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER)
static void comboot_resolv_done (struct resolv_interface *resolv, struct sockaddr *sa, int rc)
int comboot_resolv (const char *name, struct in_addr *address)

Variables

static int comboot_resolv_rc
static struct in_addr comboot_resolv_addr
static struct
resolv_interface_operations 
comboot_resolv_ops
static struct resolv_interface comboot_resolver


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

static void comboot_resolv_done ( struct resolv_interface resolv,
struct sockaddr sa,
int  rc 
) [static]

Definition at line 13 of file comboot_resolv.c.

References AF_INET, comboot_resolv_addr, comboot_resolv_rc, EAFNOSUPPORT, resolv_unplug(), sockaddr::sa_family, and sockaddr_in::sin_addr.

00014                                                                 {
00015         struct sockaddr_in *sin;
00016 
00017         resolv_unplug ( resolv );
00018 
00019         if ( rc != 0 ) {
00020                 comboot_resolv_rc = rc;
00021                 return;
00022         }
00023 
00024         if ( sa->sa_family != AF_INET ) {
00025                 comboot_resolv_rc = -EAFNOSUPPORT;
00026                 return;
00027         }
00028 
00029         sin = ( ( struct sockaddr_in * ) sa );
00030         comboot_resolv_addr = sin->sin_addr;
00031 
00032         comboot_resolv_rc = 0;
00033 }

int comboot_resolv ( const char *  name,
struct in_addr address 
)

Definition at line 47 of file comboot_resolv.c.

References comboot_resolv_addr, comboot_resolv_rc, EINPROGRESS, NULL, resolv(), and step().

Referenced by int22().

00047                                                                  {
00048         int rc;
00049 
00050         comboot_resolv_rc = -EINPROGRESS;
00051 
00052         if ( ( rc = resolv ( &comboot_resolver, name, NULL ) ) != 0 )
00053                 return rc;
00054 
00055         while ( comboot_resolv_rc == -EINPROGRESS )
00056                 step();
00057 
00058         *address = comboot_resolv_addr;
00059         return comboot_resolv_rc;
00060 }


Variable Documentation

int comboot_resolv_rc [static]

Definition at line 10 of file comboot_resolv.c.

Referenced by comboot_resolv(), and comboot_resolv_done().

struct in_addr comboot_resolv_addr [static]

Definition at line 11 of file comboot_resolv.c.

Referenced by comboot_resolv(), and comboot_resolv_done().

Initial value:

 {
        .done = comboot_resolv_done,
}

Definition at line 35 of file comboot_resolv.c.

Initial value:

 {
        .intf = {
                .dest = &null_resolv.intf,
                .refcnt = NULL,
        },
        .op = &comboot_resolv_ops,
}

Definition at line 39 of file comboot_resolv.c.


Generated on Tue Apr 6 20:01:13 2010 for gPXE by  doxygen 1.5.7.1