2
* $Id: rx.h,v 1.6 2003/07/15 09:07:58 rmanfredi Exp $
4
* Copyright (c) 2002-2003, Raphael Manfredi
8
*----------------------------------------------------------------------
9
* This file is part of gtk-gnutella.
11
* gtk-gnutella is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License as published by
13
* the Free Software Foundation; either version 2 of the License, or
14
* (at your option) any later version.
16
* gtk-gnutella is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU General Public License for more details.
21
* You should have received a copy of the GNU General Public License
22
* along with gtk-gnutella; if not, write to the Free Software
24
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
*----------------------------------------------------------------------
40
typedef void (*rx_data_t)(struct rxdriver *, pmsg_t *mb);
46
typedef struct rxdriver {
47
struct gnutella_node *node; /* Node to which this driver belongs */
48
struct rxdrv_ops *ops; /* Dynamically dispatched operations */
49
struct rxdriver *upper; /* Layer above, NULL if none */
50
struct rxdriver *lower; /* Layer underneath, NULL if none */
51
gint flags; /* Driver flags */
52
rx_data_t data_ind; /* Data indication routine */
53
gpointer opaque; /* Used by heirs to store specific info */
56
#define rx_node(r) ((r)->node)
63
* Operations defined on all drivers.
67
gpointer (*init)(rxdrv_t *tx, gpointer args);
68
void (*destroy)(rxdrv_t *tx);
69
void (*recv)(rxdrv_t *tx, pmsg_t *mb);
70
void (*enable)(rxdrv_t *tx);
71
void (*disable)(rxdrv_t *tx);
72
struct bio_source *(*bio_source)(rxdrv_t *tx);
80
struct gnutella_node *n,
81
struct rxdrv_ops *ops,
84
rxdrv_t *rx_make_under(rxdrv_t *urx, struct rxdrv_ops *ops, gpointer args);
85
void rx_free(rxdrv_t *d);
86
void rx_recv(rxdrv_t *rx, pmsg_t *mb);
87
void rx_enable(rxdrv_t *rx);
88
void rx_disable(rxdrv_t *rx);
89
rxdrv_t *rx_bottom(rxdrv_t *rx);
90
struct bio_source *rx_bio_source(rxdrv_t *rx);