Lines Matching refs:channel
41 static long trace_ctrl(BIO *channel, int cmd, long argl, void *argp);
65 static int trace_write(BIO *channel, in trace_write() argument
68 struct trace_data_st *ctx = BIO_get_data(channel); in trace_write()
76 static int trace_puts(BIO *channel, const char *str) in trace_puts() argument
80 if (trace_write(channel, str, strlen(str), &written)) in trace_puts()
86 static long trace_ctrl(BIO *channel, int cmd, long argl, void *argp) in trace_ctrl() argument
88 struct trace_data_st *ctx = BIO_get_data(channel); in trace_ctrl()
102 static int trace_free(BIO *channel) in trace_free() argument
104 if (channel == NULL) in trace_free()
106 OPENSSL_free(BIO_get_data(channel)); in trace_free()
246 static int set_trace_data(int category, int type, BIO **channel, in set_trace_data() argument
272 if (channel != NULL && curr_channel != NULL) { in set_trace_data()
287 if (channel != NULL && curr_channel != NULL) { in set_trace_data()
306 if (channel != NULL && *channel != NULL) { in set_trace_data()
308 trace_channels[category].bio = *channel; in set_trace_data()
316 if (channel != NULL && *channel != NULL) { in set_trace_data()
317 attach_cb(category, CHANNEL, *channel); in set_trace_data()
343 BIO *channel = NULL; in ossl_trace_cleanup() local
351 set_trace_data(category, 0, &channel, &prefix, &suffix, in ossl_trace_cleanup()
354 set_trace_data(OSSL_TRACE_CATEGORY_TRACE, 0, &channel, in ossl_trace_cleanup()
361 int OSSL_trace_set_channel(int category, BIO *channel) in OSSL_trace_set_channel() argument
365 return set_trace_data(category, SIMPLE_CHANNEL, &channel, NULL, NULL, in OSSL_trace_set_channel()
398 BIO *channel = NULL; in OSSL_trace_set_callback() local
405 if ((channel = BIO_new(&trace_method)) == NULL in OSSL_trace_set_callback()
414 BIO_set_data(channel, trace_data); in OSSL_trace_set_callback()
417 if (!set_trace_data(category, CALLBACK_CHANNEL, &channel, NULL, NULL, in OSSL_trace_set_callback()
424 BIO_free(channel); in OSSL_trace_set_callback()
475 BIO *channel = NULL; in OSSL_trace_begin() local
483 channel = trace_channels[category].bio; in OSSL_trace_begin()
486 if (channel != NULL) { in OSSL_trace_begin()
489 current_channel = channel; in OSSL_trace_begin()
493 (void)BIO_puts(channel, prefix); in OSSL_trace_begin()
494 (void)BIO_puts(channel, "\n"); in OSSL_trace_begin()
498 (void)BIO_ctrl(channel, OSSL_TRACE_CTRL_BEGIN, in OSSL_trace_begin()
504 return channel; in OSSL_trace_begin()
507 void OSSL_trace_end(int category, BIO *channel) in OSSL_trace_end() argument
516 if (channel != NULL in OSSL_trace_end()
517 && ossl_assert(channel == current_channel)) { in OSSL_trace_end()
518 (void)BIO_flush(channel); in OSSL_trace_end()
522 (void)BIO_puts(channel, suffix); in OSSL_trace_end()
523 (void)BIO_puts(channel, "\n"); in OSSL_trace_end()
527 (void)BIO_ctrl(channel, OSSL_TRACE_CTRL_END, in OSSL_trace_end()