Osmocom msgb write queues

## Files

file | write_queue.h
file | write_queue.c

## Data Structures

struct | osmo_wqueue

## Functions

void | osmo_wqueue_init (struct osmo_wqueue *queue, int max_length)
| Initialize a osmo_wqueue structure. More...
void | osmo_wqueue_clear (struct osmo_wqueue *queue)
| Clear a osmo_wqueue. More...
int | osmo_wqueue_enqueue (struct osmo_wqueue *queue, struct msgb *data)
| Enqueue a new Message buffers into a write queue. More...
int | osmo_wqueue_bfd_cb (struct osmo_fd *fd, unsigned int what)
| Select loop function for write queue handling. More...

## Detailed Description

## Function Documentation

int osmo_wqueue_bfd_cb | ( | struct osmo_fd * | fd,
|  | unsigned int | what
| ) |  |

Select loop function for write queue handling.

Parameters

  [in] | fd | osmocom file descriptor
  [in] | what | bit-mask of events that have happened

This function is provided so that it can be registered with the select loop abstraction code (osmo_fd::cb).

References osmo_wqueue::bfd, BSC_FD_EXCEPT, BSC_FD_READ, BSC_FD_WRITE, osmo_wqueue::current_length, osmo_wqueue::except_cb, osmo_wqueue::msg_queue, msgb_dequeue(), msgb_free(), osmo_wqueue::read_cb, osmo_fd::when, and osmo_wqueue::write_cb.

Referenced by osmo_wqueue_init().

void osmo_wqueue_clear | ( | struct osmo_wqueue * | queue | ) |

Clear a osmo_wqueue.

Parameters

  [in] | queue | Write queue to be cleared

This function will clear (remove/release) all messages in it.

References osmo_wqueue::bfd, BSC_FD_WRITE, osmo_wqueue::current_length, osmo_wqueue::msg_queue, msgb_dequeue(), msgb_free(), and osmo_fd::when.

int osmo_wqueue_enqueue | ( | struct osmo_wqueue * | queue,
|  | struct msgb * | data
| ) |  |

Enqueue a new Message buffers into a write queue.

Parameters

  [in] | queue | Write queue to be used
  [in] | data | to-be-enqueued message buffer

References osmo_wqueue::bfd, BSC_FD_WRITE, osmo_wqueue::current_length, osmo_wqueue::msg_queue, msgb_enqueue(), and osmo_fd::when.

Referenced by gsmtap_sendmsg().

void osmo_wqueue_init | ( | struct osmo_wqueue * | queue,
|  | int | max_length
| ) |  |

Initialize a osmo_wqueue structure.

Parameters

  [in] | queue | Write queue to operate on
  [in] | max_length | Maximum length of write queue

References osmo_wqueue::bfd, osmo_fd::cb, osmo_wqueue::current_length, osmo_wqueue::max_length, osmo_wqueue::msg_queue, osmo_wqueue_bfd_cb(), osmo_wqueue::read_cb, and osmo_wqueue::write_cb.

Referenced by gsmtap_source_init().