Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

rx.c File Reference


Detailed Description

Network RX drivers.

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().

Author:
Raphael Manfredi
Date:
2002-2005

#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.


Define Documentation

#define RX_BIO_SOURCE (  o   )     ((o)->ops->bio_source((o)))
 

#define RX_DESTROY (  o   )     ((o)->ops->destroy((o)))
 

#define RX_DISABLE (  o   )     ((o)->ops->disable((o)))
 

#define RX_ENABLE (  o   )     ((o)->ops->enable((o)))
 

#define RX_INIT (  o,
a   )     ((o)->ops->init((o), (a)))
 

#define RX_RECV (  o,
m   )     ((o)->ops->recv((o), (m)))
 


Function Documentation

RCSID (  "$Id:rx.  c,
v 1.13 2005/11/30 16:43:41 rmanfredi Exp $" 
) 
 

void rx_attached (  rxdrv_t *  rx,
rxdrv_t *  urx
)  [static]
 

Called when an upper driver (urx) is attached on top of us.

struct bio_source* rx_bio_source (  rxdrv_t *  rx  ) 
 

Returns:
the I/O source from the bottom of the stack (link layer).

rxdrv_t* rx_bottom (  rxdrv_t *  rx  ) 
 

Returns:
the driver at the bottom of the stack.

void rx_collect (  void   ) 
 

Collect freed stacks.

void rx_data_ind (  rxdrv_t *  rx,
pmsg_t *  mb
)  [static]
 

Tell upper layer that it got new data from us.

rxdrv_t* rx_deep_bottom (  rxdrv_t *  rx  )  [static]
 

Returns:
the driver at the bottom of the stack.

void rx_deep_disable (  rxdrv_t *  rx  )  [static]
 

Disable reception, recursively.

void rx_deep_enable (  rxdrv_t *  rx  )  [static]
 

Enable reception, recursively.

void rx_deep_free (  rxdrv_t *  rx  )  [static]
 

Dispose of the driver resources, recursively.

void rx_disable (  rxdrv_t *  rx  ) 
 

Disable reception, recursively.

It must be called on the top layer only.

void rx_enable (  rxdrv_t *  rx  ) 
 

Enable reception, recursively.

It must be called on the top layer only.

void rx_free (  rxdrv_t *  rx  ) 
 

Dispose of the driver resources, recursively and asynchronously.

It must be called on the top layer only.

rxdrv_t* rx_make (  gpointer  owner,
gnet_host_t *  host,
const struct rxdrv_ops *  ops,
gpointer  args
) 
 

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'.

Returns:
NULL if there is an initialization problem.

struct bio_source* rx_no_source (  rxdrv_t *  unused_rx  ) 
 

No I/O source can be fetched from this layer.

void rx_recv (  rxdrv_t *  rx,
pmsg_t *  mb
) 
 

Inject data into driver, from lower layer.

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.

The first argument of the routine is the layer from which data come, which will be the topmost driver when calling the external routine.


Variable Documentation

GSList* rx_freed = NULL [static]
 

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.


Generated on Sun Feb 12 10:50:06 2006 for Gtk-Gnutella by doxygen 1.3.6