libspf2 1.2.11
Macros | Functions
spf_dns_resolv.c File Reference

A DNS resolver which uses libresolv/libbind to query a DNS server. More...

#include "spf_sys_config.h"
#include "spf.h"
#include "spf_dns.h"
#include "spf_internal.h"
#include "spf_dns_internal.h"
#include "spf_dns_resolv.h"
Include dependency graph for spf_dns_resolv.c:

Go to the source code of this file.

Macros

#define SPF_h_errno   h_errno
 

Functions

SPF_dns_server_t * SPF_dns_resolv_new (SPF_dns_server_t *layer_below, const char *name, int debug)
 

Detailed Description

A DNS resolver which uses libresolv/libbind to query a DNS server.

If we have a res_ninit then we make a thread-local resolver state, which we use to perform all resolutions.

If we do not have res_ninit, then we do a res_init() at server-create time, and a res_close() at server-close time, and we are NOT thread-safe. I think we don't actually have to call res_init(), but we do anyway.

Audited, 2008-09-15, Shevek.

Definition in file spf_dns_resolv.c.

Macro Definition Documentation

◆ SPF_h_errno

#define SPF_h_errno   h_errno

Definition at line 85 of file spf_dns_resolv.c.

Function Documentation

◆ SPF_dns_resolv_new()

SPF_dns_server_t * SPF_dns_resolv_new ( SPF_dns_server_t *  layer_below,
const char *  name,
int  debug 
)

These routines take care of creating/destroying/etc. the objects that hold the DNS layer configuration. SPF_dns_server_t objects contain malloc'ed data, so they must be destroyed when you are finished with them, or you will leak memory.

if debugging is enabled, information about the results from libresolv will be displayed. This information is often not passed on to (and not needed by) the higher level DNS layers.

Definition at line 604 of file spf_dns_resolv.c.

References debug, NULL, and SPF_warning.

Referenced by SPF_server_new().