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

tx_link.c File Reference


Detailed Description

Network driver -- link level.

This driver writes to the remote node the data that are passed to it, and will flow control as soon as the kernel refuses to write any more data or when the bandwidth devoted to Gnet has reached its limit.

Author:
Raphael Manfredi
Date:
2002-2003

#include "common.h"
#include "sockets.h"
#include "tx.h"
#include "tx_link.h"
#include "bsched.h"
#include "lib/tm.h"
#include "lib/walloc.h"
#include "lib/override.h"

Data Structures

struct  attr
 Private attributes for the decompressing layer. More...


Functions

 RCSID ("$Id:tx_link.c, v 1.21 2005/09/17 22:30:28 rmanfredi Exp $")
void is_writable (gpointer data, gint unused_source, inputevt_cond_t cond)
 Invoked when the output file descriptor can accept more data.

gpointer tx_link_init (txdrv_t *tx, gpointer args)
 Initialize the driver.

void tx_link_destroy (txdrv_t *tx)
 Get rid of the driver's private data.

gint tx_link_write_error (txdrv_t *tx, const char *func)
ssize_t tx_link_write (txdrv_t *tx, gpointer data, size_t len)
 Write data buffer.

ssize_t tx_link_writev (txdrv_t *tx, struct iovec *iov, gint iovcnt)
 Write I/O vector.

void tx_link_enable (txdrv_t *tx)
 Allow servicing of upper TX queue when output fd is ready.

void tx_link_disable (txdrv_t *tx)
 Disable servicing of upper TX queue.

size_t tx_link_pending (txdrv_t *unused_tx)
 No data buffered at this level: always returns 0.

void tx_link_flush (txdrv_t *unused_tx)
 No data buffered at this level, nothing to do.

void tx_link_shutdown (txdrv_t *unused_tx)
 Nothing to do.

bio_source * tx_link_bio_source (txdrv_t *tx)
const struct txdrv_ops * tx_link_get_ops (void)

Variables

const struct txdrv_ops tx_link_ops


Function Documentation

void is_writable (  gpointer  data,
gint  unused_source,
inputevt_cond_t  cond
)  [static]
 

Invoked when the output file descriptor can accept more data.

RCSID (  "$Id:tx_link.  c,
v 1.21 2005/09/17 22:30:28 rmanfredi Exp $" 
) 
 

struct bio_source* tx_link_bio_source (  txdrv_t *  tx  )  [static]
 

void tx_link_destroy (  txdrv_t *  tx  )  [static]
 

Get rid of the driver's private data.

void tx_link_disable (  txdrv_t *  tx  )  [static]
 

Disable servicing of upper TX queue.

void tx_link_enable (  txdrv_t *  tx  )  [static]
 

Allow servicing of upper TX queue when output fd is ready.

void tx_link_flush (  txdrv_t *  unused_tx  )  [static]
 

No data buffered at this level, nothing to do.

const struct txdrv_ops* tx_link_get_ops (  void   ) 
 

gpointer tx_link_init (  txdrv_t *  tx,
gpointer  args
)  [static]
 

Initialize the driver.

Always succeeds, so never returns NULL.

size_t tx_link_pending (  txdrv_t *  unused_tx  )  [static]
 

No data buffered at this level: always returns 0.

void tx_link_shutdown (  txdrv_t *  unused_tx  )  [static]
 

Nothing to do.

ssize_t tx_link_write (  txdrv_t *  tx,
gpointer  data,
size_t  len
)  [static]
 

Write data buffer.

Returns:
amount of bytes written, or -1 on error.

gint tx_link_write_error (  txdrv_t *  tx,
const char *  func
)  [inline, static]
 

ssize_t tx_link_writev (  txdrv_t *  tx,
struct iovec *  iov,
gint  iovcnt
)  [static]
 

Write I/O vector.

Returns:
amount of bytes written, or -1 on error.


Variable Documentation

const struct txdrv_ops tx_link_ops [static]
 

Initial value:

 {
    tx_link_init,       
    tx_link_destroy,    
    tx_link_write,      
    tx_link_writev,     
    tx_no_sendto,       
    tx_link_enable,     
    tx_link_disable,    
    tx_link_pending,    
    tx_link_flush,      
    tx_link_shutdown,   
    tx_close_noop,      
    tx_link_bio_source, 
}


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