iPXE
resolv.h
Go to the documentation of this file.
1 #ifndef _IPXE_RESOLV_H
2 #define _IPXE_RESOLV_H
3 
4 /** @file
5  *
6  * Name resolution
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 
12 #include <ipxe/interface.h>
13 #include <ipxe/tables.h>
14 
15 struct sockaddr;
16 
17 /** A name resolver */
18 struct resolver {
19  /** Name of this resolver (e.g. "DNS") */
20  const char *name;
21  /** Start name resolution
22  *
23  * @v resolv Name resolution interface
24  * @v name Name to resolve
25  * @v sa Socket address to complete
26  * @ret rc Return status code
27  */
28  int ( * resolv ) ( struct interface *resolv, const char *name,
29  struct sockaddr *sa );
30 };
31 
32 /** Numeric resolver priority */
33 #define RESOLV_NUMERIC 01
34 
35 /** Normal resolver priority */
36 #define RESOLV_NORMAL 02
37 
38 /** Resolvers table */
39 #define RESOLVERS __table ( struct resolver, "resolvers" )
40 
41 /** Register as a name resolver */
42 #define __resolver( resolv_order ) __table_entry ( RESOLVERS, resolv_order )
43 
44 extern void resolv_done ( struct interface *intf, struct sockaddr *sa );
45 #define resolv_done_TYPE( object_type ) \
46  typeof ( void ( object_type, struct sockaddr *sa ) )
47 
48 extern int resolv ( struct interface *resolv, const char *name,
49  struct sockaddr *sa );
50 
51 #endif /* _IPXE_RESOLV_H */
const char * name
Definition: ath9k_hw.c:1984
struct sockaddr sa
Definition: dns.c:68
An object interface.
Definition: interface.h:109
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
Object interfaces.
Generalized socket address structure.
Definition: socket.h:96
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
int resolv(struct interface *resolv, const char *name, struct sockaddr *sa)
Start name resolution.
Definition: resolv.c:257
void resolv_done(struct interface *intf, struct sockaddr *sa)
Name resolved.
Definition: resolv.c:55
Linker tables.
const char * name
Name of this resolver (e.g.
Definition: resolv.h:20