diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/gpxe/resolv.h | 47 | ||||
| -rw-r--r-- | src/include/resolv.h | 16 |
2 files changed, 47 insertions, 16 deletions
diff --git a/src/include/gpxe/resolv.h b/src/include/gpxe/resolv.h new file mode 100644 index 000000000..71364012c --- /dev/null +++ b/src/include/gpxe/resolv.h @@ -0,0 +1,47 @@ +#ifndef _GPXE_RESOLV_H +#define _GPXE_RESOLV_H + +/** @file + * + * Name resolution + * + */ + +struct sockaddr; + +#include <gpxe/async.h> +#include <gpxe/tables.h> + +/** A name resolver */ +struct resolver { + /** Name of this resolver (e.g. "DNS") */ + const char *name; + /** Start name resolution + * + * @v name Host name to resolve + * @v sa Socket address to fill in + * @v parent Parent asynchronous operation + * @ret rc Return status code + * + * The asynchronous process must be prepared to accept + * SIGKILL. + */ + int ( * resolv ) ( const char *name, struct sockaddr *sa, + struct async *parent ); +}; + +/** A name resolution in progress */ +struct resolution { + /** Asynchronous operation */ + struct async async; + /** Numner of active child resolvers */ + unsigned int pending; +}; + +/** Register as a name resolver */ +#define __resolver __table ( struct resolver, resolvers, 01 ) + +extern int resolv ( const char *name, struct sockaddr *sa, + struct async *parent ); + +#endif /* _GPXE_RESOLV_H */ diff --git a/src/include/resolv.h b/src/include/resolv.h deleted file mode 100644 index 714d39ef8..000000000 --- a/src/include/resolv.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef RESOLV_H -#define RESOLV_H - -#include <gpxe/in.h> -#include <gpxe/tables.h> - -struct resolver { - const char *name; - int ( * resolv ) ( struct in_addr *address, const char *name ); -}; - -#define __resolver __table ( struct resolver, resolver, 01 ) - -extern int resolv ( struct in_addr *address, const char *name ); - -#endif /* RESOLV_H */ |
