Rename all priv_getdns internal symbols to _getdns

This commit is contained in:
Willem Toorop 2015-08-19 16:22:38 +02:00
parent 7971152742
commit fcd595298a
19 changed files with 369 additions and 369 deletions

View File

@ -91,7 +91,7 @@ static int const_info_cmp(const void *a, const void *b)
return ((struct const_info *) a)->code - ((struct const_info *) b)->code;
}
struct const_info *
priv_getdns_get_const_info(int value)
_getdns_get_const_info(int value)
{
struct const_info key = { value, "", "" };
struct const_info *i = bsearch(&key, consts_info,

View File

@ -1,9 +1,9 @@
/**
*
* /brief priv_getdns_consts table with values, names and descriptions of the
* /brief _getdns_consts table with values, names and descriptions of the
* constants in getdns
*
* The priv_getdns_get_validation_chain function is called after an answer
* The _getdns_get_validation_chain function is called after an answer
* has been fetched when the dnssec_return_validation_chain extension is set.
* It fetches DNSKEYs, DSes and their signatures for all RRSIGs found in the
* answer.
@ -45,7 +45,7 @@ struct const_info {
const char *text;
};
struct const_info *priv_getdns_get_const_info(int value);
struct const_info *_getdns_get_const_info(int value);
#endif

View File

@ -523,7 +523,7 @@ upstreams_resize(getdns_upstreams *upstreams, size_t size)
}
void
priv_getdns_upstreams_dereference(getdns_upstreams *upstreams)
_getdns_upstreams_dereference(getdns_upstreams *upstreams)
{
getdns_upstream *upstream;
@ -554,7 +554,7 @@ priv_getdns_upstreams_dereference(getdns_upstreams *upstreams)
}
void
priv_getdns_upstream_shutdown(getdns_upstream *upstream)
_getdns_upstream_shutdown(getdns_upstream *upstream)
{
/*There is a race condition with a new request being scheduled
while this happens so take ownership of the fd asap*/
@ -986,7 +986,7 @@ getdns_context_destroy(struct getdns_context *context)
* might be an idle_timeout schedules, which will not get unscheduled
* with cancel_outstanding_requests.
*/
priv_getdns_upstreams_dereference(context->upstreams);
_getdns_upstreams_dereference(context->upstreams);
#ifdef HAVE_LIBUNBOUND
if (context->unbound_ctx)
@ -1109,7 +1109,7 @@ getdns_context_request_count_changed(getdns_context *context)
}
void
priv_getdns_context_ub_read_cb(void *userarg)
_getdns_context_ub_read_cb(void *userarg)
{
getdns_context *context = (getdns_context *)userarg;
@ -1148,7 +1148,7 @@ rebuild_ub_ctx(struct getdns_context* context) {
set_ub_dns_transport(context);
context->ub_event.userarg = context;
context->ub_event.read_cb = priv_getdns_context_ub_read_cb;
context->ub_event.read_cb = _getdns_context_ub_read_cb;
context->ub_event.write_cb = NULL;
context->ub_event.timeout_cb = NULL;
context->ub_event.ev = NULL;
@ -1790,7 +1790,7 @@ getdns_context_set_upstream_recursive_servers(struct getdns_context *context,
freeaddrinfo(ai);
}
}
priv_getdns_upstreams_dereference(context->upstreams);
_getdns_upstreams_dereference(context->upstreams);
context->upstreams = upstreams;
dispatch_updated(context,
GETDNS_CONTEXT_CODE_UPSTREAM_RECURSIVE_SERVERS);
@ -1800,7 +1800,7 @@ getdns_context_set_upstream_recursive_servers(struct getdns_context *context,
invalid_parameter:
r = GETDNS_RETURN_INVALID_PARAMETER;
error:
priv_getdns_upstreams_dereference(upstreams);
_getdns_upstreams_dereference(upstreams);
return GETDNS_RETURN_CONTEXT_UPDATE_FAIL;
} /* getdns_context_set_upstream_recursive_servers */
@ -1948,7 +1948,7 @@ cancel_dns_req(getdns_dns_req *req)
netreq->unbound_id = -1;
} else
#endif
priv_getdns_cancel_stub_request(netreq);
_getdns_cancel_stub_request(netreq);
req->canceled = 1;
}
@ -2124,10 +2124,10 @@ ub_setup_stub(struct ub_ctx *ctx, getdns_context *context)
#endif
static getdns_return_t
priv_getdns_ns_dns_setup(struct getdns_context *context)
_getdns_ns_dns_setup(struct getdns_context *context)
{
#ifdef HAVE_LIBUNBOUND
priv_getdns_rr_iter rr_spc, *rr;
_getdns_rr_iter rr_spc, *rr;
char ta_str[8192];
#endif
assert(context);
@ -2147,10 +2147,10 @@ priv_getdns_ns_dns_setup(struct getdns_context *context)
/* TODO: use the root servers via root hints file */
(void) ub_ctx_set_fwd(context->unbound_ctx, NULL);
if (!context->unbound_ta_set && context->trust_anchors) {
for ( rr = priv_getdns_rr_iter_init( &rr_spc
for ( rr = _getdns_rr_iter_init( &rr_spc
, context->trust_anchors
, context->trust_anchors_len)
; rr ; rr = priv_getdns_rr_iter_next(rr) ) {
; rr ; rr = _getdns_rr_iter_next(rr) ) {
(void) gldns_wire2str_rr_buf(rr->pos,
rr->nxt - rr->pos, ta_str, sizeof(ta_str));
@ -2214,7 +2214,7 @@ getdns_context_prepare_for_resolution(struct getdns_context *context,
if (! usenamespaces) {
r = priv_getdns_ns_dns_setup(context);
r = _getdns_ns_dns_setup(context);
if (r == GETDNS_RETURN_GOOD)
context->resolution_type_set = context->resolution_type;
return r;
@ -2224,7 +2224,7 @@ getdns_context_prepare_for_resolution(struct getdns_context *context,
for (i = 0; i < context->namespace_count; i++) {
switch (context->namespaces[i]) {
case GETDNS_NAMESPACE_DNS:
r = priv_getdns_ns_dns_setup(context);
r = _getdns_ns_dns_setup(context);
break;
default:

View File

@ -248,10 +248,10 @@ getdns_return_t getdns_context_local_namespace_resolve(
int filechg_check(struct getdns_context *context, struct filechg *fchg);
void priv_getdns_context_ub_read_cb(void *userarg);
void _getdns_context_ub_read_cb(void *userarg);
void priv_getdns_upstreams_dereference(getdns_upstreams *upstreams);
void _getdns_upstreams_dereference(getdns_upstreams *upstreams);
void priv_getdns_upstream_shutdown(getdns_upstream *upstream);
void _getdns_upstream_shutdown(getdns_upstream *upstream);
#endif /* _GETDNS_CONTEXT_H_ */

View File

@ -521,7 +521,7 @@ getdns_indent(size_t indent)
} /* getdns_indent */
static int
priv_getdns_bindata_is_dname(getdns_bindata *bindata)
_getdns_bindata_is_dname(getdns_bindata *bindata)
{
size_t i = 0, n_labels = 0;
@ -585,7 +585,7 @@ getdns_pp_bindata(gldns_buffer *buf, size_t indent,
if (gldns_buffer_printf(buf, json ? "\".\"" : "for .>") < 0)
return -1;
} else if (priv_getdns_bindata_is_dname(bindata)) {
} else if (_getdns_bindata_is_dname(bindata)) {
(void)gldns_wire2str_dname_buf(
bindata->data, bindata->size, spc, sizeof(spc));
if (gldns_buffer_printf(
@ -681,7 +681,7 @@ getdns_pp_list(gldns_buffer *buf, size_t indent, const getdns_list *list,
return -1;
if (!json && for_literals &&
(strval =
priv_getdns_get_const_info(int_item)->name)) {
_getdns_get_const_info(int_item)->name)) {
if (gldns_buffer_printf(buf, "%s", strval) < 0)
return -1;
} else if (0 >
@ -732,7 +732,7 @@ getdns_pp_list(gldns_buffer *buf, size_t indent, const getdns_list *list,
} /* getdns_pp_list */
static int
priv_getdns_print_class(gldns_buffer *buf, uint32_t klass)
_getdns_print_class(gldns_buffer *buf, uint32_t klass)
{
switch (klass) {
case GETDNS_RRCLASS_IN:
@ -755,7 +755,7 @@ priv_getdns_print_class(gldns_buffer *buf, uint32_t klass)
}
static int
priv_getdns_print_opcode(gldns_buffer *buf, uint32_t opcode)
_getdns_print_opcode(gldns_buffer *buf, uint32_t opcode)
{
switch (opcode) {
case GETDNS_OPCODE_QUERY:
@ -778,7 +778,7 @@ priv_getdns_print_opcode(gldns_buffer *buf, uint32_t opcode)
}
static int
priv_getdns_print_rcode(gldns_buffer *buf, uint32_t rcode)
_getdns_print_rcode(gldns_buffer *buf, uint32_t rcode)
{
static const char *rcodes[] = {
" GETDNS_RCODE_NOERROR" , " GETDNS_RCODE_FORMERR" ,
@ -846,7 +846,7 @@ getdns_pp_dict(gldns_buffer * buf, size_t indent,
(strcmp(item->node.key, "type") == 0 ||
strcmp(item->node.key, "type_covered") == 0 ||
strcmp(item->node.key, "qtype") == 0) &&
(strval = priv_getdns_rr_type_name(item->data.n))) {
(strval = _getdns_rr_type_name(item->data.n))) {
if (gldns_buffer_printf(
buf, " GETDNS_RRTYPE_%s", strval) < 0)
return -1;
@ -860,7 +860,7 @@ getdns_pp_dict(gldns_buffer * buf, size_t indent,
strcmp(item->node.key, "follow_redirects") == 0 ||
strcmp(item->node.key, "resolution_type") == 0) &&
(strval =
priv_getdns_get_const_info(item->data.n)->name)) {
_getdns_get_const_info(item->data.n)->name)) {
if (gldns_buffer_printf(buf, " %s", strval) < 0)
return -1;
break;
@ -868,13 +868,13 @@ getdns_pp_dict(gldns_buffer * buf, size_t indent,
if (!json &&
(strcmp(item->node.key, "class") == 0 ||
strcmp(item->node.key, "qclass") == 0) &&
priv_getdns_print_class(buf, item->data.n))
_getdns_print_class(buf, item->data.n))
break;
if (!json && strcmp(item->node.key, "opcode") == 0 &&
priv_getdns_print_opcode(buf, item->data.n))
_getdns_print_opcode(buf, item->data.n))
break;
if (!json && strcmp(item->node.key, "rcode") == 0 &&
priv_getdns_print_rcode(buf, item->data.n))
_getdns_print_rcode(buf, item->data.n))
break;
if (gldns_buffer_printf(
buf,(json < 2 ? " %d" : "%d"), item->data.n) < 0)

View File

@ -3,7 +3,7 @@
* /brief functions for DNSSEC
*
* In this file, the "dnssec_return_validation_chain" extension is implemented
* (with the priv_getdns_get_validation_chain() function)
* (with the _getdns_get_validation_chain() function)
* Also the function getdns_validate_dnssec is implemented.
* DNSSEC validation as a stub combines those two functionalities, by first
* fetching all the records that are necessary to be able to validate a
@ -238,7 +238,7 @@ inline static size_t _dname_label_count(uint8_t *name)
inline static int _dname_equal(const uint8_t *left, const uint8_t *right)
{
return priv_getdns_dname_equal(left, right);
return _getdns_dname_equal(left, right);
}
static int _dname_is_parent(
@ -356,7 +356,7 @@ static int dname_compare(uint8_t *left, uint8_t *right)
return rlabel == last_rlabel ? 0 : -1;
}
static int bitmap_has_type(priv_getdns_rdf_iter *bitmap, uint16_t rr_type)
static int bitmap_has_type(_getdns_rdf_iter *bitmap, uint16_t rr_type)
{
uint8_t *dptr, *dend;
uint8_t window = rr_type >> 8;
@ -378,7 +378,7 @@ static int bitmap_has_type(priv_getdns_rdf_iter *bitmap, uint16_t rr_type)
}
#if defined(SEC_DEBUG) && SEC_DEBUG
inline static void debug_sec_print_rr(const char *msg, priv_getdns_rr_iter *rr)
inline static void debug_sec_print_rr(const char *msg, _getdns_rr_iter *rr)
{
char str_spc[8192], *str = str_spc;
size_t str_len = sizeof(str_spc);
@ -421,18 +421,18 @@ inline static void debug_sec_print_pkt(
/* Utility functions to read rr_type and rr_class from a rr iterator */
static inline uint16_t rr_iter_type(priv_getdns_rr_iter *rr)
static inline uint16_t rr_iter_type(_getdns_rr_iter *rr)
{ return rr->rr_type + 2 <= rr->nxt ? gldns_read_uint16(rr->rr_type) : 0; }
static inline uint16_t rr_iter_class(priv_getdns_rr_iter *rr)
static inline uint16_t rr_iter_class(_getdns_rr_iter *rr)
{ return rr->rr_type + 4 <= rr->nxt ? gldns_read_uint16(rr->rr_type + 2) : 0; }
/* Utility function to compare owner name of rr with name */
static int rr_owner_equal(priv_getdns_rr_iter *rr, uint8_t *name)
static int rr_owner_equal(_getdns_rr_iter *rr, uint8_t *name)
{
uint8_t owner_spc[256], *owner;
size_t owner_len = sizeof(owner_spc);
return (owner = priv_getdns_owner_if_or_as_decompressed(rr, owner_spc
return (owner = _getdns_owner_if_or_as_decompressed(rr, owner_spc
, &owner_len))
&& _dname_equal(owner, name);
}
@ -442,19 +442,19 @@ static int rr_owner_equal(priv_getdns_rr_iter *rr, uint8_t *name)
*/
/* Filter that only iterates over the ANSWER and AUTHORITY section */
static priv_getdns_rr_iter *rr_iter_ansauth(priv_getdns_rr_iter *rr)
static _getdns_rr_iter *rr_iter_ansauth(_getdns_rr_iter *rr)
{
while (rr && rr->pos && !(
priv_getdns_rr_iter_section(rr) == GLDNS_SECTION_ANSWER ||
priv_getdns_rr_iter_section(rr) == GLDNS_SECTION_AUTHORITY))
_getdns_rr_iter_section(rr) == GLDNS_SECTION_ANSWER ||
_getdns_rr_iter_section(rr) == GLDNS_SECTION_AUTHORITY))
rr = priv_getdns_rr_iter_next(rr);
rr = _getdns_rr_iter_next(rr);
return rr && rr->pos ? rr : NULL;
}
/* Filter that only iterates over RRs with a certain name/class/type */
static priv_getdns_rr_iter *rr_iter_name_class_type(priv_getdns_rr_iter *rr,
static _getdns_rr_iter *rr_iter_name_class_type(_getdns_rr_iter *rr,
uint8_t *name, uint16_t rr_class, uint16_t rr_type)
{
while (rr_iter_ansauth(rr) && !(
@ -462,13 +462,13 @@ static priv_getdns_rr_iter *rr_iter_name_class_type(priv_getdns_rr_iter *rr,
rr_iter_class(rr) == rr_class &&
rr_owner_equal(rr, name)))
rr = priv_getdns_rr_iter_next(rr);
rr = _getdns_rr_iter_next(rr);
return rr && rr->pos ? rr : NULL;
}
/* Filter that only iterates over RRs that do not have a name/class/type */
static priv_getdns_rr_iter *rr_iter_not_name_class_type(priv_getdns_rr_iter *rr,
static _getdns_rr_iter *rr_iter_not_name_class_type(_getdns_rr_iter *rr,
uint8_t *name, uint16_t rr_class, uint16_t rr_type)
{
while (rr_iter_ansauth(rr) && (
@ -477,7 +477,7 @@ static priv_getdns_rr_iter *rr_iter_not_name_class_type(priv_getdns_rr_iter *rr,
rr_iter_class(rr) == rr_class &&
rr_owner_equal(rr, name))))
rr = priv_getdns_rr_iter_next(rr);
rr = _getdns_rr_iter_next(rr);
return rr && rr->pos ? rr : NULL;
}
@ -485,7 +485,7 @@ static priv_getdns_rr_iter *rr_iter_not_name_class_type(priv_getdns_rr_iter *rr,
/* Filter that only iterates over RRs that are of type RRSIG, that cover
* a RRset with a certain name/class/type
*/
static priv_getdns_rr_iter *rr_iter_rrsig_covering(priv_getdns_rr_iter *rr,
static _getdns_rr_iter *rr_iter_rrsig_covering(_getdns_rr_iter *rr,
uint8_t *name, uint16_t rr_class, uint16_t rr_type)
{
while (rr_iter_ansauth(rr) && !(
@ -495,7 +495,7 @@ static priv_getdns_rr_iter *rr_iter_rrsig_covering(priv_getdns_rr_iter *rr,
gldns_read_uint16(rr->rr_type + 10) == rr_type &&
rr_owner_equal(rr, name)))
rr = priv_getdns_rr_iter_next(rr);
rr = _getdns_rr_iter_next(rr);
return rr && rr->pos ? rr : NULL;
}
@ -509,19 +509,19 @@ typedef struct getdns_rrset {
} getdns_rrset;
typedef struct rrtype_iter {
priv_getdns_rr_iter rr_i;
_getdns_rr_iter rr_i;
getdns_rrset *rrset;
} rrtype_iter;
typedef struct rrsig_iter {
priv_getdns_rr_iter rr_i;
_getdns_rr_iter rr_i;
getdns_rrset *rrset;
} rrsig_iter;
static rrtype_iter *rrtype_iter_next(rrtype_iter *i)
{
return (rrtype_iter *) rr_iter_name_class_type(
priv_getdns_rr_iter_next(&i->rr_i),
_getdns_rr_iter_next(&i->rr_i),
i->rrset->name, i->rrset->rr_class, i->rrset->rr_type);
}
@ -529,7 +529,7 @@ static rrtype_iter *rrtype_iter_init(rrtype_iter *i, getdns_rrset *rrset)
{
i->rrset = rrset;
return (rrtype_iter *) rr_iter_name_class_type(
priv_getdns_rr_iter_init(&i->rr_i, rrset->pkt, rrset->pkt_len ),
_getdns_rr_iter_init(&i->rr_i, rrset->pkt, rrset->pkt_len ),
i->rrset->name, i->rrset->rr_class, i->rrset->rr_type);
}
@ -542,7 +542,7 @@ inline static int rrset_has_rrs(getdns_rrset *rrset)
static rrsig_iter *rrsig_iter_next(rrsig_iter *i)
{
return (rrsig_iter *) rr_iter_rrsig_covering(
priv_getdns_rr_iter_next(&i->rr_i),
_getdns_rr_iter_next(&i->rr_i),
i->rrset->name, i->rrset->rr_class, i->rrset->rr_type);
}
@ -550,7 +550,7 @@ static rrsig_iter *rrsig_iter_init(rrsig_iter *i, getdns_rrset *rrset)
{
i->rrset = rrset;
return (rrsig_iter *) rr_iter_rrsig_covering(
priv_getdns_rr_iter_init(&i->rr_i, rrset->pkt, rrset->pkt_len),
_getdns_rr_iter_init(&i->rr_i, rrset->pkt, rrset->pkt_len),
i->rrset->name, i->rrset->rr_class, i->rrset->rr_type);
}
@ -589,7 +589,7 @@ static void debug_sec_print_rrset(const char *msg, getdns_rrset *rrset)
, rrset->rr_class);
break;
}
gldns_buffer_printf(&buf, "%s", priv_getdns_rr_type_name(rrset->rr_type));
gldns_buffer_printf(&buf, "%s", _getdns_rr_type_name(rrset->rr_type));
gldns_buffer_printf(&buf, ", rrs:");
for ( rr = rrtype_iter_init(&rr_space, rrset), i = 1
@ -617,21 +617,21 @@ struct rrset_iter {
getdns_rrset rrset;
uint8_t name_spc[256];
size_t name_len;
priv_getdns_rr_iter rr_i;
_getdns_rr_iter rr_i;
};
static rrset_iter *rrset_iter_init(rrset_iter *i, uint8_t *pkt, size_t pkt_len)
{
priv_getdns_rr_iter *rr;
_getdns_rr_iter *rr;
i->rrset.name = i->name_spc;
i->rrset.pkt = pkt;
i->rrset.pkt_len = pkt_len;
i->name_len = 0;
for ( rr = priv_getdns_rr_iter_init(&i->rr_i, pkt, pkt_len)
for ( rr = _getdns_rr_iter_init(&i->rr_i, pkt, pkt_len)
;(rr = rr_iter_ansauth(rr))
; rr = priv_getdns_rr_iter_next(rr)) {
; rr = _getdns_rr_iter_next(rr)) {
if ((i->rrset.rr_type = rr_iter_type(rr))
== GETDNS_RRTYPE_RRSIG)
@ -639,7 +639,7 @@ static rrset_iter *rrset_iter_init(rrset_iter *i, uint8_t *pkt, size_t pkt_len)
i->rrset.rr_class = rr_iter_class(rr);
if (!(i->rrset.name = priv_getdns_owner_if_or_as_decompressed(
if (!(i->rrset.name = _getdns_owner_if_or_as_decompressed(
rr, i->name_spc, &i->name_len)))
continue;
@ -655,7 +655,7 @@ static rrset_iter *rrset_iter_rewind(rrset_iter *i)
static rrset_iter *rrset_iter_next(rrset_iter *i)
{
priv_getdns_rr_iter *rr;
_getdns_rr_iter *rr;
if (!(rr = i && i->rr_i.pos ? &i->rr_i : NULL))
return NULL;
@ -666,7 +666,7 @@ static rrset_iter *rrset_iter_next(rrset_iter *i)
i->rrset.rr_type = rr_iter_type(rr);
i->rrset.rr_class = rr_iter_class(rr);
if (!(i->rrset.name = priv_getdns_owner_if_or_as_decompressed(
if (!(i->rrset.name = _getdns_owner_if_or_as_decompressed(
rr, i->name_spc, &i->name_len)))
/* This is safe, because rr_iter_not_name_class_type will shift
@ -888,9 +888,9 @@ static int is_synthesized_cname(getdns_rrset *cname)
rrset_iter *i, i_spc;
getdns_rrset *dname;
rrtype_iter rr_spc, *rr;
priv_getdns_rdf_iter rdf_spc, *rdf;
_getdns_rdf_iter rdf_spc, *rdf;
rrtype_iter drr_spc, *drr;
priv_getdns_rdf_iter drdf_spc, *drdf;
_getdns_rdf_iter drdf_spc, *drdf;
uint8_t cname_rdata_spc[256], *cname_rdata,
dname_rdata_spc[256], *dname_rdata,
synth_name[256],
@ -906,8 +906,8 @@ static int is_synthesized_cname(getdns_rrset *cname)
/* Get canonical name rdata field */
if ( !(rr = rrtype_iter_init(&rr_spc, cname))
|| !(rdf = priv_getdns_rdf_iter_init(&rdf_spc, &rr->rr_i))
|| !(cname_rdata = priv_getdns_rdf_if_or_as_decompressed(
|| !(rdf = _getdns_rdf_iter_init(&rdf_spc, &rr->rr_i))
|| !(cname_rdata = _getdns_rdf_if_or_as_decompressed(
rdf, cname_rdata_spc, &cname_rdata_len)))
return 0;
@ -944,8 +944,8 @@ static int is_synthesized_cname(getdns_rrset *cname)
/* Get DNAME's rdata field */
if ( !(drr = rrtype_iter_init(&drr_spc, dname))
|| !(drdf=priv_getdns_rdf_iter_init(&drdf_spc,&drr->rr_i))
|| !(dname_rdata = priv_getdns_rdf_if_or_as_decompressed(
|| !(drdf=_getdns_rdf_iter_init(&drdf_spc,&drr->rr_i))
|| !(dname_rdata = _getdns_rdf_if_or_as_decompressed(
drdf, dname_rdata_spc, &dname_rdata_len)))
continue;
@ -1041,7 +1041,7 @@ static void add_question2val_chain(struct mem_funcs *mf,
uint8_t cname_spc[256];
size_t cname_len = sizeof(cname_spc);
size_t anti_loop;
priv_getdns_rdf_iter rdf_spc, *rdf;
_getdns_rdf_iter rdf_spc, *rdf;
rrtype_iter *rr, rr_spc;
chain_head *head;
@ -1060,9 +1060,9 @@ static void add_question2val_chain(struct mem_funcs *mf,
for (anti_loop = MAX_CNAMES; anti_loop; anti_loop--) {
if (!(rr = rrtype_iter_init(&rr_spc, &q_rrset)))
break;
if (!(rdf = priv_getdns_rdf_iter_init(&rdf_spc, &rr->rr_i)))
if (!(rdf = _getdns_rdf_iter_init(&rdf_spc, &rr->rr_i)))
break;
q_rrset.name = priv_getdns_rdf_if_or_as_decompressed(
q_rrset.name = _getdns_rdf_if_or_as_decompressed(
rdf, cname_spc, &cname_len);
}
q_rrset.rr_type = qtype;
@ -1103,7 +1103,7 @@ static void val_chain_sched_soa_node(chain_node *node)
DEBUG_SEC("schedule SOA lookup for %s\n", name);
if (! node->soa_req &&
! priv_getdns_general_loop(context, loop, name, GETDNS_RRTYPE_SOA,
! _getdns_general_loop(context, loop, name, GETDNS_RRTYPE_SOA,
dnssec_ok_checking_disabled, node, &dnsreq, NULL,
val_chain_node_soa_cb))
@ -1150,13 +1150,13 @@ static void val_chain_sched_node(chain_node *node)
DEBUG_SEC("schedule DS & DNSKEY lookup for %s\n", name);
if (! node->dnskey_req /* not scheduled */ &&
! priv_getdns_general_loop(context, loop, name, GETDNS_RRTYPE_DNSKEY,
! _getdns_general_loop(context, loop, name, GETDNS_RRTYPE_DNSKEY,
dnssec_ok_checking_disabled, node, &dnsreq, NULL, val_chain_node_cb))
node->dnskey_req = dnsreq->netreqs[0];
if (! node->ds_req && node->parent /* not root */ &&
! priv_getdns_general_loop(context, loop, name, GETDNS_RRTYPE_DS,
! _getdns_general_loop(context, loop, name, GETDNS_RRTYPE_DS,
dnssec_ok_checking_disabled, node, &dnsreq, NULL, val_chain_node_cb))
node->ds_req = dnsreq->netreqs[0];
@ -1192,7 +1192,7 @@ static void val_chain_sched_ds_node(chain_node *node)
DEBUG_SEC("schedule DS lookup for %s\n", name);
if (! node->ds_req && node->parent /* not root */ &&
! priv_getdns_general_loop(context, loop, name, GETDNS_RRTYPE_DS,
! _getdns_general_loop(context, loop, name, GETDNS_RRTYPE_DS,
dnssec_ok_checking_disabled, node, &ds_req, NULL, val_chain_node_cb))
node->ds_req = ds_req->netreqs[0];
@ -1214,14 +1214,14 @@ static void val_chain_sched_ds(chain_head *head, uint8_t *dname)
static void val_chain_sched_signer_node(chain_node *node, rrsig_iter *rrsig)
{
priv_getdns_rdf_iter rdf_spc, *rdf;
_getdns_rdf_iter rdf_spc, *rdf;
uint8_t signer_spc[256], *signer;
size_t signer_len;
if (!(rdf = priv_getdns_rdf_iter_init_at(&rdf_spc, &rrsig->rr_i, 7)))
if (!(rdf = _getdns_rdf_iter_init_at(&rdf_spc, &rrsig->rr_i, 7)))
return;
if (!(signer = priv_getdns_rdf_if_or_as_decompressed(
if (!(signer = _getdns_rdf_if_or_as_decompressed(
rdf, signer_spc, &signer_len)))
return;
@ -1314,7 +1314,7 @@ static int key_matches_signer(getdns_rrset *dnskey, getdns_rrset *rrset)
rrtype_iter rr_spc, *rr;
rrsig_iter rrsig_spc, *rrsig;
uint16_t keytag;
priv_getdns_rdf_iter rdf_spc, *rdf;
_getdns_rdf_iter rdf_spc, *rdf;
uint8_t signer_spc[256], *signer;
size_t signer_len = sizeof(signer_spc);
@ -1347,10 +1347,10 @@ static int key_matches_signer(getdns_rrset *dnskey, getdns_rrset *rrset)
== keytag
/* Does the signer name match? */
&& (rdf = priv_getdns_rdf_iter_init_at(
&& (rdf = _getdns_rdf_iter_init_at(
&rdf_spc, &rrsig->rr_i, 7))
&& (signer = priv_getdns_rdf_if_or_as_decompressed(
&& (signer = _getdns_rdf_if_or_as_decompressed(
rdf, signer_spc, &signer_len))
&& _dname_equal(dnskey->name, signer))
@ -1361,13 +1361,13 @@ static int key_matches_signer(getdns_rrset *dnskey, getdns_rrset *rrset)
return 0;
}
static ldns_rr *rr2ldns_rr(priv_getdns_rr_iter *rr)
static ldns_rr *rr2ldns_rr(_getdns_rr_iter *rr)
{
ldns_rr *rr_l;
size_t pos = rr->pos - rr->pkt;
if (ldns_wire2rr(&rr_l, rr->pkt, rr->pkt_end - rr->pkt, &pos,
(ldns_pkt_section)priv_getdns_rr_iter_section(rr)))
(ldns_pkt_section)_getdns_rr_iter_section(rr)))
return NULL;
else
return rr_l;
@ -1484,7 +1484,7 @@ static uint8_t *name2nsec3_label(
getdns_rrset *nsec3, uint8_t *name, uint8_t *label, size_t label_len)
{
rrsig_iter rrsig_spc, *rrsig;
priv_getdns_rdf_iter rdf_spc, *rdf;
_getdns_rdf_iter rdf_spc, *rdf;
uint8_t signer_spc[256], *signer;
size_t signer_len = sizeof(signer_spc);
rrtype_iter rr_spc, *rr;
@ -1493,11 +1493,11 @@ static uint8_t *name2nsec3_label(
(rrsig = rrsig_iter_init(&rrsig_spc, nsec3))
/* Access the signer name rdata field (7th) */
&& (rdf = priv_getdns_rdf_iter_init_at(
&& (rdf = _getdns_rdf_iter_init_at(
&rdf_spc, &rrsig->rr_i, 7))
/* Verify & decompress */
&& (signer = priv_getdns_rdf_if_or_as_decompressed(
&& (signer = _getdns_rdf_if_or_as_decompressed(
rdf, signer_spc, &signer_len))
/* signer of the NSEC3 is direct parent for this NSEC3? */
@ -1564,7 +1564,7 @@ static int dnskey_signed_rrset(
rrtype_iter *dnskey, getdns_rrset *rrset, uint8_t **nc_name)
{
rrsig_iter rrsig_spc, *rrsig;
priv_getdns_rdf_iter rdf_spc, *rdf;
_getdns_rdf_iter rdf_spc, *rdf;
uint8_t signer_spc[256], *signer;
size_t signer_len = sizeof(signer_spc);
uint16_t keytag;
@ -1595,10 +1595,10 @@ static int dnskey_signed_rrset(
&& gldns_read_uint16(rrsig->rr_i.rr_type + 26) == keytag
/* Does the signer name match? */
&& (rdf = priv_getdns_rdf_iter_init_at(
&& (rdf = _getdns_rdf_iter_init_at(
&rdf_spc, &rrsig->rr_i, 7))
&& (signer = priv_getdns_rdf_if_or_as_decompressed(
&& (signer = _getdns_rdf_if_or_as_decompressed(
rdf, signer_spc, &signer_len))
&& _dname_equal(dnskey->rrset->name, signer)
@ -1806,16 +1806,16 @@ static int nsec_covers_name(
uint8_t next_spc[256], *next;
size_t next_len = sizeof(next_spc);
rrtype_iter rr_spc, *rr;
priv_getdns_rdf_iter rdf_spc, *rdf;
_getdns_rdf_iter rdf_spc, *rdf;
int nsec_cmp;
uint8_t *common1, *common2;
if (/* Get owner and next, nicely decompressed */
!(rr = rrtype_iter_init(&rr_spc, nsec))
|| !(rdf = priv_getdns_rdf_iter_init(&rdf_spc, &rr->rr_i))
|| !(owner = priv_getdns_owner_if_or_as_decompressed(
|| !(rdf = _getdns_rdf_iter_init(&rdf_spc, &rr->rr_i))
|| !(owner = _getdns_owner_if_or_as_decompressed(
&rr->rr_i, owner_spc, &owner_len))
|| !(next = priv_getdns_rdf_if_or_as_decompressed(
|| !(next = _getdns_rdf_if_or_as_decompressed(
rdf, next_spc, &next_len)))
return 0;
@ -1874,7 +1874,7 @@ static int nsec3_covers_name(getdns_rrset *nsec3, uint8_t *name, int *opt_out)
{
uint8_t label[65], next[65], owner[65];
rrtype_iter rr_spc, *rr;
priv_getdns_rdf_iter rdf_spc, *rdf;
_getdns_rdf_iter rdf_spc, *rdf;
int nsz = 0, nsec_cmp;
if (!name2nsec3_label(nsec3, name, label, sizeof(label)-1))
@ -1883,7 +1883,7 @@ static int nsec3_covers_name(getdns_rrset *nsec3, uint8_t *name, int *opt_out)
label[label[0]+1] = 0;
if ( !(rr = rrtype_iter_init(&rr_spc, nsec3))
|| !(rdf = priv_getdns_rdf_iter_init_at(&rdf_spc, &rr->rr_i, 4))
|| !(rdf = _getdns_rdf_iter_init_at(&rdf_spc, &rr->rr_i, 4))
|| rdf->pos + *rdf->pos + 1 > rdf->nxt
|| (nsz = gldns_b32_ntop_extended_hex(rdf->pos + 1, *rdf->pos,
(char *)next + 1, sizeof(next)-2)) < 0
@ -1926,7 +1926,7 @@ static int find_nsec_covering_name(
rrset_iter i_spc, *i;
getdns_rrset *n;
rrtype_iter nsec_spc, *nsec_rr;
priv_getdns_rdf_iter bitmap_spc, *bitmap;
_getdns_rdf_iter bitmap_spc, *bitmap;
int keytag;
if (opt_out)
@ -1939,7 +1939,7 @@ static int find_nsec_covering_name(
/* Get the bitmap rdata field */
&& (nsec_rr = rrtype_iter_init(&nsec_spc, n))
&& (bitmap = priv_getdns_rdf_iter_init_at(
&& (bitmap = _getdns_rdf_iter_init_at(
&bitmap_spc, &nsec_rr->rr_i, 5))
&& (keytag = a_key_signed_rrset(dnskey, n))
@ -1976,7 +1976,7 @@ static int find_nsec_covering_name(
/* Get the bitmap rdata field */
&& (nsec_rr = rrtype_iter_init(&nsec_spc, n))
&& (bitmap = priv_getdns_rdf_iter_init_at(
&& (bitmap = _getdns_rdf_iter_init_at(
&bitmap_spc, &nsec_rr->rr_i, 1))
/* NSEC should cover, but not match name...
@ -2070,7 +2070,7 @@ static int key_proves_nonexistance(
{
getdns_rrset nsec_rrset, *cover, *ce;
rrtype_iter nsec_spc, *nsec_rr;
priv_getdns_rdf_iter bitmap_spc, *bitmap;
_getdns_rdf_iter bitmap_spc, *bitmap;
rrset_iter i_spc, *i;
uint8_t *ce_name, *nc_name;
uint8_t wc_name[256] = { 1, (uint8_t)'*' };
@ -2093,7 +2093,7 @@ static int key_proves_nonexistance(
(nsec_rr = rrtype_iter_init(&nsec_spc, &nsec_rrset))
/* Get the bitmap rdata field */
&& (bitmap = priv_getdns_rdf_iter_init_at(
&& (bitmap = _getdns_rdf_iter_init_at(
&bitmap_spc, &nsec_rr->rr_i, 1))
/* At least the rr_type of rrset should be missing from it */
@ -2163,7 +2163,7 @@ static int key_proves_nonexistance(
/* Get the bitmap rdata field */
|| !(nsec_rr = rrtype_iter_init(&nsec_spc, cover))
|| !(bitmap = priv_getdns_rdf_iter_init_at(
|| !(bitmap = _getdns_rdf_iter_init_at(
&bitmap_spc, &nsec_rr->rr_i, 1))
/* When qname is a subdomain of the NSEC owner, make
@ -2230,7 +2230,7 @@ static int key_proves_nonexistance(
&& (nsec_rr = rrtype_iter_init(&nsec_spc, ce))
/* Get the bitmap rdata field */
&& (bitmap = priv_getdns_rdf_iter_init_at(
&& (bitmap = _getdns_rdf_iter_init_at(
&bitmap_spc, &nsec_rr->rr_i, 5))
/* At least the rr_type of rrset should be missing */
@ -2295,7 +2295,7 @@ static int key_proves_nonexistance(
/* Get the bitmap rdata field */
|| !(nsec_rr = rrtype_iter_init(&nsec_spc, ce))
|| !(bitmap = priv_getdns_rdf_iter_init_at(
|| !(bitmap = _getdns_rdf_iter_init_at(
&bitmap_spc, &nsec_rr->rr_i, 1))
/* No DNAME or delegation point at the closest
@ -2677,7 +2677,7 @@ static void append_rrs2val_chain_list(getdns_context *ctxt,
for ( rr = rrtype_iter_init(&rr_spc, rrset)
; rr; rr = rrtype_iter_next(rr)) {
if (!(rr_dict = priv_getdns_rr_iter2rr_dict(
if (!(rr_dict = _getdns_rr_iter2rr_dict(
&ctxt->mf, &rr->rr_i)))
continue;
@ -2696,7 +2696,7 @@ static void append_rrs2val_chain_list(getdns_context *ctxt,
!= (signer & 0xFFFF))
/* Could not convert to rr_dict */
|| !(rr_dict = priv_getdns_rr_iter2rr_dict(
|| !(rr_dict = _getdns_rr_iter2rr_dict(
&ctxt->mf, &rrsig->rr_i)))
continue;
@ -2823,11 +2823,11 @@ static void check_chain_complete(chain_head *chain)
}
/* Final user callback */
priv_getdns_call_user_callback(dnsreq, response_dict);
_getdns_call_user_callback(dnsreq, response_dict);
}
void priv_getdns_get_validation_chain(getdns_dns_req *dnsreq)
void _getdns_get_validation_chain(getdns_dns_req *dnsreq)
{
getdns_network_req *netreq, **netreq_p;
chain_head *chain = NULL;
@ -2858,7 +2858,7 @@ void priv_getdns_get_validation_chain(getdns_dns_req *dnsreq)
if (chain)
check_chain_complete(chain);
else
priv_getdns_call_user_callback(dnsreq,
_getdns_call_user_callback(dnsreq,
create_getdns_response(dnsreq));
}
@ -2878,7 +2878,7 @@ static int wire_validate_dnssec(uint8_t *to_val, size_t to_val_len,
size_t qname_len = sizeof(qname_spc);
uint16_t qtype = 0, qclass = GETDNS_RRCLASS_IN;
priv_getdns_rr_iter rr_spc, *rr;
_getdns_rr_iter rr_spc, *rr;
rrset_iter tas_iter;
int s;
@ -2908,9 +2908,9 @@ static int wire_validate_dnssec(uint8_t *to_val, size_t to_val_len,
/* For each question in the question section add a chain head.
*/
if ( (rr = priv_getdns_rr_iter_init(&rr_spc, to_val, to_val_len))
&& priv_getdns_rr_iter_section(rr) == GLDNS_SECTION_QUESTION
&& (qname = priv_getdns_owner_if_or_as_decompressed(
if ( (rr = _getdns_rr_iter_init(&rr_spc, to_val, to_val_len))
&& _getdns_rr_iter_section(rr) == GLDNS_SECTION_QUESTION
&& (qname = _getdns_owner_if_or_as_decompressed(
rr, qname_spc, &qname_len))
&& rr->nxt >= rr->rr_type + 4) {

View File

@ -2,7 +2,7 @@
*
* /brief functions for DNSSEC
*
* The priv_getdns_get_validation_chain function is called after an answer
* The _getdns_get_validation_chain function is called after an answer
* has been fetched when the dnssec_return_validation_chain extension is set.
* It fetches DNSKEYs, DSes and their signatures for all RRSIGs found in the
* answer.
@ -44,7 +44,7 @@
#include "types-internal.h"
/* Do some additional requests to fetch the complete validation chain */
void priv_getdns_get_validation_chain(getdns_dns_req *dns_req);
void _getdns_get_validation_chain(getdns_dns_req *dns_req);
uint16_t _getdns_parse_ta_file(time_t *ta_mtime, gldns_buffer *gbuf);

View File

@ -53,7 +53,7 @@ ub_resolve_timeout(void *arg)
(void) getdns_context_request_timed_out(dns_req);
}
void priv_getdns_call_user_callback(getdns_dns_req *dns_req,
void _getdns_call_user_callback(getdns_dns_req *dns_req,
struct getdns_dict *response)
{
struct getdns_context *context = dns_req->context;
@ -71,7 +71,7 @@ void priv_getdns_call_user_callback(getdns_dns_req *dns_req,
}
void
priv_getdns_check_dns_req_complete(getdns_dns_req *dns_req)
_getdns_check_dns_req_complete(getdns_dns_req *dns_req)
{
getdns_network_req **netreq_p, *netreq;
int results_found = 0;
@ -86,7 +86,7 @@ priv_getdns_check_dns_req_complete(getdns_dns_req *dns_req)
if (dns_req->internal_cb)
dns_req->internal_cb(dns_req);
else if (! results_found)
priv_getdns_call_user_callback(dns_req, NULL);
_getdns_call_user_callback(dns_req, NULL);
else if (dns_req->dnssec_return_validation_chain
#ifdef STUB_NATIVE_DNSSEC
|| (dns_req->context->resolution_type == GETDNS_RESOLUTION_STUB
@ -94,9 +94,9 @@ priv_getdns_check_dns_req_complete(getdns_dns_req *dns_req)
dns_req->dnssec_return_only_secure))
#endif
)
priv_getdns_get_validation_chain(dns_req);
_getdns_get_validation_chain(dns_req);
else
priv_getdns_call_user_callback(
_getdns_call_user_callback(
dns_req, create_getdns_response(dns_req));
}
@ -109,18 +109,18 @@ ub_resolve_callback(void* arg, int err, struct ub_result* ub_res)
netreq->state = NET_REQ_FINISHED;
if (err != 0) {
priv_getdns_call_user_callback(dns_req, NULL);
_getdns_call_user_callback(dns_req, NULL);
return;
}
/* parse */
if (getdns_apply_network_result(netreq, ub_res)) {
ub_resolve_free(ub_res);
priv_getdns_call_user_callback(dns_req, NULL);
_getdns_call_user_callback(dns_req, NULL);
return;
}
ub_resolve_free(ub_res);
priv_getdns_check_dns_req_complete(dns_req);
_getdns_check_dns_req_complete(dns_req);
} /* ub_resolve_callback */
#endif
@ -168,7 +168,7 @@ submit_network_request(getdns_network_req *netreq)
#endif
}
/* Submit with stub resolver */
return priv_getdns_submit_stub_request(netreq);
return _getdns_submit_stub_request(netreq);
}
static getdns_return_t
@ -186,10 +186,10 @@ getdns_general_ns(getdns_context *context, getdns_eventloop *loop,
if (!context || !name || (!callbackfn && !internal_cb))
return GETDNS_RETURN_INVALID_PARAMETER;
if ((r = priv_getdns_validate_dname(name)))
if ((r = _getdns_validate_dname(name)))
return r;
if (extensions && (r = priv_getdns_validate_extensions(extensions)))
if (extensions && (r = _getdns_validate_extensions(extensions)))
return r;
/* Set up the context assuming we won't use the specified namespaces.
@ -223,7 +223,7 @@ getdns_general_ns(getdns_context *context, getdns_eventloop *loop,
if (!(r = getdns_context_local_namespace_resolve(
req, &localnames_response))) {
priv_getdns_call_user_callback
_getdns_call_user_callback
( req, localnames_response);
break;
}
@ -253,7 +253,7 @@ getdns_general_ns(getdns_context *context, getdns_eventloop *loop,
} /* getdns_general_ns */
getdns_return_t
priv_getdns_general_loop(getdns_context *context, getdns_eventloop *loop,
_getdns_general_loop(getdns_context *context, getdns_eventloop *loop,
const char *name, uint16_t request_type, getdns_dict *extensions,
void *userarg, getdns_dns_req **dnsreq_p,
getdns_callback_t callback, internal_cb_t internal_cb)
@ -265,7 +265,7 @@ priv_getdns_general_loop(getdns_context *context, getdns_eventloop *loop,
} /* getdns_general_loop */
getdns_return_t
priv_getdns_address_loop(getdns_context *context, getdns_eventloop *loop,
_getdns_address_loop(getdns_context *context, getdns_eventloop *loop,
const char *name, getdns_dict *extensions, void *userarg,
getdns_transaction_t *transaction_id, getdns_callback_t callback)
{
@ -299,7 +299,7 @@ priv_getdns_address_loop(getdns_context *context, getdns_eventloop *loop,
} /* getdns_address_loop */
getdns_return_t
priv_getdns_hostname_loop(getdns_context *context, getdns_eventloop *loop,
_getdns_hostname_loop(getdns_context *context, getdns_eventloop *loop,
getdns_dict *address, getdns_dict *extensions, void *userarg,
getdns_transaction_t *transaction_id, getdns_callback_t callback)
{
@ -381,7 +381,7 @@ priv_getdns_hostname_loop(getdns_context *context, getdns_eventloop *loop,
default:
return GETDNS_RETURN_INVALID_PARAMETER;
}
retval = priv_getdns_general_loop(context, loop, name, req_type,
retval = _getdns_general_loop(context, loop, name, req_type,
extensions, userarg, &dnsreq, callback, NULL);
if (dnsreq && transaction_id)
*transaction_id = dnsreq->trans_id;
@ -389,7 +389,7 @@ priv_getdns_hostname_loop(getdns_context *context, getdns_eventloop *loop,
} /* getdns_hostname_loop */
getdns_return_t
priv_getdns_service_loop(getdns_context *context, getdns_eventloop *loop,
_getdns_service_loop(getdns_context *context, getdns_eventloop *loop,
const char *name, getdns_dict *extensions, void *userarg,
getdns_transaction_t * transaction_id, getdns_callback_t callback)
{
@ -415,7 +415,7 @@ getdns_general(getdns_context *context,
getdns_dns_req *dnsreq = NULL;
if (!context) return GETDNS_RETURN_INVALID_PARAMETER;
r = priv_getdns_general_loop(context, context->extension,
r = _getdns_general_loop(context, context->extension,
name, request_type, extensions,
userarg, &dnsreq, callback, NULL);
if (dnsreq && transaction_id)
@ -433,7 +433,7 @@ getdns_address(getdns_context *context,
getdns_transaction_t *transaction_id, getdns_callback_t callback)
{
if (!context) return GETDNS_RETURN_INVALID_PARAMETER;
return priv_getdns_address_loop(context, context->extension,
return _getdns_address_loop(context, context->extension,
name, extensions, userarg,
transaction_id, callback);
} /* getdns_address */
@ -448,7 +448,7 @@ getdns_hostname(getdns_context *context,
getdns_transaction_t *transaction_id, getdns_callback_t callback)
{
if (!context) return GETDNS_RETURN_INVALID_PARAMETER;
return priv_getdns_hostname_loop(context, context->extension,
return _getdns_hostname_loop(context, context->extension,
address, extensions, userarg, transaction_id, callback);
} /* getdns_hostname */
@ -462,7 +462,7 @@ getdns_service(getdns_context *context,
getdns_transaction_t *transaction_id, getdns_callback_t callback)
{
if (!context) return GETDNS_RETURN_INVALID_PARAMETER;
return priv_getdns_service_loop(context, context->extension,
return _getdns_service_loop(context, context->extension,
name, extensions, userarg, transaction_id, callback);
} /* getdns_service */

View File

@ -42,29 +42,29 @@
/* private inner helper used by sync and async */
void priv_getdns_call_user_callback(getdns_dns_req *, getdns_dict *);
void priv_getdns_check_dns_req_complete(getdns_dns_req *dns_req);
void _getdns_call_user_callback(getdns_dns_req *, getdns_dict *);
void _getdns_check_dns_req_complete(getdns_dns_req *dns_req);
getdns_return_t
priv_getdns_general_loop(getdns_context *context, getdns_eventloop *loop,
_getdns_general_loop(getdns_context *context, getdns_eventloop *loop,
const char *name, uint16_t request_type, getdns_dict *extensions,
void *userarg, getdns_dns_req **dnsreq,
getdns_callback_t callbackfn, internal_cb_t internal_cb);
getdns_return_t
priv_getdns_address_loop(getdns_context *context, getdns_eventloop *loop,
_getdns_address_loop(getdns_context *context, getdns_eventloop *loop,
const char *name, getdns_dict *extensions,
void *userarg, getdns_transaction_t *transaction_id,
getdns_callback_t callbackfn);
getdns_return_t
priv_getdns_hostname_loop(getdns_context *context, getdns_eventloop *loop,
_getdns_hostname_loop(getdns_context *context, getdns_eventloop *loop,
getdns_dict *address, getdns_dict *extensions,
void *userarg, getdns_transaction_t *transaction_id,
getdns_callback_t callbackfn);
getdns_return_t
priv_getdns_service_loop(getdns_context *context, getdns_eventloop *loop,
_getdns_service_loop(getdns_context *context, getdns_eventloop *loop,
const char *name, getdns_dict *extensions,
void *userarg, getdns_transaction_t *transaction_id,
getdns_callback_t callbackfn);

View File

@ -191,7 +191,7 @@ dns_req_free(getdns_dns_req * req)
return;
}
priv_getdns_upstreams_dereference(req->upstreams);
_getdns_upstreams_dereference(req->upstreams);
/* cleanup network requests */
for (net_req = req->netreqs; *net_req; net_req++)

View File

@ -59,7 +59,7 @@ apl_n_list_append_value(getdns_list *list, uint8_t *rdf)
{
return getdns_list_append_int(list, (*rdf >> 7));
}
static priv_getdns_rdf_special apl_n = {
static _getdns_rdf_special apl_n = {
apl_n_rdf_end, apl_n_dict_set_value, apl_n_list_append_value
};
@ -81,7 +81,7 @@ apl_afdpart_list_append_value(getdns_list *list, uint8_t *rdf)
getdns_bindata bindata = { (rdf[-1] & 0x7F), rdf };
return getdns_list_append_bindata(list, &bindata);
}
static priv_getdns_rdf_special apl_afdpart = {
static _getdns_rdf_special apl_afdpart = {
apl_afdpart_rdf_end,
apl_afdpart_dict_set_value, apl_afdpart_list_append_value
};
@ -167,7 +167,7 @@ ipseckey_gateway_list_append_value(getdns_list *list, uint8_t *rdf)
else
return getdns_list_append_bindata(list, &bindata);
}
static priv_getdns_rdf_special ipseckey_gateway = {
static _getdns_rdf_special ipseckey_gateway = {
ipseckey_gateway_rdf_end,
ipseckey_gateway_dict_set_value, ipseckey_gateway_list_append_value
};
@ -189,7 +189,7 @@ hip_pk_algorithm_list_append_value(getdns_list *list, uint8_t *rdf)
{
return getdns_list_append_int(list, rdf[1]);
}
static priv_getdns_rdf_special hip_pk_algorithm = {
static _getdns_rdf_special hip_pk_algorithm = {
hip_pk_algorithm_rdf_end,
hip_pk_algorithm_dict_set_value, hip_pk_algorithm_list_append_value
};
@ -213,7 +213,7 @@ hip_hit_list_append_value(getdns_list *list, uint8_t *rdf)
getdns_bindata bindata = { rdf[-1], rdf + 3 };
return getdns_list_append_bindata(list, &bindata);
}
static priv_getdns_rdf_special hip_hit = {
static _getdns_rdf_special hip_hit = {
hip_hit_rdf_end, hip_hit_dict_set_value, hip_hit_list_append_value
};
@ -236,21 +236,21 @@ hip_public_key_list_append_value(getdns_list *list, uint8_t *rdf)
getdns_bindata bindata = { gldns_read_uint16(rdf), rdf + 2 + rdf[-2] };
return getdns_list_append_bindata(list, &bindata);
}
static priv_getdns_rdf_special hip_public_key = {
static _getdns_rdf_special hip_public_key = {
hip_public_key_rdf_end,
hip_public_key_dict_set_value, hip_public_key_list_append_value
};
static priv_getdns_rdata_def a_rdata[] = {
static _getdns_rdata_def a_rdata[] = {
{ "ipv4_address" , GETDNS_RDF_A }};
static priv_getdns_rdata_def ns_rdata[] = {
static _getdns_rdata_def ns_rdata[] = {
{ "nsdname" , GETDNS_RDF_N_C }};
static priv_getdns_rdata_def md_rdata[] = {
static _getdns_rdata_def md_rdata[] = {
{ "madname" , GETDNS_RDF_N_C }};
static priv_getdns_rdata_def cname_rdata[] = {
static _getdns_rdata_def cname_rdata[] = {
{ "cname" , GETDNS_RDF_N_C }};
static priv_getdns_rdata_def soa_rdata[] = {
static _getdns_rdata_def soa_rdata[] = {
{ "mname" , GETDNS_RDF_N_C },
{ "rname" , GETDNS_RDF_N_C },
{ "serial" , GETDNS_RDF_I4 },
@ -258,115 +258,115 @@ static priv_getdns_rdata_def soa_rdata[] = {
{ "retry" , GETDNS_RDF_I4 },
{ "expire" , GETDNS_RDF_I4 },
{ "minimum" , GETDNS_RDF_I4 }};
static priv_getdns_rdata_def mg_rdata[] = {
static _getdns_rdata_def mg_rdata[] = {
{ "mgmname" , GETDNS_RDF_N_C }};
static priv_getdns_rdata_def mr_rdata[] = {
static _getdns_rdata_def mr_rdata[] = {
{ "newname" , GETDNS_RDF_N_C }};
static priv_getdns_rdata_def null_rdata[] = {
static _getdns_rdata_def null_rdata[] = {
{ "anything" , GETDNS_RDF_X }};
static priv_getdns_rdata_def wks_rdata[] = {
static _getdns_rdata_def wks_rdata[] = {
{ "address" , GETDNS_RDF_A },
{ "protocol" , GETDNS_RDF_I1 },
{ "bitmap" , GETDNS_RDF_X }};
static priv_getdns_rdata_def ptr_rdata[] = {
static _getdns_rdata_def ptr_rdata[] = {
{ "ptrdname" , GETDNS_RDF_N_C }};
static priv_getdns_rdata_def hinfo_rdata[] = {
static _getdns_rdata_def hinfo_rdata[] = {
{ "cpu" , GETDNS_RDF_S },
{ "os" , GETDNS_RDF_S }};
static priv_getdns_rdata_def minfo_rdata[] = {
static _getdns_rdata_def minfo_rdata[] = {
{ "rmailbx" , GETDNS_RDF_N_C },
{ "emailbx" , GETDNS_RDF_N_C }};
static priv_getdns_rdata_def mx_rdata[] = {
static _getdns_rdata_def mx_rdata[] = {
{ "preference" , GETDNS_RDF_I2 },
{ "exchange" , GETDNS_RDF_N_C }};
static priv_getdns_rdata_def txt_rdata[] = {
static _getdns_rdata_def txt_rdata[] = {
{ "txt_strings" , GETDNS_RDF_S_M }};
static priv_getdns_rdata_def rp_rdata[] = {
static _getdns_rdata_def rp_rdata[] = {
{ "mbox_dname" , GETDNS_RDF_N },
{ "txt_dname" , GETDNS_RDF_N }};
static priv_getdns_rdata_def afsdb_rdata[] = {
static _getdns_rdata_def afsdb_rdata[] = {
{ "subtype" , GETDNS_RDF_I2 },
{ "hostname" , GETDNS_RDF_N }};
static priv_getdns_rdata_def x25_rdata[] = {
static _getdns_rdata_def x25_rdata[] = {
{ "psdn_address" , GETDNS_RDF_S }};
static priv_getdns_rdata_def isdn_rdata[] = {
static _getdns_rdata_def isdn_rdata[] = {
{ "isdn_address" , GETDNS_RDF_S },
{ "sa" , GETDNS_RDF_S }};
static priv_getdns_rdata_def rt_rdata[] = {
static _getdns_rdata_def rt_rdata[] = {
{ "preference" , GETDNS_RDF_I2 },
{ "intermediate_host" , GETDNS_RDF_N }};
static priv_getdns_rdata_def nsap_rdata[] = {
static _getdns_rdata_def nsap_rdata[] = {
{ "nsap" , GETDNS_RDF_X }};
static priv_getdns_rdata_def sig_rdata[] = {
static _getdns_rdata_def sig_rdata[] = {
{ "sig_obsolete" , GETDNS_RDF_X }};
static priv_getdns_rdata_def key_rdata[] = {
static _getdns_rdata_def key_rdata[] = {
{ "key_obsolete" , GETDNS_RDF_X }};
static priv_getdns_rdata_def px_rdata[] = {
static _getdns_rdata_def px_rdata[] = {
{ "preference" , GETDNS_RDF_I2 },
{ "map822" , GETDNS_RDF_N },
{ "mapx400" , GETDNS_RDF_N }};
static priv_getdns_rdata_def gpos_rdata[] = {
static _getdns_rdata_def gpos_rdata[] = {
{ "longitude" , GETDNS_RDF_S },
{ "latitude" , GETDNS_RDF_S },
{ "altitude" , GETDNS_RDF_S }};
static priv_getdns_rdata_def aaaa_rdata[] = {
static _getdns_rdata_def aaaa_rdata[] = {
{ "ipv6_address" , GETDNS_RDF_AAAA }};
static priv_getdns_rdata_def loc_rdata[] = {
static _getdns_rdata_def loc_rdata[] = {
{ "loc_obsolete" , GETDNS_RDF_X }};
static priv_getdns_rdata_def nxt_rdata[] = {
static _getdns_rdata_def nxt_rdata[] = {
{ "nxt_obsolete" , GETDNS_RDF_X }};
static priv_getdns_rdata_def srv_rdata[] = {
static _getdns_rdata_def srv_rdata[] = {
{ "priority" , GETDNS_RDF_I2 },
{ "weight" , GETDNS_RDF_I2 },
{ "port" , GETDNS_RDF_I2 },
{ "target" , GETDNS_RDF_N }};
static priv_getdns_rdata_def atma_rdata[] = {
static _getdns_rdata_def atma_rdata[] = {
{ "format" , GETDNS_RDF_X }};
static priv_getdns_rdata_def naptr_rdata[] = {
static _getdns_rdata_def naptr_rdata[] = {
{ "order" , GETDNS_RDF_I2 },
{ "preference" , GETDNS_RDF_I2 },
{ "flags" , GETDNS_RDF_S },
{ "service" , GETDNS_RDF_S },
{ "regexp" , GETDNS_RDF_S },
{ "replacement" , GETDNS_RDF_N }};
static priv_getdns_rdata_def kx_rdata[] = {
static _getdns_rdata_def kx_rdata[] = {
{ "preference" , GETDNS_RDF_I2 },
{ "exchanger" , GETDNS_RDF_N }};
static priv_getdns_rdata_def cert_rdata[] = {
static _getdns_rdata_def cert_rdata[] = {
{ "type" , GETDNS_RDF_I2 },
{ "key_tag" , GETDNS_RDF_I2 },
{ "algorithm" , GETDNS_RDF_I1 },
{ "certificate_or_crl" , GETDNS_RDF_B }};
static priv_getdns_rdata_def a6_rdata[] = {
static _getdns_rdata_def a6_rdata[] = {
{ "a6_obsolete" , GETDNS_RDF_X }};
static priv_getdns_rdata_def dname_rdata[] = {
static _getdns_rdata_def dname_rdata[] = {
{ "target" , GETDNS_RDF_N }};
static priv_getdns_rdata_def opt_rdata[] = {
static _getdns_rdata_def opt_rdata[] = {
{ "options" , GETDNS_RDF_R },
{ "option_code" , GETDNS_RDF_I2 },
{ "option_data" , GETDNS_RDF_X_S }};
static priv_getdns_rdata_def apl_rdata[] = {
static _getdns_rdata_def apl_rdata[] = {
{ "apitems" , GETDNS_RDF_R },
{ "address_family" , GETDNS_RDF_I2 },
{ "prefix" , GETDNS_RDF_I1 },
{ "n" , GETDNS_RDF_SPECIAL, &apl_n },
{ "afdpart" , GETDNS_RDF_SPECIAL, &apl_afdpart }};
static priv_getdns_rdata_def ds_rdata[] = {
static _getdns_rdata_def ds_rdata[] = {
{ "key_tag" , GETDNS_RDF_I2 },
{ "algorithm" , GETDNS_RDF_I1 },
{ "digest_type" , GETDNS_RDF_I1 },
{ "digest" , GETDNS_RDF_X }};
static priv_getdns_rdata_def sshfp_rdata[] = {
static _getdns_rdata_def sshfp_rdata[] = {
{ "algorithm" , GETDNS_RDF_I1 },
{ "fp_type" , GETDNS_RDF_I1 },
{ "fingerprint" , GETDNS_RDF_X }};
static priv_getdns_rdata_def ipseckey_rdata[] = {
static _getdns_rdata_def ipseckey_rdata[] = {
{ "algorithm" , GETDNS_RDF_I1 },
{ "gateway_type" , GETDNS_RDF_I1 },
{ "precedence" , GETDNS_RDF_I1 },
{ "gateway" , GETDNS_RDF_SPECIAL, &ipseckey_gateway },
{ "public_key" , GETDNS_RDF_B }};
static priv_getdns_rdata_def rrsig_rdata[] = {
static _getdns_rdata_def rrsig_rdata[] = {
{ "type_covered" , GETDNS_RDF_I2 },
{ "algorithm" , GETDNS_RDF_I1 },
{ "labels" , GETDNS_RDF_I1 },
@ -376,61 +376,61 @@ static priv_getdns_rdata_def rrsig_rdata[] = {
{ "key_tag" , GETDNS_RDF_I2 },
{ "signers_name" , GETDNS_RDF_N },
{ "signature" , GETDNS_RDF_B }};
static priv_getdns_rdata_def nsec_rdata[] = {
static _getdns_rdata_def nsec_rdata[] = {
{ "next_domain_name" , GETDNS_RDF_N },
{ "type_bit_maps" , GETDNS_RDF_X }};
static priv_getdns_rdata_def dnskey_rdata[] = {
static _getdns_rdata_def dnskey_rdata[] = {
{ "flags" , GETDNS_RDF_I2 },
{ "protocol" , GETDNS_RDF_I1 },
{ "algorithm" , GETDNS_RDF_I1 },
{ "public_key" , GETDNS_RDF_B }};
static priv_getdns_rdata_def dhcid_rdata[] = {
static _getdns_rdata_def dhcid_rdata[] = {
{ "dhcid_opaque" , GETDNS_RDF_B }};
static priv_getdns_rdata_def nsec3_rdata[] = {
static _getdns_rdata_def nsec3_rdata[] = {
{ "hash_algorithm" , GETDNS_RDF_I1 },
{ "flags" , GETDNS_RDF_I1 },
{ "iterations" , GETDNS_RDF_I2 },
{ "salt" , GETDNS_RDF_X_C },
{ "next_hashed_owner_name" , GETDNS_RDF_B32_C},
{ "type_bit_maps" , GETDNS_RDF_X }};
static priv_getdns_rdata_def nsec3param_rdata[] = {
static _getdns_rdata_def nsec3param_rdata[] = {
{ "hash_algorithm" , GETDNS_RDF_I1 },
{ "flags" , GETDNS_RDF_I1 },
{ "iterations" , GETDNS_RDF_I2 },
{ "salt" , GETDNS_RDF_X_C }};
static priv_getdns_rdata_def tlsa_rdata[] = {
static _getdns_rdata_def tlsa_rdata[] = {
{ "certificate_usage" , GETDNS_RDF_I1 },
{ "selector" , GETDNS_RDF_I1 },
{ "matching_type" , GETDNS_RDF_I1 },
{ "certificate_association_data", GETDNS_RDF_X }};
static priv_getdns_rdata_def hip_rdata[] = {
static _getdns_rdata_def hip_rdata[] = {
{ "pk_algorithm" , GETDNS_RDF_SPECIAL, &hip_pk_algorithm },
{ "hit" , GETDNS_RDF_SPECIAL, &hip_hit },
{ "public_key" , GETDNS_RDF_SPECIAL, &hip_public_key },
{ "rendezvous_servers" , GETDNS_RDF_N_M }};
static priv_getdns_rdata_def csync_rdata[] = {
static _getdns_rdata_def csync_rdata[] = {
{ "serial" , GETDNS_RDF_I4 },
{ "flags" , GETDNS_RDF_I2 },
{ "type_bit_maps" , GETDNS_RDF_X }};
static priv_getdns_rdata_def spf_rdata[] = {
static _getdns_rdata_def spf_rdata[] = {
{ "text" , GETDNS_RDF_S_M }};
static priv_getdns_rdata_def nid_rdata[] = {
static _getdns_rdata_def nid_rdata[] = {
{ "preference" , GETDNS_RDF_I2 },
{ "node_id" , GETDNS_RDF_AA }};
static priv_getdns_rdata_def l32_rdata[] = {
static _getdns_rdata_def l32_rdata[] = {
{ "preference" , GETDNS_RDF_I2 },
{ "locator32" , GETDNS_RDF_A }};
static priv_getdns_rdata_def l64_rdata[] = {
static _getdns_rdata_def l64_rdata[] = {
{ "preference" , GETDNS_RDF_I2 },
{ "locator64" , GETDNS_RDF_AA }};
static priv_getdns_rdata_def lp_rdata[] = {
static _getdns_rdata_def lp_rdata[] = {
{ "preference" , GETDNS_RDF_I2 },
{ "fqdn" , GETDNS_RDF_N }};
static priv_getdns_rdata_def eui48_rdata[] = {
static _getdns_rdata_def eui48_rdata[] = {
{ "eui48_address" , GETDNS_RDF_X6 }};
static priv_getdns_rdata_def eui64_rdata[] = {
static _getdns_rdata_def eui64_rdata[] = {
{ "eui64_address" , GETDNS_RDF_X8 }};
static priv_getdns_rdata_def tkey_rdata[] = {
static _getdns_rdata_def tkey_rdata[] = {
{ "algorithm" , GETDNS_RDF_N },
{ "inception" , GETDNS_RDF_T },
{ "expiration" , GETDNS_RDF_T },
@ -438,7 +438,7 @@ static priv_getdns_rdata_def tkey_rdata[] = {
{ "error" , GETDNS_RDF_I2 },
{ "key_data" , GETDNS_RDF_X_S },
{ "other_data" , GETDNS_RDF_X_S }};
static priv_getdns_rdata_def tsig_rdata[] = {
static _getdns_rdata_def tsig_rdata[] = {
{ "algorithm" , GETDNS_RDF_N },
{ "time_signed" , GETDNS_RDF_T6 },
{ "fudge" , GETDNS_RDF_I2 },
@ -446,21 +446,21 @@ static priv_getdns_rdata_def tsig_rdata[] = {
{ "original_id" , GETDNS_RDF_I2 },
{ "error" , GETDNS_RDF_I2 },
{ "other_data" , GETDNS_RDF_X_S }};
static priv_getdns_rdata_def uri_rdata[] = {
static _getdns_rdata_def uri_rdata[] = {
{ "priority" , GETDNS_RDF_I2 },
{ "weight" , GETDNS_RDF_I2 },
{ "target" , GETDNS_RDF_S_L }};
static priv_getdns_rdata_def caa_rdata[] = {
static _getdns_rdata_def caa_rdata[] = {
{ "flags" , GETDNS_RDF_I1 },
{ "tag" , GETDNS_RDF_S },
{ "value" , GETDNS_RDF_S_L }};
static priv_getdns_rdata_def dlv_rdata[] = {
static _getdns_rdata_def dlv_rdata[] = {
{ "key_tag" , GETDNS_RDF_I2 },
{ "algorithm" , GETDNS_RDF_I1 },
{ "digest_type" , GETDNS_RDF_I1 },
{ "digest" , GETDNS_RDF_X }};
static priv_getdns_rr_def priv_getdns_rr_defs[] = {
static _getdns_rr_def _getdns_rr_defs[] = {
{ NULL, NULL, 0 },
{ "A", a_rdata, ALEN( a_rdata) }, /* 1 - */
{ "NS", ns_rdata, ALEN( ns_rdata) },
@ -723,26 +723,26 @@ static priv_getdns_rr_def priv_getdns_rr_defs[] = {
{ "DLV", dlv_rdata, ALEN( dlv_rdata) } /* 32769 */
};
const priv_getdns_rr_def *
priv_getdns_rr_def_lookup(uint16_t rr_type)
const _getdns_rr_def *
_getdns_rr_def_lookup(uint16_t rr_type)
{
if (rr_type <= 257)
return &priv_getdns_rr_defs[rr_type];
return &_getdns_rr_defs[rr_type];
else if (rr_type == 32768)
return &priv_getdns_rr_defs[258];
return &_getdns_rr_defs[258];
else if (rr_type == 32769)
return &priv_getdns_rr_defs[259];
return priv_getdns_rr_defs;
return &_getdns_rr_defs[259];
return _getdns_rr_defs;
}
const char *
priv_getdns_rr_type_name(int rr_type)
_getdns_rr_type_name(int rr_type)
{
return priv_getdns_rr_def_lookup(rr_type)->name;
return _getdns_rr_def_lookup(rr_type)->name;
}
getdns_return_t
priv_getdns_rr_dict2wire(getdns_dict *rr_dict, gldns_buffer *buf)
_getdns_rr_dict2wire(getdns_dict *rr_dict, gldns_buffer *buf)
{
getdns_return_t r = GETDNS_RETURN_GOOD;
struct getdns_bindata *name;
@ -753,8 +753,8 @@ priv_getdns_rr_dict2wire(getdns_dict *rr_dict, gldns_buffer *buf)
uint32_t rr_class = GETDNS_RRCLASS_IN;
uint32_t rr_ttl = 0;
uint32_t value;
const priv_getdns_rr_def *rr_def;
const priv_getdns_rdata_def *rd_def;
const _getdns_rr_def *rr_def;
const _getdns_rdata_def *rd_def;
int n_rdata_fields;
size_t j, rdata_size_mark;
@ -778,7 +778,7 @@ priv_getdns_rr_dict2wire(getdns_dict *rr_dict, gldns_buffer *buf)
/* Does rdata contain compressed names?
* Because rdata_raw is unusable then.
*/
rr_def = priv_getdns_rr_def_lookup(rr_type);
rr_def = _getdns_rr_def_lookup(rr_type);
for ( rd_def = rr_def->rdata
, n_rdata_fields = rr_def->n_rdata_fields
; n_rdata_fields ; n_rdata_fields-- , rd_def++ ) {

View File

@ -36,19 +36,19 @@
#include "getdns/getdns.h"
#include "gldns/gbuffer.h"
typedef uint8_t *(*priv_getdns_rdf_end_t)(
typedef uint8_t *(*_getdns_rdf_end_t)(
uint8_t *pkt, uint8_t *pkt_end, uint8_t *rdf);
/* Limit checks are already done with priv_getdns_rdf_end_t */
typedef getdns_return_t (*priv_getdns_rdf_dict_set_value_t)(
/* Limit checks are already done with _getdns_rdf_end_t */
typedef getdns_return_t (*_getdns_rdf_dict_set_value_t)(
getdns_dict *dict, uint8_t *rdf);
typedef getdns_return_t (*priv_getdns_rdf_list_append_value_t)(
typedef getdns_return_t (*_getdns_rdf_list_append_value_t)(
getdns_list *list, uint8_t *rdf);
typedef struct priv_getdns_rdf_special {
priv_getdns_rdf_end_t rdf_end;
priv_getdns_rdf_dict_set_value_t dict_set_value;
priv_getdns_rdf_list_append_value_t list_append_value;
} priv_getdns_rdf_special;
typedef struct _getdns_rdf_special {
_getdns_rdf_end_t rdf_end;
_getdns_rdf_dict_set_value_t dict_set_value;
_getdns_rdf_list_append_value_t list_append_value;
} _getdns_rdf_special;
/* draft-levine-dnsextlang'ish type rr and rdata definitions */
@ -61,7 +61,7 @@ typedef struct priv_getdns_rdf_special {
#define GETDNS_RDF_FIXEDSZ 0x0000FF
#define GETDNS_RDF_LEN_VAL 0x00FF00
typedef enum priv_getdns_rdf_wf_type {
typedef enum _getdns_rdf_wf_type {
GETDNS_RDF_N = 0x060000, /* N */
GETDNS_RDF_N_A = 0x060000, /* N[A] */
GETDNS_RDF_N_C = 0x0E0000, /* N[C] */
@ -117,26 +117,26 @@ typedef enum priv_getdns_rdf_wf_type {
GETDNS_RDF_R = 0x100000, /* Repeat */
GETDNS_RDF_SPECIAL = 0x800000,
} priv_getdns_rdf_type;
} _getdns_rdf_type;
typedef struct priv_getdns_rdata_def {
typedef struct _getdns_rdata_def {
const char *name;
priv_getdns_rdf_type type;
priv_getdns_rdf_special *special;
} priv_getdns_rdata_def;
_getdns_rdf_type type;
_getdns_rdf_special *special;
} _getdns_rdata_def;
typedef struct priv_getdns_rr_def {
typedef struct _getdns_rr_def {
const char *name;
const priv_getdns_rdata_def *rdata;
const _getdns_rdata_def *rdata;
int n_rdata_fields;
} priv_getdns_rr_def;
} _getdns_rr_def;
const priv_getdns_rr_def *priv_getdns_rr_def_lookup(uint16_t rr_type);
const _getdns_rr_def *_getdns_rr_def_lookup(uint16_t rr_type);
getdns_return_t priv_getdns_rr_dict2wire(
getdns_return_t _getdns_rr_dict2wire(
getdns_dict *rr_dict, gldns_buffer *buf);
const char *priv_getdns_rr_type_name(int rr_type);
const char *_getdns_rr_type_name(int rr_type);
#endif

View File

@ -34,7 +34,7 @@
#include "gldns/rrdef.h"
static void
rr_iter_find_nxt(priv_getdns_rr_iter *i)
rr_iter_find_nxt(_getdns_rr_iter *i)
{
assert(i);
assert(i->rr_type);
@ -48,8 +48,8 @@ rr_iter_find_nxt(priv_getdns_rr_iter *i)
: i->rr_type + 10 + gldns_read_uint16(i->rr_type + 8);
}
static priv_getdns_rr_iter *
find_rrtype(priv_getdns_rr_iter *i)
static _getdns_rr_iter *
find_rrtype(_getdns_rr_iter *i)
{
uint8_t *pos;
@ -82,8 +82,8 @@ done:
return NULL;
}
priv_getdns_rr_iter *
priv_getdns_rr_iter_init(priv_getdns_rr_iter *i, uint8_t *pkt, size_t pkt_len)
_getdns_rr_iter *
_getdns_rr_iter_init(_getdns_rr_iter *i, uint8_t *pkt, size_t pkt_len)
{
assert(i);
@ -99,16 +99,16 @@ priv_getdns_rr_iter_init(priv_getdns_rr_iter *i, uint8_t *pkt, size_t pkt_len)
return find_rrtype(i);
}
priv_getdns_rr_iter *
priv_getdns_rr_iter_rewind(priv_getdns_rr_iter *i)
_getdns_rr_iter *
_getdns_rr_iter_rewind(_getdns_rr_iter *i)
{
assert(i);
return priv_getdns_rr_iter_init(i, i->pkt, i->pkt_end - i->pkt);
return _getdns_rr_iter_init(i, i->pkt, i->pkt_end - i->pkt);
}
priv_getdns_rr_iter *
priv_getdns_rr_iter_next(priv_getdns_rr_iter *i)
_getdns_rr_iter *
_getdns_rr_iter_next(_getdns_rr_iter *i)
{
assert(i);
@ -205,15 +205,15 @@ error:
}
uint8_t *
priv_getdns_owner_if_or_as_decompressed(priv_getdns_rr_iter *i,
_getdns_owner_if_or_as_decompressed(_getdns_rr_iter *i,
uint8_t *ff_bytes, size_t *len)
{
return dname_if_or_as_decompressed(i->pkt, i->pkt_end, i->pos,
ff_bytes, len, 0);
}
static priv_getdns_rdf_iter *
rdf_iter_find_nxt(priv_getdns_rdf_iter *i)
static _getdns_rdf_iter *
rdf_iter_find_nxt(_getdns_rdf_iter *i)
{
uint8_t *pos;
@ -269,10 +269,10 @@ done:
return NULL;
}
priv_getdns_rdf_iter *
priv_getdns_rdf_iter_init(priv_getdns_rdf_iter *i, priv_getdns_rr_iter *rr)
_getdns_rdf_iter *
_getdns_rdf_iter_init(_getdns_rdf_iter *i, _getdns_rr_iter *rr)
{
const priv_getdns_rr_def *rr_def;
const _getdns_rr_def *rr_def;
assert(i);
assert(rr);
@ -284,7 +284,7 @@ priv_getdns_rdf_iter_init(priv_getdns_rdf_iter *i, priv_getdns_rr_iter *rr)
i->pkt = rr->pkt;
i->pkt_end = rr->pkt_end;
rr_def = priv_getdns_rr_def_lookup(gldns_read_uint16(rr->rr_type));
rr_def = _getdns_rr_def_lookup(gldns_read_uint16(rr->rr_type));
i->rdd_pos = rr_def->rdata;
i->rdd_end = rr_def->rdata + rr_def->n_rdata_fields;
@ -304,8 +304,8 @@ done:
return NULL;
}
priv_getdns_rdf_iter *
priv_getdns_rdf_iter_next(priv_getdns_rdf_iter *i)
_getdns_rdf_iter *
_getdns_rdf_iter_next(_getdns_rdf_iter *i)
{
if (!i->pos)
return NULL;
@ -324,19 +324,19 @@ done:
return NULL;
}
priv_getdns_rdf_iter *
priv_getdns_rdf_iter_init_at(
priv_getdns_rdf_iter *i, priv_getdns_rr_iter *rr, size_t pos)
_getdns_rdf_iter *
_getdns_rdf_iter_init_at(
_getdns_rdf_iter *i, _getdns_rr_iter *rr, size_t pos)
{
for ( i = priv_getdns_rdf_iter_init(i, rr)
for ( i = _getdns_rdf_iter_init(i, rr)
; i && pos
; i = priv_getdns_rdf_iter_next(i), pos--);
; i = _getdns_rdf_iter_next(i), pos--);
return i;
}
uint8_t *
priv_getdns_rdf_if_or_as_decompressed(
priv_getdns_rdf_iter *i, uint8_t *ff_bytes, size_t *len)
_getdns_rdf_if_or_as_decompressed(
_getdns_rdf_iter *i, uint8_t *ff_bytes, size_t *len)
{
return dname_if_or_as_decompressed(i->pkt, i->pkt_end, i->pos,
ff_bytes, len, 0);

View File

@ -37,7 +37,7 @@
#include "gldns/pkthdr.h"
#include "gldns/gbuffer.h"
typedef struct priv_getdns_rr_iter {
typedef struct _getdns_rr_iter {
uint8_t *pkt;
uint8_t *pkt_end;
@ -57,20 +57,20 @@ typedef struct priv_getdns_rr_iter {
/* nxt point to the owner name of the next RR or to pkt_end */
uint8_t *nxt;
} priv_getdns_rr_iter;
} _getdns_rr_iter;
priv_getdns_rr_iter *priv_getdns_rr_iter_init(priv_getdns_rr_iter *i,
_getdns_rr_iter *_getdns_rr_iter_init(_getdns_rr_iter *i,
uint8_t *pkt, size_t pkt_len);
priv_getdns_rr_iter *priv_getdns_rr_iter_rewind(priv_getdns_rr_iter *i);
_getdns_rr_iter *_getdns_rr_iter_rewind(_getdns_rr_iter *i);
priv_getdns_rr_iter *priv_getdns_rr_iter_next(priv_getdns_rr_iter *i);
_getdns_rr_iter *_getdns_rr_iter_next(_getdns_rr_iter *i);
uint8_t *priv_getdns_owner_if_or_as_decompressed(
priv_getdns_rr_iter *i, uint8_t *ff_bytes, size_t *len);
uint8_t *_getdns_owner_if_or_as_decompressed(
_getdns_rr_iter *i, uint8_t *ff_bytes, size_t *len);
static inline gldns_pkt_section
priv_getdns_rr_iter_section(priv_getdns_rr_iter *i)
_getdns_rr_iter_section(_getdns_rr_iter *i)
{
return i->n < GLDNS_QDCOUNT(i->pkt) ? GLDNS_SECTION_QUESTION
: i->n < GLDNS_QDCOUNT(i->pkt)
@ -88,23 +88,23 @@ priv_getdns_rr_iter_section(priv_getdns_rr_iter *i)
typedef struct piv_getdns_rdf_iter {
uint8_t *pkt;
uint8_t *pkt_end;
const priv_getdns_rdata_def *rdd_pos;
const priv_getdns_rdata_def *rdd_end;
const priv_getdns_rdata_def *rdd_repeat;
const _getdns_rdata_def *rdd_pos;
const _getdns_rdata_def *rdd_end;
const _getdns_rdata_def *rdd_repeat;
uint8_t *pos;
uint8_t *end;
uint8_t *nxt;
} priv_getdns_rdf_iter;
} _getdns_rdf_iter;
priv_getdns_rdf_iter *priv_getdns_rdf_iter_init(priv_getdns_rdf_iter *i,
priv_getdns_rr_iter *rr);
_getdns_rdf_iter *_getdns_rdf_iter_init(_getdns_rdf_iter *i,
_getdns_rr_iter *rr);
priv_getdns_rdf_iter *priv_getdns_rdf_iter_next(priv_getdns_rdf_iter *i);
_getdns_rdf_iter *_getdns_rdf_iter_next(_getdns_rdf_iter *i);
priv_getdns_rdf_iter *priv_getdns_rdf_iter_init_at(priv_getdns_rdf_iter *i,
priv_getdns_rr_iter *rr, size_t pos);
_getdns_rdf_iter *_getdns_rdf_iter_init_at(_getdns_rdf_iter *i,
_getdns_rr_iter *rr, size_t pos);
uint8_t *priv_getdns_rdf_if_or_as_decompressed(
priv_getdns_rdf_iter *i, uint8_t *ff_bytes, size_t *len);
uint8_t *_getdns_rdf_if_or_as_decompressed(
_getdns_rdf_iter *i, uint8_t *ff_bytes, size_t *len);
#endif

View File

@ -180,17 +180,17 @@ static int
match_and_process_server_cookie(
getdns_upstream *upstream, uint8_t *response, size_t response_len)
{
priv_getdns_rr_iter rr_iter_storage, *rr_iter;
_getdns_rr_iter rr_iter_storage, *rr_iter;
uint8_t *pos;
uint16_t rdata_len, opt_code, opt_len;
/* Search for the OPT RR (if any) */
for ( rr_iter = priv_getdns_rr_iter_init(&rr_iter_storage
for ( rr_iter = _getdns_rr_iter_init(&rr_iter_storage
, response, response_len)
; rr_iter
; rr_iter = priv_getdns_rr_iter_next(rr_iter)) {
; rr_iter = _getdns_rr_iter_next(rr_iter)) {
if (priv_getdns_rr_iter_section(rr_iter) !=
if (_getdns_rr_iter_section(rr_iter) !=
GLDNS_SECTION_ADDITIONAL)
continue;
@ -277,8 +277,8 @@ create_starttls_request(getdns_dns_req *dnsreq, getdns_upstream *upstream,
static int
is_starttls_response(getdns_network_req *netreq)
{
priv_getdns_rr_iter rr_iter_storage, *rr_iter;
priv_getdns_rdf_iter rdf_iter_storage, *rdf_iter;
_getdns_rr_iter rr_iter_storage, *rr_iter;
_getdns_rdf_iter rdf_iter_storage, *rdf_iter;
uint16_t rr_type;
gldns_pkt_section section;
uint8_t starttls_name_space[256], *starttls_name;
@ -293,30 +293,30 @@ is_starttls_response(getdns_network_req *netreq)
if (GLDNS_ANCOUNT(netreq->response) != 1)
return 0;
for ( rr_iter = priv_getdns_rr_iter_init(&rr_iter_storage
for ( rr_iter = _getdns_rr_iter_init(&rr_iter_storage
, netreq->response
, netreq->response_len)
; rr_iter
; rr_iter = priv_getdns_rr_iter_next(rr_iter)) {
; rr_iter = _getdns_rr_iter_next(rr_iter)) {
section = priv_getdns_rr_iter_section(rr_iter);
section = _getdns_rr_iter_section(rr_iter);
rr_type = gldns_read_uint16(rr_iter->rr_type);
if (section != GLDNS_SECTION_ANSWER
|| rr_type != GETDNS_RRTYPE_TXT)
continue;
owner_name = priv_getdns_owner_if_or_as_decompressed(
owner_name = _getdns_owner_if_or_as_decompressed(
rr_iter, owner_name_space, &owner_name_len);
if (!priv_getdns_dname_equal(netreq->owner->name, owner_name))
if (!_getdns_dname_equal(netreq->owner->name, owner_name))
continue;
if (!(rdf_iter = priv_getdns_rdf_iter_init(
if (!(rdf_iter = _getdns_rdf_iter_init(
&rdf_iter_storage, rr_iter)))
continue;
if ((starttls_name = priv_getdns_rdf_if_or_as_decompressed(
if ((starttls_name = _getdns_rdf_if_or_as_decompressed(
rdf_iter, starttls_name_space, &starttls_name_len)) &&
priv_getdns_dname_equal(starttls_name, owner_name))
_getdns_dname_equal(starttls_name, owner_name))
return 1;
return 0;
@ -481,20 +481,20 @@ upstream_erred(getdns_upstream *upstream)
while ((netreq = upstream->write_queue)) {
stub_cleanup(netreq);
netreq->state = NET_REQ_FINISHED;
priv_getdns_check_dns_req_complete(netreq->owner);
_getdns_check_dns_req_complete(netreq->owner);
}
while (upstream->netreq_by_query_id.count) {
netreq = (getdns_network_req *)
_getdns_rbtree_first(&upstream->netreq_by_query_id);
stub_cleanup(netreq);
netreq->state = NET_REQ_FINISHED;
priv_getdns_check_dns_req_complete(netreq->owner);
_getdns_check_dns_req_complete(netreq->owner);
}
priv_getdns_upstream_shutdown(upstream);
_getdns_upstream_shutdown(upstream);
}
void
priv_getdns_cancel_stub_request(getdns_network_req *netreq)
_getdns_cancel_stub_request(getdns_network_req *netreq)
{
stub_cleanup(netreq);
if (netreq->fd >= 0) close(netreq->fd);
@ -510,7 +510,7 @@ stub_erred(getdns_network_req *netreq)
* using to keep connections open should we leave the connection up here? */
if (netreq->fd >= 0) close(netreq->fd);
netreq->state = NET_REQ_FINISHED;
priv_getdns_check_dns_req_complete(netreq->owner);
_getdns_check_dns_req_complete(netreq->owner);
}
static void
@ -535,7 +535,7 @@ stub_timeout_cb(void *userarg)
(void) getdns_context_request_timed_out(netreq->owner);
else {
netreq->state = NET_REQ_FINISHED;
priv_getdns_check_dns_req_complete(netreq->owner);
_getdns_check_dns_req_complete(netreq->owner);
}
}
@ -551,7 +551,7 @@ upstream_idle_timeout_cb(void *userarg)
upstream->event.timeout_cb = NULL;
upstream->event.read_cb = NULL;
upstream->event.write_cb = NULL;
priv_getdns_upstream_shutdown(upstream);
_getdns_upstream_shutdown(upstream);
}
static void
@ -1147,7 +1147,7 @@ stub_udp_read_cb(void *userarg)
dnsreq->upstreams->current = 0;
done:
netreq->state = NET_REQ_FINISHED;
priv_getdns_check_dns_req_complete(dnsreq);
_getdns_check_dns_req_complete(dnsreq);
}
static void
@ -1226,7 +1226,7 @@ stub_tcp_read_cb(void *userarg)
stub_cleanup(netreq);
close(netreq->fd);
priv_getdns_check_dns_req_complete(dnsreq);
_getdns_check_dns_req_complete(dnsreq);
}
}
@ -1338,7 +1338,7 @@ upstream_read_cb(void *userarg)
upstream_reschedule_netreq_events(upstream, netreq);
if (netreq->owner != upstream->starttls_req)
priv_getdns_check_dns_req_complete(netreq->owner);
_getdns_check_dns_req_complete(netreq->owner);
}
}
@ -1381,7 +1381,7 @@ upstream_write_cb(void *userarg)
stub_cleanup(netreq);
if (fallback_on_write(netreq) == STUB_TCP_ERROR) {
netreq->state = NET_REQ_FINISHED;
priv_getdns_check_dns_req_complete(netreq->owner);
_getdns_check_dns_req_complete(netreq->owner);
}
return;
@ -1640,7 +1640,7 @@ fallback_on_write(getdns_network_req *netreq)
getdns_upstream *upstream = netreq->upstream;
/* Try to find a fallback transport*/
getdns_return_t result = priv_getdns_submit_stub_request(netreq);
getdns_return_t result = _getdns_submit_stub_request(netreq);
/* For sync messages we must re-schedule the events on the old upstream
* here too. Must schedule this last to make sure it is called back first! */
@ -1714,7 +1714,7 @@ upstream_reschedule_netreq_events(getdns_upstream *upstream,
* So we will have to be aggressive and shut the connection....*/
DEBUG_STUB("# %s: **Closing connection %d**\n",
__FUNCTION__, upstream->fd);
priv_getdns_upstream_shutdown(upstream);
_getdns_upstream_shutdown(upstream);
}
}
@ -1753,7 +1753,7 @@ upstream_schedule_netreq(getdns_upstream *upstream, getdns_network_req *netreq)
}
getdns_return_t
priv_getdns_submit_stub_request(getdns_network_req *netreq)
_getdns_submit_stub_request(getdns_network_req *netreq)
{
DEBUG_STUB("--> %s\n", __FUNCTION__);
int fd = -1;

View File

@ -37,9 +37,9 @@
#include "getdns/getdns.h"
#include "types-internal.h"
getdns_return_t priv_getdns_submit_stub_request(getdns_network_req *netreq);
getdns_return_t _getdns_submit_stub_request(getdns_network_req *netreq);
void priv_getdns_cancel_stub_request(getdns_network_req *netreq);
void _getdns_cancel_stub_request(getdns_network_req *netreq);
#endif

View File

@ -72,7 +72,7 @@ getdns_sync_loop_init(getdns_context *context, getdns_sync_loop *loop)
#ifdef HAVE_LIBUNBOUND
loop->ub_event.userarg = loop->context;
loop->ub_event.read_cb = priv_getdns_context_ub_read_cb;
loop->ub_event.read_cb = _getdns_context_ub_read_cb;
loop->ub_event.write_cb = NULL;
loop->ub_event.timeout_cb = NULL;
loop->ub_event.ev = NULL;
@ -131,7 +131,7 @@ getdns_general_sync(getdns_context *context, const char *name,
if ((r = getdns_sync_loop_init(context, &loop)))
return r;
if ((r = priv_getdns_general_loop(context, &loop.loop.loop, name,
if ((r = _getdns_general_loop(context, &loop.loop.loop, name,
request_type, extensions, &loop, NULL, getdns_sync_cb, NULL))) {
getdns_sync_loop_cleanup(&loop);
@ -156,7 +156,7 @@ getdns_address_sync(getdns_context *context, const char *name,
if ((r = getdns_sync_loop_init(context, &loop)))
return r;
if ((r = priv_getdns_address_loop(context, &loop.loop.loop, name,
if ((r = _getdns_address_loop(context, &loop.loop.loop, name,
extensions, &loop, NULL, getdns_sync_cb))) {
getdns_sync_loop_cleanup(&loop);
@ -181,7 +181,7 @@ getdns_hostname_sync(getdns_context *context, getdns_dict *address,
if ((r = getdns_sync_loop_init(context, &loop)))
return r;
if ((r = priv_getdns_hostname_loop(context, &loop.loop.loop, address,
if ((r = _getdns_hostname_loop(context, &loop.loop.loop, address,
extensions, &loop, NULL, getdns_sync_cb))) {
getdns_sync_loop_cleanup(&loop);
@ -206,7 +206,7 @@ getdns_service_sync(getdns_context *context, const char *name,
if ((r = getdns_sync_loop_init(context, &loop)))
return r;
if ((r = priv_getdns_service_loop(context, &loop.loop.loop, name,
if ((r = _getdns_service_loop(context, &loop.loop.loop, name,
extensions, &loop, NULL, getdns_sync_cb))) {
getdns_sync_loop_cleanup(&loop);

View File

@ -165,13 +165,13 @@ sockaddr_to_dict(struct getdns_context *context, struct sockaddr_storage *addres
}
getdns_dict *
priv_getdns_rr_iter2rr_dict(struct mem_funcs *mf, priv_getdns_rr_iter *i)
_getdns_rr_iter2rr_dict(struct mem_funcs *mf, _getdns_rr_iter *i)
{
getdns_dict *rr_dict, *rdata_dict;
getdns_bindata bindata;
uint32_t int_val = 0;
getdns_data_type val_type;
priv_getdns_rdf_iter rdf_storage, *rdf;
_getdns_rdf_iter rdf_storage, *rdf;
getdns_list *repeat_list = NULL;
getdns_dict *repeat_dict = NULL;
uint8_t ff_bytes[256];
@ -181,11 +181,11 @@ priv_getdns_rr_iter2rr_dict(struct mem_funcs *mf, priv_getdns_rr_iter *i)
if (!(rr_dict = _getdns_dict_create_with_mf(mf)))
return NULL;
bindata.data = priv_getdns_owner_if_or_as_decompressed(
bindata.data = _getdns_owner_if_or_as_decompressed(
i, ff_bytes, &bindata.size);
/* question */
if (priv_getdns_rr_iter_section(i) == GLDNS_SECTION_QUESTION) {
if (_getdns_rr_iter_section(i) == GLDNS_SECTION_QUESTION) {
if (getdns_dict_set_int(rr_dict, "qtype",
(uint32_t) gldns_read_uint16(i->rr_type)) ||
@ -243,8 +243,8 @@ priv_getdns_rr_iter2rr_dict(struct mem_funcs *mf, priv_getdns_rr_iter *i)
if (getdns_dict_set_bindata(rdata_dict, "rdata_raw", &bindata))
goto rdata_error;
}
for ( rdf = priv_getdns_rdf_iter_init(&rdf_storage, i)
; rdf; rdf = priv_getdns_rdf_iter_next(rdf)) {
for ( rdf = _getdns_rdf_iter_init(&rdf_storage, i)
; rdf; rdf = _getdns_rdf_iter_next(rdf)) {
if (rdf->rdd_pos->type & GETDNS_RDF_INTEGER) {
val_type = t_int;
switch (rdf->rdd_pos->type & GETDNS_RDF_FIXEDSZ) {
@ -260,7 +260,7 @@ priv_getdns_rr_iter2rr_dict(struct mem_funcs *mf, priv_getdns_rr_iter *i)
} else if (rdf->rdd_pos->type & GETDNS_RDF_DNAME) {
val_type = t_bindata;
bindata.data = priv_getdns_rdf_if_or_as_decompressed(
bindata.data = _getdns_rdf_if_or_as_decompressed(
rdf, ff_bytes, &bindata.size);
} else if (rdf->rdd_pos->type & GETDNS_RDF_BINDATA) {
@ -409,7 +409,7 @@ error:
}
int
priv_getdns_dname_equal(const uint8_t *s1, const uint8_t *s2)
_getdns_dname_equal(const uint8_t *s1, const uint8_t *s2)
{
uint8_t i;
for (;;) {
@ -440,7 +440,7 @@ set_dict(getdns_dict **var, getdns_dict *value)
GLDNS_ ## Y (req->response))) goto error
getdns_dict *
priv_getdns_create_reply_dict(getdns_context *context, getdns_network_req *req,
_getdns_create_reply_dict(getdns_context *context, getdns_network_req *req,
getdns_list *just_addrs, int *rrsigs_in_answer)
{
/* turn a packet into this glorious structure
@ -491,8 +491,8 @@ priv_getdns_create_reply_dict(getdns_context *context, getdns_network_req *req,
, getdns_list_create_with_context(context)
};
getdns_dict *rr_dict = NULL;
priv_getdns_rr_iter rr_iter_storage, *rr_iter;
priv_getdns_rdf_iter rdf_iter_storage, *rdf_iter;
_getdns_rr_iter rr_iter_storage, *rr_iter;
_getdns_rdf_iter rdf_iter_storage, *rdf_iter;
getdns_bindata bindata;
gldns_pkt_section section;
uint8_t canonical_name_space[256],
@ -534,17 +534,17 @@ priv_getdns_create_reply_dict(getdns_context *context, getdns_network_req *req,
canonical_name = req->owner->name;
canonical_name_len = req->owner->name_len;
for ( rr_iter = priv_getdns_rr_iter_init(&rr_iter_storage
for ( rr_iter = _getdns_rr_iter_init(&rr_iter_storage
, req->response
, req->response_len)
; rr_iter
; rr_iter = priv_getdns_rr_iter_next(rr_iter)) {
; rr_iter = _getdns_rr_iter_next(rr_iter)) {
if (!set_dict(&rr_dict,
priv_getdns_rr_iter2rr_dict(&context->mf, rr_iter)))
_getdns_rr_iter2rr_dict(&context->mf, rr_iter)))
continue;
section = priv_getdns_rr_iter_section(rr_iter);
section = _getdns_rr_iter_section(rr_iter);
if (section == GLDNS_SECTION_QUESTION) {
if (getdns_dict_set_dict(result, "question", rr_dict))
@ -566,17 +566,17 @@ priv_getdns_create_reply_dict(getdns_context *context, getdns_network_req *req,
if (rr_type == GETDNS_RRTYPE_CNAME) {
owner_name = priv_getdns_owner_if_or_as_decompressed(
owner_name = _getdns_owner_if_or_as_decompressed(
rr_iter, owner_name_space, &owner_name_len);
if (!priv_getdns_dname_equal(canonical_name, owner_name))
if (!_getdns_dname_equal(canonical_name, owner_name))
continue;
if (!(rdf_iter = priv_getdns_rdf_iter_init(
if (!(rdf_iter = _getdns_rdf_iter_init(
&rdf_iter_storage, rr_iter)))
continue;
new_canonical = 1;
canonical_name = priv_getdns_rdf_if_or_as_decompressed(
canonical_name = _getdns_rdf_if_or_as_decompressed(
rdf_iter,canonical_name_space,&canonical_name_len);
continue;
}
@ -584,7 +584,7 @@ priv_getdns_create_reply_dict(getdns_context *context, getdns_network_req *req,
if (rr_type != GETDNS_RRTYPE_A && rr_type != GETDNS_RRTYPE_AAAA)
continue;
if (!(rdf_iter = priv_getdns_rdf_iter_init(
if (!(rdf_iter = _getdns_rdf_iter_init(
&rdf_iter_storage, rr_iter)))
continue;
@ -623,14 +623,14 @@ priv_getdns_create_reply_dict(getdns_context *context, getdns_network_req *req,
while (new_canonical) {
new_canonical = 0;
for ( rr_iter = priv_getdns_rr_iter_init(&rr_iter_storage
for ( rr_iter = _getdns_rr_iter_init(&rr_iter_storage
, req->response
, req->response_len)
; rr_iter && priv_getdns_rr_iter_section(rr_iter)
; rr_iter && _getdns_rr_iter_section(rr_iter)
<= GLDNS_SECTION_ANSWER
; rr_iter = priv_getdns_rr_iter_next(rr_iter)) {
; rr_iter = _getdns_rr_iter_next(rr_iter)) {
if (priv_getdns_rr_iter_section(rr_iter) !=
if (_getdns_rr_iter_section(rr_iter) !=
GLDNS_SECTION_ANSWER)
continue;
@ -638,16 +638,16 @@ priv_getdns_create_reply_dict(getdns_context *context, getdns_network_req *req,
GETDNS_RRTYPE_CNAME)
continue;
owner_name = priv_getdns_owner_if_or_as_decompressed(
owner_name = _getdns_owner_if_or_as_decompressed(
rr_iter, owner_name_space, &owner_name_len);
if (!priv_getdns_dname_equal(canonical_name, owner_name))
if (!_getdns_dname_equal(canonical_name, owner_name))
continue;
if (!(rdf_iter = priv_getdns_rdf_iter_init(
if (!(rdf_iter = _getdns_rdf_iter_init(
&rdf_iter_storage, rr_iter)))
continue;
canonical_name = priv_getdns_rdf_if_or_as_decompressed(
canonical_name = _getdns_rdf_if_or_as_decompressed(
rdf_iter,canonical_name_space,&canonical_name_len);
new_canonical = 1;
}
@ -738,7 +738,7 @@ create_getdns_response(getdns_dns_req *completed_request)
&& netreq->dnssec_status != GETDNS_DNSSEC_SECURE)
continue;
}
if (!(reply = priv_getdns_create_reply_dict(context,
if (!(reply = _getdns_create_reply_dict(context,
netreq, just_addrs, &rrsigs_in_answer)))
goto error;
@ -821,7 +821,7 @@ extformatcmp(const void *a, const void *b)
/*---------------------------------------- validate_extensions */
getdns_return_t
priv_getdns_validate_extensions(struct getdns_dict * extensions)
_getdns_validate_extensions(struct getdns_dict * extensions)
{
struct getdns_dict_item *item;
getdns_extension_format *extformat;
@ -843,7 +843,7 @@ priv_getdns_validate_extensions(struct getdns_dict * extensions)
return GETDNS_RETURN_EXTENSION_MISFORMAT;
}
return GETDNS_RETURN_GOOD;
} /* priv_getdns_validate_extensions */
} /* _getdns_validate_extensions */
#ifdef HAVE_LIBUNBOUND
getdns_return_t
@ -912,7 +912,7 @@ getdns_apply_network_result(getdns_network_req* netreq,
getdns_return_t
priv_getdns_validate_dname(const char* dname) {
_getdns_validate_dname(const char* dname) {
int len;
int label_len;
const char* s;
@ -975,7 +975,7 @@ priv_getdns_validate_dname(const char* dname) {
return GETDNS_RETURN_BAD_DOMAIN_NAME;
}
return GETDNS_RETURN_GOOD;
} /* priv_getdns_validate_dname */
} /* _getdns_validate_dname */
static void _getdns_reply2wire_buf(gldns_buffer *buf, getdns_dict *reply)
@ -1014,7 +1014,7 @@ static void _getdns_reply2wire_buf(gldns_buffer *buf, getdns_dict *reply)
; !getdns_list_get_dict(section, i, &rr_dict)
; i++ ) {
if (!priv_getdns_rr_dict2wire(rr_dict, buf))
if (!_getdns_rr_dict2wire(rr_dict, buf))
ancount++;
}
gldns_buffer_write_u16_at(
@ -1025,7 +1025,7 @@ static void _getdns_reply2wire_buf(gldns_buffer *buf, getdns_dict *reply)
; !getdns_list_get_dict(section, i, &rr_dict)
; i++ ) {
if (!priv_getdns_rr_dict2wire(rr_dict, buf))
if (!_getdns_rr_dict2wire(rr_dict, buf))
nscount++;
}
gldns_buffer_write_u16_at(
@ -1064,7 +1064,7 @@ static void _getdns_list2wire_buf(gldns_buffer *buf, getdns_list *l)
; !getdns_list_get_dict(l, i, &rr_dict)
; i++ ) {
if (!priv_getdns_rr_dict2wire(rr_dict, buf))
if (!_getdns_rr_dict2wire(rr_dict, buf))
ancount++;
}
gldns_buffer_write_u16_at(buf, pkt_start+GLDNS_ANCOUNT_OFF, ancount);
@ -1114,13 +1114,13 @@ uint8_t *_getdns_reply2wire(
void _getdns_wire2list(uint8_t *pkt, size_t pkt_len, getdns_list *l)
{
priv_getdns_rr_iter rr_spc, *rr;
_getdns_rr_iter rr_spc, *rr;
getdns_dict *rr_dict;
for ( rr = priv_getdns_rr_iter_init(&rr_spc, pkt, pkt_len)
; rr ; rr = priv_getdns_rr_iter_next(rr)) {
for ( rr = _getdns_rr_iter_init(&rr_spc, pkt, pkt_len)
; rr ; rr = _getdns_rr_iter_next(rr)) {
if (!(rr_dict = priv_getdns_rr_iter2rr_dict(&l->mf, rr)))
if (!(rr_dict = _getdns_rr_iter2rr_dict(&l->mf, rr)))
continue;
(void)getdns_list_append_dict(l, rr_dict);

View File

@ -123,17 +123,17 @@ getdns_return_t sockaddr_to_dict(struct getdns_context *context,
struct sockaddr_storage *sockaddr, struct getdns_dict ** output);
getdns_dict *
priv_getdns_rr_iter2rr_dict(struct mem_funcs *mf, priv_getdns_rr_iter *i);
_getdns_rr_iter2rr_dict(struct mem_funcs *mf, _getdns_rr_iter *i);
struct getdns_dns_req;
struct getdns_dict *create_getdns_response(struct getdns_dns_req *completed_request);
getdns_dict *priv_getdns_create_reply_dict(getdns_context *context,
getdns_dict *_getdns_create_reply_dict(getdns_context *context,
getdns_network_req *req, getdns_list *just_addrs, int *rrsigs_in_answer);
getdns_return_t priv_getdns_validate_dname(const char* dname);
getdns_return_t _getdns_validate_dname(const char* dname);
int priv_getdns_dname_equal(const uint8_t *s1, const uint8_t *s2);
int _getdns_dname_equal(const uint8_t *s1, const uint8_t *s2);
uint8_t *_getdns_list2wire(
getdns_list *l, uint8_t *buf, size_t *buf_len, struct mem_funcs *mf);
@ -152,7 +152,7 @@ void _getdns_wire2list(uint8_t *pkt, size_t pkt_len, getdns_list *l);
* @return GETDNS_RETURN_NO_SUCH_EXTENSION A name in the extensions dict is not a valid extension.
* @return GETDNS_RETURN_EXTENSION_MISFORMAT One or more of the extensions has a bad format.
*/
getdns_return_t priv_getdns_validate_extensions(struct getdns_dict * extensions);
getdns_return_t _getdns_validate_extensions(struct getdns_dict * extensions);
#define DEBUG_ON(...) do { \
struct timeval tv; \