This file is the "ancestor" class of all RX drivers, and therefore only implements general routines that are mostly common, as well as provides type-checked entry points for dynamically dispatched routines, such as rx_free().
#include "common.h"
#include "rx.h"
#include "nodes.h"
#include "lib/walloc.h"
#include "lib/override.h"
Defines | |
#define | RX_INIT(o, a) ((o)->ops->init((o), (a))) |
#define | RX_DESTROY(o) ((o)->ops->destroy((o))) |
#define | RX_RECV(o, m) ((o)->ops->recv((o), (m))) |
#define | RX_ENABLE(o) ((o)->ops->enable((o))) |
#define | RX_DISABLE(o) ((o)->ops->disable((o))) |
#define | RX_BIO_SOURCE(o) ((o)->ops->bio_source((o))) |
Functions | |
RCSID ("$Id:rx.c, v 1.13 2005/11/30 16:43:41 rmanfredi Exp $") | |
void | rx_data_ind (rxdrv_t *rx, pmsg_t *mb) |
Tell upper layer that it got new data from us. | |
rxdrv_t * | rx_make (gpointer owner, gnet_host_t *host, const struct rxdrv_ops *ops, gpointer args) |
void | rx_set_data_ind (rxdrv_t *rx, rx_data_t data_ind) |
Set the `data_ind' callback, invoked when a new message has been fully received by the RX stack. | |
void | rx_attached (rxdrv_t *rx, rxdrv_t *urx) |
Called when an upper driver (urx) is attached on top of us. | |
rxdrv_t * | rx_make_above (rxdrv_t *lrx, const struct rxdrv_ops *ops, gconstpointer args) |
Creation routine for a driver to be stacked above specified lower `lrx'. | |
void | rx_deep_free (rxdrv_t *rx) |
Dispose of the driver resources, recursively. | |
void | rx_free (rxdrv_t *rx) |
Dispose of the driver resources, recursively and asynchronously. | |
void | rx_collect (void) |
Collect freed stacks. | |
void | rx_recv (rxdrv_t *rx, pmsg_t *mb) |
Inject data into driver, from lower layer. | |
void | rx_deep_enable (rxdrv_t *rx) |
Enable reception, recursively. | |
void | rx_enable (rxdrv_t *rx) |
Enable reception, recursively. | |
void | rx_deep_disable (rxdrv_t *rx) |
Disable reception, recursively. | |
void | rx_disable (rxdrv_t *rx) |
Disable reception, recursively. | |
rxdrv_t * | rx_deep_bottom (rxdrv_t *rx) |
rxdrv_t * | rx_bottom (rxdrv_t *rx) |
bio_source * | rx_bio_source (rxdrv_t *rx) |
bio_source * | rx_no_source (rxdrv_t *unused_rx) |
No I/O source can be fetched from this layer. | |
Variables | |
GSList * | rx_freed = NULL |
To guarantee that destruction of the stack always happens asynchronously with respect to the caller (i.e. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Called when an upper driver (urx) is attached on top of us.
|
|
|
|
|
|
Collect freed stacks.
|
|
Tell upper layer that it got new data from us.
|
|
|
|
Disable reception, recursively.
|
|
Enable reception, recursively.
|
|
Dispose of the driver resources, recursively.
|
|
Disable reception, recursively. It must be called on the top layer only. |
|
Enable reception, recursively. It must be called on the top layer only. |
|
Dispose of the driver resources, recursively and asynchronously. It must be called on the top layer only. |
|
|
|
Creation routine for a driver to be stacked above specified lower `lrx'.
|
|
No I/O source can be fetched from this layer.
|
|
Inject data into driver, from lower layer.
|
|
Set the `data_ind' callback, invoked when a new message has been fully received by the RX stack. The first argument of the routine is the layer from which data come, which will be the topmost driver when calling the external routine. |
|
To guarantee that destruction of the stack always happens asynchronously with respect to the caller (i.e. it is not happening in the same calling stack), freed stacks are remembered and periodically collected. |