#include <getdns/getdns.h>
#include <ldns/ldns.h>
Go to the source code of this file.
|
#define | SET_ERROR_GENERIC(errp, error_status) |
|
#define | SET_ERROR_CALLBACK(errp, callback_type) |
|
#define | SET_ERROR_GETDNS(errp, msgstr, r) |
|
#define | SET_ERROR_GETDNS_REPSTATUS(errp, msgstr, r) |
|
#define | SET_ERROR_A_AAAA_TIMEOUT(errp) SET_ERROR_GENERIC(errp, CBN_A_AAAA_TIMEOUT) |
|
#define | SET_ERROR_LDNS(errp, msgstr) |
|
#define | SET_ERROR_LDNS_RESULT(errp, msgstr, r) |
|
#define | SET_ERROR_SSL(errp, msgstr) |
|
#define | SET_ERROR_TLSA_MISMATCH(errp) SET_ERROR_GENERIC(errp, CBN_TLSA_MISMATCH) |
|
#define | SET_ERROR_DANE_TIMEOUT(errp) SET_ERROR_GENERIC(errp, CBN_DANE_TIMEOUT) |
|
#define | SET_ERROR_PKIX_DID_NOT_VALIDATE(errp) SET_ERROR_GENERIC(errp, CBN_PKIX_DID_NOT_VALIDATE) |
|
#define | CBNPR_MAX_ADDRS 3 |
|
#define | CBN_UNENCRYPTED (1 << 0) |
|
#define | CBN_UNAUTHENTICATED_ENCRYPTION (1 << 1) |
|
#define | CBN_AUTHENTICATED_ENCRYPTION (1 << 2) |
|
#define | CBN_PKIX_AUTH_REQUIRED (1 << 3) |
|
#define | CBN_DANE_AUTH_REQUIRED (1 << 4) |
|
#define | CBN_DEFAULT_DISALLOW_OTHER_TRANSPORTS (1 << 5) |
|
#define | CBN_ALLOW_DO53 (1 << 8) |
|
#define | CBN_DISALLOW_DO53 (1 << 9) |
|
#define | CBN_ALLOW_DOT (1 << 10) |
|
#define | CBN_DISALLOW_DOT (1 << 11) |
|
#define | CBN_ALLOW_DOH2 (1 << 12) |
|
#define | CBN_DISALLOW_DOH2 (1 << 13) |
|
#define | CBN_ALLOW_DOH3 (1 << 14) |
|
#define | CBN_DISALLOW_DOH3 (1 << 15) |
|
#define | CBN_ALLOW_DOQ (1 << 16) |
|
#define | CBN_DISALLOW_DOQ (1 << 17) |
|
#define | MAX_RESOLVERS 10 |
|
|
typedef void(* | cbn_callback_T) (struct bufferevent *bev, void *ref) |
|
typedef void(* | cbn_callback_error_T) (struct cbn_error *error, void *ref) |
|
|
enum | cbn_status {
CBN_OK
, CBN_BAD_PORT
, CBN_BAD_PORT_NAME
, CBN_GETDNS_ERROR
,
CBN_GETDNS_REPSTATUS
, CBN_A_AAAA_TIMEOUT
, CBN_HOSTNAME_TOO_LONG
, CBN_ERROR_CALLBACK
,
CBN_LDNS_ERROR
, CBN_LDNS_RESULT
, CBN_SSL_ERROR
, CBN_TLSA_MISMATCH
,
CBN_DANE_TIMEOUT
, CBN_PKIX_DID_NOT_VALIDATE
} |
|
|
struct cbn_policy * | cbn_policy_init2 (struct cbn_policy *policy, const char *name, unsigned int settings) |
|
int | cbn_policy_add_resolver (struct cbn_policy *policy, struct cbnp_resolver *resolver) |
|
int | cbn_init (struct cbn_context *cbn_ctx, struct event_base *event_base) |
|
int | cbn_init2 (struct cbn_context *cbn_ctx, struct cbn_policy *policy, char *name, int flags, struct event_base *event_base) |
|
void | cbn_clean (struct cbn_context *cbn_ctx) |
|
int | connectbyname (struct cbn_context *cbn_ctx, const char *hostname, const char *servname, int *fdp) |
|
int | connectbyname_asyn (struct cbn_context *cbn_ctx, const char *hostname, const char *servname, cbn_callback_T user_cb, cbn_callback_error_T error_cb, void *user_ref, void **refp) |
|
void | connectbyname_free (void *ref) |
|
This is the interface to connectbyname
◆ SET_ERROR_CALLBACK
#define SET_ERROR_CALLBACK |
( |
|
errp, |
|
|
|
callback_type |
|
) |
| |
Value: SET_ERROR_GENERIC(errp, CBN_ERROR_CALLBACK), \
(errp)->u.callback_type= callback_type
◆ SET_ERROR_GENERIC
#define SET_ERROR_GENERIC |
( |
|
errp, |
|
|
|
error_status |
|
) |
| |
Value: (errp)->status= error_status, \
(errp)->file= __FILE__, \
(errp)->line= __LINE__, \
(errp)->func= __func__
◆ SET_ERROR_GETDNS
#define SET_ERROR_GETDNS |
( |
|
errp, |
|
|
|
msgstr, |
|
|
|
r |
|
) |
| |
Value: SET_ERROR_GENERIC(errp, CBN_GETDNS_ERROR), \
(errp)->msg= msgstr, \
(errp)->u.getdns_result= r
◆ SET_ERROR_GETDNS_REPSTATUS
#define SET_ERROR_GETDNS_REPSTATUS |
( |
|
errp, |
|
|
|
msgstr, |
|
|
|
r |
|
) |
| |
Value: SET_ERROR_GENERIC(errp, CBN_GETDNS_REPSTATUS), \
(errp)->msg= msgstr, \
(errp)->u.getdns_repstatus= r
◆ SET_ERROR_LDNS
#define SET_ERROR_LDNS |
( |
|
errp, |
|
|
|
msgstr |
|
) |
| |
Value: SET_ERROR_GENERIC(errp, CBN_LDNS_ERROR), \
(errp)->msg= msgstr
◆ SET_ERROR_LDNS_RESULT
#define SET_ERROR_LDNS_RESULT |
( |
|
errp, |
|
|
|
msgstr, |
|
|
|
r |
|
) |
| |
Value: SET_ERROR_GENERIC(errp, CBN_LDNS_RESULT), \
(errp)->msg= msgstr, \
(errp)->u.ldns_status= r
◆ SET_ERROR_SSL
#define SET_ERROR_SSL |
( |
|
errp, |
|
|
|
msgstr |
|
) |
| |
Value: SET_ERROR_GENERIC(errp, CBN_SSL_ERROR), \
(errp)->msg= msgstr
◆ cbn_clean()
Clean up connectbyname context
- Parameters
-
cbn_ctx | context to clean up |
- Returns
- returns enum cbn_status
◆ cbn_init()
int cbn_init |
( |
struct cbn_context * |
cbn_ctx, |
|
|
struct event_base * |
event_base |
|
) |
| |
Initialize a connectbyname context
- Parameters
-
cbn_ctx | context to initialize |
event_base | event base to use for asynchronous I/O |
- Returns
- returns enum cbn_status
◆ cbn_init2()
int cbn_init2 |
( |
struct cbn_context * |
cbn_ctx, |
|
|
struct cbn_policy * |
policy, |
|
|
char * |
name, |
|
|
int |
flags, |
|
|
struct event_base * |
event_base |
|
) |
| |
Initialize a connectbyname context
- Parameters
-
cbn_ctx | context to initialize |
policy | policy for this context |
name | |
flags | |
event_base | event base to use for asynchronous I/O |
- Returns
- returns enum cbn_status
◆ cbn_policy_add_resolver()
Add a DNS resolver policy to a connectbyname policy
- Parameters
-
policy | connectbyname policy |
resolver | resolver policy |
- Returns
- returns enum cbn_status
◆ cbn_policy_init2()
struct cbn_policy* cbn_policy_init2 |
( |
struct cbn_policy * |
policy, |
|
|
const char * |
name, |
|
|
unsigned int |
settings |
|
) |
| |
Initializes the cbn_policy
- Parameters
-
policy | The policy to initialize, already allocated or on the stack.
|
name | The name from which to determine what policy setting to inherit. |
settings | A bitwise-orred value witth settings for the individual settings. Missing values will be interpreted as inherit. |
- Returns
- The initialized cbn_policy or NULL on error. Error will occur only when memory could not be allocated.
◆ connectbyname()
int connectbyname |
( |
struct cbn_context * |
cbn_ctx, |
|
|
const char * |
hostname, |
|
|
const char * |
servname, |
|
|
int * |
fdp |
|
) |
| |
Synchronous connectbyname call
- Parameters
-
cbn_ctx | Configuration context |
hostname | DNS name to connect to |
servname | Name of service (port) to connect to |
fdp | Result filedescriptor |
- Returns
- returns enum cbn_status
◆ connectbyname_asyn()
int connectbyname_asyn |
( |
struct cbn_context * |
cbn_ctx, |
|
|
const char * |
hostname, |
|
|
const char * |
servname, |
|
|
cbn_callback_T |
user_cb, |
|
|
cbn_callback_error_T |
error_cb, |
|
|
void * |
user_ref, |
|
|
void ** |
refp |
|
) |
| |
Asynchronous connectbyname call
- Parameters
-
cbn_ctx | Configuration context |
hostname | DNS name to connect to |
servname | Name of service (port) to connect to |
user_cb | Callback function on success |
error_cb | Callback function on error |
user_ref | User reference for callback |
refp | Library reference to this call |
- Returns
- returns enum cbn_status
◆ connectbyname_free()
void connectbyname_free |
( |
void * |
ref | ) |
|
Free the state associated with a call to connectbyname_asyn
- Parameters
-
ref | Reference returned by connectbyname_asyn |
- Returns
- returns enum cbn_status