Mercurial > hg > index.fcgi > gift-gnutella > gift-gnutella-0.0.11-1pba
comparison src/io/rx_layer.h @ 0:d39e1d0d75b6
initial add
author | paulo@hit-nxdomain.opendns.com |
---|---|
date | Sat, 20 Feb 2010 21:18:28 -0800 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:d5f0075d77da |
---|---|
1 /* | |
2 * $Id: rx_layer.h,v 1.3 2004/02/01 08:17:12 hipnod Exp $ | |
3 * | |
4 * Copyright (C) 2003 giFT project (gift.sourceforge.net) | |
5 * | |
6 * This program is free software; you can redistribute it and/or modify it | |
7 * under the terms of the GNU General Public License as published by the | |
8 * Free Software Foundation; either version 2, or (at your option) any | |
9 * later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, but | |
12 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 * General Public License for more details. | |
15 */ | |
16 | |
17 #ifndef GIFT_GT_RX_LAYER_H_ | |
18 #define GIFT_GT_RX_LAYER_H_ | |
19 | |
20 /*****************************************************************************/ | |
21 | |
22 #include "rx_stack.h" | |
23 #include "io_buf.h" | |
24 | |
25 /*****************************************************************************/ | |
26 | |
27 struct gt_rx_stack; | |
28 struct rx_layer; | |
29 | |
30 struct rx_layer_ops | |
31 { | |
32 BOOL (*init) (struct rx_layer *layer, void *udata); | |
33 void (*destroy) (struct rx_layer *layer); | |
34 void (*enable) (struct rx_layer *layer); | |
35 void (*disable) (struct rx_layer *layer); | |
36 void (*recv) (struct rx_layer *layer, struct io_buf *io_buf); | |
37 }; | |
38 | |
39 struct rx_layer | |
40 { | |
41 const char *name; | |
42 void *udata; | |
43 struct rx_layer_ops *ops; | |
44 BOOL enabled; | |
45 | |
46 struct rx_layer *upper; | |
47 struct rx_layer *lower; | |
48 | |
49 struct gt_rx_stack *stack; | |
50 }; | |
51 | |
52 /*****************************************************************************/ | |
53 | |
54 struct rx_layer *gt_rx_layer_new (struct gt_rx_stack *stack, | |
55 const char *name, | |
56 struct rx_layer_ops *ops, void *udata); | |
57 void gt_rx_layer_free (struct rx_layer *layer); | |
58 | |
59 void gt_rx_layer_disable (struct rx_layer *layer); | |
60 void gt_rx_layer_enable (struct rx_layer *layer); | |
61 | |
62 /* pass a message buffer up to preceding layers */ | |
63 void gt_rx_layer_recv (struct rx_layer *layer, | |
64 struct io_buf *io_buf); | |
65 | |
66 /*****************************************************************************/ | |
67 | |
68 #endif /* GIFT_GT_RX_LAYER_H_ */ |