iPXE
resolv.h
Go to the documentation of this file.
00001 #ifndef _IPXE_RESOLV_H
00002 #define _IPXE_RESOLV_H
00003 
00004 /** @file
00005  *
00006  * Name resolution
00007  *
00008  */
00009 
00010 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00011 
00012 #include <ipxe/interface.h>
00013 #include <ipxe/tables.h>
00014 
00015 struct sockaddr;
00016 
00017 /** A name resolver */
00018 struct resolver {
00019         /** Name of this resolver (e.g. "DNS") */
00020         const char *name;
00021         /** Start name resolution
00022          *
00023          * @v resolv            Name resolution interface
00024          * @v name              Name to resolve
00025          * @v sa                Socket address to complete
00026          * @ret rc              Return status code
00027          */
00028         int ( * resolv ) ( struct interface *resolv, const char *name,
00029                            struct sockaddr *sa );
00030 };
00031 
00032 /** Numeric resolver priority */
00033 #define RESOLV_NUMERIC 01
00034 
00035 /** Normal resolver priority */
00036 #define RESOLV_NORMAL 02
00037 
00038 /** Resolvers table */
00039 #define RESOLVERS __table ( struct resolver, "resolvers" )
00040 
00041 /** Register as a name resolver */
00042 #define __resolver( resolv_order ) __table_entry ( RESOLVERS, resolv_order )
00043 
00044 extern void resolv_done ( struct interface *intf, struct sockaddr *sa );
00045 #define resolv_done_TYPE( object_type ) \
00046         typeof ( void ( object_type, struct sockaddr *sa ) )
00047 
00048 extern int resolv ( struct interface *resolv, const char *name,
00049                     struct sockaddr *sa );
00050 
00051 #endif /* _IPXE_RESOLV_H */