+/******************************************************************************
+ * section: hooks for tracing requests
+ *****************************************************************************/
+
+#define _HOOK_DITF_(what,...) \
+ struct afb_hook_ditf *hook; \
+ pthread_rwlock_rdlock(&rwlock); \
+ hook = list_of_ditf_hooks; \
+ while (hook) { \
+ if (hook->itf->hook_ditf_##what \
+ && (hook->flags & afb_hook_flag_ditf_##what) != 0 \
+ && (!hook->api || !strcasecmp(hook->api, ditf->prefix))) { \
+ hook->itf->hook_ditf_##what(hook->closure, __VA_ARGS__); \
+ } \
+ hook = hook->next; \
+ } \
+ pthread_rwlock_unlock(&rwlock);
+
+void afb_hook_ditf_event_broadcast_before(const struct afb_ditf *ditf, const char *name, struct json_object *object)
+{
+ _HOOK_DITF_(event_broadcast_before, ditf, name, object);
+}
+
+int afb_hook_ditf_event_broadcast_after(const struct afb_ditf *ditf, const char *name, struct json_object *object, int result)
+{
+ _HOOK_DITF_(event_broadcast_after, ditf, name, object, result);
+ return result;
+}
+
+struct sd_event *afb_hook_ditf_get_event_loop(const struct afb_ditf *ditf, struct sd_event *result)
+{
+ _HOOK_DITF_(get_event_loop, ditf, result);
+ return result;
+}
+
+struct sd_bus *afb_hook_ditf_get_user_bus(const struct afb_ditf *ditf, struct sd_bus *result)
+{
+ _HOOK_DITF_(get_user_bus, ditf, result);
+ return result;
+}
+
+struct sd_bus *afb_hook_ditf_get_system_bus(const struct afb_ditf *ditf, struct sd_bus *result)
+{
+ _HOOK_DITF_(get_system_bus, ditf, result);
+ return result;
+}
+
+void afb_hook_ditf_vverbose(const struct afb_ditf *ditf, int level, const char *file, int line, const char *function, const char *fmt, va_list args)
+{
+ _HOOK_DITF_(vverbose, ditf, level, file, line, function, fmt, args);
+}
+
+struct afb_event afb_hook_ditf_event_make(const struct afb_ditf *ditf, const char *name, struct afb_event result)
+{
+ _HOOK_DITF_(event_make, ditf, name, result);
+ return result;
+}
+
+int afb_hook_ditf_rootdir_get_fd(const struct afb_ditf *ditf, int result)
+{
+ _HOOK_DITF_(rootdir_get_fd, ditf, result);
+ return result;
+}
+
+int afb_hook_ditf_rootdir_open_locale(const struct afb_ditf *ditf, const char *filename, int flags, const char *locale, int result)
+{
+ _HOOK_DITF_(rootdir_open_locale, ditf, filename, flags, locale, result);
+ return result;
+}
+
+
+