unbound: dt_msg_queue Struct Reference

unbound 0.1

Data Fields
dt_msg_queue Struct Reference

A message buffer with dnstap messages queued up. More...

`#include <dtstream.h>`

## Data Fields
lock_basic_type | lock
| lock of the buffer structure.
size_t | maxsize
| the maximum size of the buffer, in bytes
size_t | cursize
| current size of the buffer, in bytes.
int | msgcount
| number of messages in the queue
struct dt_msg_entry * | first
| list of messages.
struct dt_msg_entry * | last
struct dt_io_thread * | dtio
| reference to the io thread to wakeup
struct comm_timer * | wakeup_timer
| the wakeup timer for dtio, on worker event base

## Detailed Description

A message buffer with dnstap messages queued up.

It is per-worker. It has locks to synchronize. If the buffer is full, a new message cannot be added and is discarded. A thread reads the messages and sends them.

## Field Documentation

## ◆ lock

lock_basic_type dt_msg_queue::lock

lock of the buffer structure.

Hold this lock to add or remove entries to the buffer. Release it so that other threads can also put messages to log, or a message can be taken out to send away by the writer thread.

Referenced by dt_io_thread_register_queue(), dt_io_thread_unregister_queue(), dt_msg_queue_create(), dt_msg_queue_delete(), dt_msg_queue_pop(), and dt_msg_queue_submit().

## ◆ cursize

size_t dt_msg_queue::cursize

current size of the buffer, in bytes.

data bytes of messages. If a new message make it more than maxsize, the buffer is full

Referenced by dt_msg_queue_clear(), dt_msg_queue_pop(), and dt_msg_queue_submit().

## ◆ first

struct dt_msg_entry* dt_msg_queue::first

list of messages.

The messages are added to the back and taken out from the front.

Referenced by dt_msg_queue_clear(), dt_msg_queue_pop(), and dt_msg_queue_submit().

The documentation for this struct was generated from the following file:

- dnstap/dtstream.h