• Home
  • Raw
  • Download

Lines Matching full:category

60     int category;  member
68 size_t cnt = ctx->callback(buf, num, ctx->category, OSSL_TRACE_CTRL_WRITE, in trace_write()
93 ctx->callback("", 0, ctx->category, cmd, ctx->data); in trace_ctrl()
173 /* We use one trace channel for each trace category */
193 static int trace_attach_cb(int category, int type, const void *data) in trace_attach_cb() argument
197 OSSL_TRACE2(TRACE, "Attach channel %p to category '%s'\n", in trace_attach_cb()
198 data, trace_categories[category].name); in trace_attach_cb()
201 OSSL_TRACE2(TRACE, "Attach prefix \"%s\" to category '%s'\n", in trace_attach_cb()
202 (const char *)data, trace_categories[category].name); in trace_attach_cb()
205 OSSL_TRACE2(TRACE, "Attach suffix \"%s\" to category '%s'\n", in trace_attach_cb()
206 (const char *)data, trace_categories[category].name); in trace_attach_cb()
214 static int trace_detach_cb(int category, int type, const void *data) in trace_detach_cb() argument
218 OSSL_TRACE2(TRACE, "Detach channel %p from category '%s'\n", in trace_detach_cb()
219 data, trace_categories[category].name); in trace_detach_cb()
222 OSSL_TRACE2(TRACE, "Detach prefix \"%s\" from category '%s'\n", in trace_detach_cb()
223 (const char *)data, trace_categories[category].name); in trace_detach_cb()
226 OSSL_TRACE2(TRACE, "Detach suffix \"%s\" from category '%s'\n", in trace_detach_cb()
227 (const char *)data, trace_categories[category].name); in trace_detach_cb()
242 static int set_trace_data(int category, int type, BIO **channel, in set_trace_data() argument
255 curr_channel = trace_channels[category].bio; in set_trace_data()
256 curr_prefix = trace_channels[category].prefix; in set_trace_data()
257 curr_suffix = trace_channels[category].suffix; in set_trace_data()
261 detach_cb(category, PREFIX, curr_prefix); in set_trace_data()
265 detach_cb(category, SUFFIX, curr_suffix); in set_trace_data()
269 detach_cb(category, CHANNEL, curr_channel); in set_trace_data()
275 trace_channels[category].prefix = NULL; in set_trace_data()
280 trace_channels[category].suffix = NULL; in set_trace_data()
285 trace_channels[category].type = 0; in set_trace_data()
286 trace_channels[category].bio = NULL; in set_trace_data()
293 trace_channels[category].prefix = curr_prefix; in set_trace_data()
299 trace_channels[category].suffix = curr_suffix; in set_trace_data()
303 trace_channels[category].type = type; in set_trace_data()
304 trace_channels[category].bio = *channel; in set_trace_data()
313 attach_cb(category, CHANNEL, *channel); in set_trace_data()
317 attach_cb(category, PREFIX, *prefix); in set_trace_data()
321 attach_cb(category, SUFFIX, *suffix); in set_trace_data()
338 int category; in ossl_trace_cleanup() local
343 for (category = 0; category < OSSL_TRACE_CATEGORY_NUM; category++) { in ossl_trace_cleanup()
344 /* We force the TRACE category to be treated last */ in ossl_trace_cleanup()
345 if (category == OSSL_TRACE_CATEGORY_TRACE) in ossl_trace_cleanup()
347 set_trace_data(category, 0, &channel, &prefix, &suffix, in ossl_trace_cleanup()
357 int OSSL_trace_set_channel(int category, BIO *channel) in OSSL_trace_set_channel() argument
360 if (category >= 0 && category < OSSL_TRACE_CATEGORY_NUM) in OSSL_trace_set_channel()
361 return set_trace_data(category, SIMPLE_CHANNEL, &channel, NULL, NULL, in OSSL_trace_set_channel()
368 static int trace_attach_w_callback_cb(int category, int type, const void *data) in trace_attach_w_callback_cb() argument
373 "Attach channel %p to category '%s' (with callback)\n", in trace_attach_w_callback_cb()
374 data, trace_categories[category].name); in trace_attach_w_callback_cb()
377 OSSL_TRACE2(TRACE, "Attach prefix \"%s\" to category '%s'\n", in trace_attach_w_callback_cb()
378 (const char *)data, trace_categories[category].name); in trace_attach_w_callback_cb()
381 OSSL_TRACE2(TRACE, "Attach suffix \"%s\" to category '%s'\n", in trace_attach_w_callback_cb()
382 (const char *)data, trace_categories[category].name); in trace_attach_w_callback_cb()
391 int OSSL_trace_set_callback(int category, OSSL_trace_cb callback, void *data) in OSSL_trace_set_callback() argument
397 if (category < 0 || category >= OSSL_TRACE_CATEGORY_NUM) in OSSL_trace_set_callback()
407 trace_data->category = category; in OSSL_trace_set_callback()
413 if (!set_trace_data(category, CALLBACK_CHANNEL, &channel, NULL, NULL, in OSSL_trace_set_callback()
427 int OSSL_trace_set_prefix(int category, const char *prefix) in OSSL_trace_set_prefix() argument
430 if (category >= 0 && category < OSSL_TRACE_CATEGORY_NUM) in OSSL_trace_set_prefix()
431 return set_trace_data(category, 0, NULL, &prefix, NULL, in OSSL_trace_set_prefix()
437 int OSSL_trace_set_suffix(int category, const char *suffix) in OSSL_trace_set_suffix() argument
440 if (category >= 0 && category < OSSL_TRACE_CATEGORY_NUM) in OSSL_trace_set_suffix()
441 return set_trace_data(category, 0, NULL, NULL, &suffix, in OSSL_trace_set_suffix()
448 static int ossl_trace_get_category(int category) in ossl_trace_get_category() argument
450 if (category < 0 || category >= OSSL_TRACE_CATEGORY_NUM) in ossl_trace_get_category()
452 if (trace_channels[category].bio != NULL) in ossl_trace_get_category()
453 return category; in ossl_trace_get_category()
458 int OSSL_trace_enabled(int category) in OSSL_trace_enabled() argument
462 category = ossl_trace_get_category(category); in OSSL_trace_enabled()
463 if (category >= 0) in OSSL_trace_enabled()
464 ret = trace_channels[category].bio != NULL; in OSSL_trace_enabled()
469 BIO *OSSL_trace_begin(int category) in OSSL_trace_begin() argument
475 category = ossl_trace_get_category(category); in OSSL_trace_begin()
476 if (category < 0) in OSSL_trace_begin()
479 channel = trace_channels[category].bio; in OSSL_trace_begin()
480 prefix = trace_channels[category].prefix; in OSSL_trace_begin()
486 switch (trace_channels[category].type) { in OSSL_trace_begin()
503 void OSSL_trace_end(int category, BIO * channel) in OSSL_trace_end() argument
508 category = ossl_trace_get_category(category); in OSSL_trace_end()
509 if (category < 0) in OSSL_trace_end()
511 suffix = trace_channels[category].suffix; in OSSL_trace_end()
515 switch (trace_channels[category].type) { in OSSL_trace_end()