log_assert(0);
}
+void libworker_fg_done_cb(void* ATTR_UNUSED(arg), int ATTR_UNUSED(rcode),
+ ldns_buffer* ATTR_UNUSED(buf), enum sec_status ATTR_UNUSED(s))
+{
+ log_assert(0);
+}
+
+void libworker_bg_done_cb(void* ATTR_UNUSED(arg), int ATTR_UNUSED(rcode),
+ ldns_buffer* ATTR_UNUSED(buf), enum sec_status ATTR_UNUSED(s))
+{
+ log_assert(0);
+}
+
int context_query_cmp(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b))
{
log_assert(0);
12 June 2009: Wouter
- Fixup potential wrong NSEC picked out of the cache.
+ - If unfulfilled callbacks are deleted they are called with an error.
+ - fptr wlist checks for mesh callbacks.
11 June 2009: Wouter
- Fix queries for type DS when forward or stub zones are there.
- winevent - poll if too many fds
- fwd above stub, make hole in fwds. config non-forwarded-domain names.
- fix indent # ifs
-- do not flush/delete callback queries or call error on callback at least.
later
- selective verbosity; ubcontrol trace example.com
libworker_enter_result(q->res, buf, q->w->env->scratch, s);
}
-/** callback with fg results */
-static void
+void
libworker_fg_done_cb(void* arg, int rcode, ldns_buffer* buf, enum sec_status s)
{
struct ctx_query* q = (struct ctx_query*)arg;
}
}
-/** callback with bg results */
-static void
+void
libworker_bg_done_cb(void* arg, int rcode, ldns_buffer* buf, enum sec_status s)
{
struct ctx_query* q = (struct ctx_query*)arg;
void libworker_handle_result_write(struct tube* tube, uint8_t* msg, size_t len,
int err, void* arg);
+/** mesh callback with fg results */
+void libworker_fg_done_cb(void* arg, int rcode, ldns_buffer* buf,
+ enum sec_status s);
+
+/** mesh callback with bg results */
+void libworker_bg_done_cb(void* arg, int rcode, ldns_buffer* buf,
+ enum sec_status s);
+
/**
* fill result from parsed message, on error fills servfail
* @param res: is clear at start, filled in at end.
/* drop unsent replies */
if(!mstate->replies_sent) {
struct mesh_reply* rep;
+ struct mesh_cb* cb;
for(rep=mstate->reply_list; rep; rep=rep->next) {
comm_point_drop_reply(&rep->query_reply);
}
+ for(cb=mstate->cb_list; cb; cb=cb->next) {
+ fptr_ok(fptr_whitelist_mesh_cb(cb->cb));
+ (*cb->cb)(cb->cb_arg, LDNS_RCODE_SERVFAIL, NULL,
+ sec_status_unchecked);
+ }
}
/* de-init modules */
rcode = LDNS_RCODE_SERVFAIL;
/* send the reply */
if(rcode) {
+ fptr_ok(fptr_whitelist_mesh_cb(r->cb));
(*r->cb)(r->cb_arg, rcode, r->buf, sec_status_unchecked);
} else {
size_t udp_size = r->edns.udp_size;
m->s.env->scratch, udp_size, &r->edns,
(int)(r->edns.bits & EDNS_DO), secure))
{
+ fptr_ok(fptr_whitelist_mesh_cb(r->cb));
(*r->cb)(r->cb_arg, LDNS_RCODE_SERVFAIL, r->buf,
sec_status_unchecked);
- }
- else (*r->cb)(r->cb_arg, LDNS_RCODE_NOERROR, r->buf,
+ } else {
+ fptr_ok(fptr_whitelist_mesh_cb(r->cb));
+ (*r->cb)(r->cb_arg, LDNS_RCODE_NOERROR, r->buf,
rep->security);
+ }
}
m->s.env->mesh->num_reply_addrs--;
}
if(!r)
return 0;
r->buf = buf;
+ log_assert(fptr_whitelist_mesh_cb(r->cb)); /* early failure ifmissing*/
r->cb = cb;
r->cb_arg = cb_arg;
r->edns = *edns;
ldns_buffer* buf;
/** callback routine for results. if rcode != 0 buf has message.
- * called as cb(cb_arg, rcode, buf);
+ * called as cb(cb_arg, rcode, buf, sec_state);
*/
mesh_cb_func_t cb;
/** user arg for callback */
*/
#include "config.h"
#include "util/log.h"
+#include "services/mesh.h"
struct comm_reply;
struct comm_point;
struct module_qstate;
log_assert(0);
}
+void libworker_fg_done_cb(void* ATTR_UNUSED(arg), int ATTR_UNUSED(rcode),
+ ldns_buffer* ATTR_UNUSED(buf), enum sec_status ATTR_UNUSED(s))
+{
+ log_assert(0);
+}
+
+void libworker_bg_done_cb(void* ATTR_UNUSED(arg), int ATTR_UNUSED(rcode),
+ ldns_buffer* ATTR_UNUSED(buf), enum sec_status ATTR_UNUSED(s))
+{
+ log_assert(0);
+}
+
int context_query_cmp(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b))
{
log_assert(0);
else if(fptr == &libworker_handle_control_cmd) return 1;
return 0;
}
+
+int fptr_whitelist_mesh_cb(mesh_cb_func_t fptr)
+{
+ if(fptr == &libworker_fg_done_cb) return 1;
+ else if(fptr == &libworker_bg_done_cb) return 1;
+ return 0;
+}
#include "util/storage/lruhash.h"
#include "util/module.h"
#include "util/tube.h"
+#include "services/mesh.h"
/**
* Macro to perform an assertion check for fptr wlist checks.
*/
int fptr_whitelist_tube_listen(tube_callback_t* fptr);
+/**
+ * Check function pointer whitelist for mesh state callback values.
+ *
+ * @param fptr: function pointer to check.
+ * @return false if not in whitelist.
+ */
+int fptr_whitelist_mesh_cb(mesh_cb_func_t fptr);
+
/** Due to module breakage by fptr wlist, these test app declarations
* are presented here */
/**