Lines Matching refs:channel

32  * BIO sink object, also called the trace channel. Instead of a BIO object,
34 * internal trace channel is attached, which simply calls the registered
40 static long trace_ctrl(BIO *channel, int cmd, long argl, void *argp);
64 static int trace_write(BIO *channel,
67 struct trace_data_st *ctx = BIO_get_data(channel);
75 static int trace_puts(BIO *channel, const char *str)
79 if (trace_write(channel, str, strlen(str), &written))
85 static long trace_ctrl(BIO *channel, int cmd, long argl, void *argp)
87 struct trace_data_st *ctx = BIO_get_data(channel);
101 static int trace_free(BIO *channel)
103 if (channel == NULL)
105 OPENSSL_free(BIO_get_data(channel));
173 /* We use one trace channel for each trace category */
197 OSSL_TRACE2(TRACE, "Attach channel %p to category '%s'\n",
218 OSSL_TRACE2(TRACE, "Detach channel %p from category '%s'\n",
242 static int set_trace_data(int category, int type, BIO **channel,
268 if (channel != NULL && curr_channel != NULL) {
283 if (channel != NULL && curr_channel != NULL) {
302 if (channel != NULL && *channel != NULL) {
304 trace_channels[category].bio = *channel;
307 * as those may fail, and then the caller is mislead to free *channel.
312 if (channel != NULL && *channel != NULL) {
313 attach_cb(category, CHANNEL, *channel);
339 BIO *channel = NULL;
347 set_trace_data(category, 0, &channel, &prefix, &suffix,
350 set_trace_data(OSSL_TRACE_CATEGORY_TRACE, 0, &channel,
357 int OSSL_trace_set_channel(int category, BIO *channel)
361 return set_trace_data(category, SIMPLE_CHANNEL, &channel, NULL, NULL,
373 "Attach channel %p to category '%s' (with callback)\n",
394 BIO *channel = NULL;
401 if ((channel = BIO_new(&trace_method)) == NULL
410 BIO_set_data(channel, trace_data);
413 if (!set_trace_data(category, CALLBACK_CHANNEL, &channel, NULL, NULL,
420 BIO_free(channel);
471 BIO *channel = NULL;
479 channel = trace_channels[category].bio;
482 if (channel != NULL) {
485 current_channel = channel;
489 (void)BIO_puts(channel, prefix);
490 (void)BIO_puts(channel, "\n");
494 (void)BIO_ctrl(channel, OSSL_TRACE_CTRL_BEGIN,
500 return channel;
503 void OSSL_trace_end(int category, BIO * channel)
512 if (channel != NULL
513 && ossl_assert(channel == current_channel)) {
514 (void)BIO_flush(channel);
518 (void)BIO_puts(channel, suffix);
519 (void)BIO_puts(channel, "\n");
523 (void)BIO_ctrl(channel, OSSL_TRACE_CTRL_END,