+static void f_trace(struct afb_req req)
+{
+ int rc;
+ struct json_object *add = NULL;
+ struct json_object *drop = NULL;
+ struct afb_trace *trace;
+
+ trace = afb_req_context(req, context_create, context_destroy);
+ wrap_json_unpack(afb_req_json(req), "{s?o s?o}", "add", &add, "drop", &drop);
+ if (add) {
+ rc = afb_trace_add(req, add, trace);
+ if (rc)
+ goto end;
+ }
+ if (drop) {
+ rc = afb_trace_drop(req, drop, trace);
+ if (rc)
+ goto end;
+ }
+ afb_req_success(req, NULL, NULL);
+end:
+ afb_apiset_update_hooks(main_apiset, NULL);
+ afb_evt_update_hooks();