This file is the "ancestor" class of all TX 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 tx_write().
|
Data Structures |
struct | tx_close_arg |
| Argument for tx_close_next(). More...
|
Defines |
#define | TX_INIT(o, a) ((o)->ops->init((o), (a))) |
#define | TX_DESTROY(o) ((o)->ops->destroy((o))) |
#define | TX_WRITE(o, d, l) ((o)->ops->write((o), (d), (l))) |
#define | TX_WRITEV(o, i, c) ((o)->ops->writev((o), (i), (c))) |
#define | TX_SENDTO(o, t, d, l) ((o)->ops->sendto((o), (t), (d), (l))) |
#define | TX_ENABLE(o) ((o)->ops->enable((o))) |
#define | TX_DISABLE(o) ((o)->ops->disable((o))) |
#define | TX_PENDING(o) ((o)->ops->pending((o))) |
#define | TX_BIO_SOURCE(o) ((o)->ops->bio_source((o))) |
#define | TX_FLUSH(o) ((o)->ops->flush((o))) |
#define | TX_SHUTDOWN(o) ((o)->ops->shutdown((o))) |
#define | TX_CLOSE(o, c, a) ((o)->ops->close((o), (c), (a))) |
Functions |
| RCSID ("$Id:tx.c, v 1.21 2005/11/30 16:43:41 rmanfredi Exp $") |
txdrv_t * | tx_make (gpointer owner, gnet_host_t *host, const struct txdrv_ops *ops, gpointer args) |
| Create a new network driver, equipped with the `ops' operations and initialize its specific parameters by calling the init routine with `args'.
|
void | tx_attached (txdrv_t *tx, txdrv_t *utx) |
| Called when an upper driver (utx) is attached on top of us.
|
txdrv_t * | tx_make_above (txdrv_t *ltx, const struct txdrv_ops *ops, gpointer args) |
| Createion routine for a driver to be stacked above specified lower `ltx'.
|
void | tx_shutdown (txdrv_t *tx) |
| Shutdown stack, disallowing further writes.
|
void | tx_deep_free (txdrv_t *tx) |
| Dispose of the driver resources, recursively.
|
void | tx_free (txdrv_t *tx) |
| Dispose of the driver resources, asynchronously.
|
void | tx_collect (void) |
| Collect freed stacks.
|
ssize_t | tx_write (txdrv_t *tx, gpointer data, size_t len) |
| Write `len' bytes starting at `data'.
|
ssize_t | tx_writev (txdrv_t *tx, struct iovec *iov, gint iovcnt) |
| Write I/O vector.
|
ssize_t | tx_sendto (txdrv_t *tx, gnet_host_t *to, gpointer data, size_t len) |
| Send buffer datagram to specified destination `to'.
|
void | tx_srv_register (txdrv_t *tx, tx_service_t srv_fn, gpointer srv_arg) |
| Register service routine from upper TX layer.
|
void | tx_srv_enable (txdrv_t *tx) |
| Record that upper layer wants its service routine enabled.
|
void | tx_srv_disable (txdrv_t *tx) |
| Record that upper layer wants its service routine disabled.
|
size_t | tx_pending (txdrv_t *tx) |
txdrv_t * | tx_deep_bottom (txdrv_t *tx) |
void | tx_eager_mode (txdrv_t *tx, gboolean on) |
| Set stack in "eager" mode: in that mode, servicing is always enabled in the whole stack, meaning the bottom layer always invokes the queue service routines whenever it can accept more data.
|
bio_source * | tx_bio_source (txdrv_t *tx) |
| The I/O source of the lowest layer (link) that physically sends the information.
|
void | tx_flush (txdrv_t *tx) |
| Request that data be sent immediately.
|
gboolean | tx_has_error (txdrv_t *tx) |
void | tx_close_next (txdrv_t *tx, gpointer arg) |
| Callback invoked when a layer in the TX stack was closed, i.e.
|
void | tx_close (txdrv_t *tx, tx_closed_t cb, gpointer arg) |
| Close the transmission by ensuring each layer properly finishes sending its data.
|
void | tx_close_noop (txdrv_t *tx, tx_closed_t cb, gpointer arg) |
| No-operation closing routine for layers that don't need anything special.
|
ssize_t | tx_no_write (txdrv_t *unused_tx, gpointer unused_data, size_t unused_len) |
| The write() operation is forbidden.
|
ssize_t | tx_no_writev (txdrv_t *unused_tx, struct iovec *unused_iov, gint unused_iovcnt) |
| The writev() operation is forbidden.
|
ssize_t | tx_no_sendto (txdrv_t *unused_tx, gnet_host_t *unused_to, gpointer unused_data, size_t unused_len) |
| The sendto() operation is forbidden.
|
bio_source * | tx_no_source (txdrv_t *unused_tx) |
| No I/O source can be fetched from this layer.
|
Variables |
GSList * | tx_freed = NULL |
| To guarantee that destruction of the stack always happens asynchronously with respect to the caller (i.e.
|