view src/io/tx_stack.h @ 0:d39e1d0d75b6

initial add
author paulo@hit-nxdomain.opendns.com
date Sat, 20 Feb 2010 21:18:28 -0800
parents
children
line source
1 /*
2 * $Id: tx_stack.h,v 1.6 2004/04/17 06:07:33 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 */
17 #ifndef GIFT_GT_TX_STACK_H_
18 #define GIFT_GT_TX_STACK_H_
20 /*****************************************************************************/
22 typedef struct gt_tx_stack GtTxStack;
24 typedef void (*GtTxStackCleanup) (GtTxStack *stack, void *udata);
26 struct gt_tx_stack
27 {
28 struct tx_layer *layers;
29 GtTxStackCleanup cleanup;
31 TCPC *c;
32 void *udata;
34 time_t start_time;
35 };
37 /*****************************************************************************/
39 GtTxStack *gt_tx_stack_new (TCPC *c, BOOL tx_deflated);
40 void gt_tx_stack_free (GtTxStack *stack);
42 void gt_tx_stack_abort (GtTxStack *stack);
44 void gt_tx_stack_set_handler (GtTxStack *stack,
45 GtTxStackCleanup cleanup,
46 void *udata);
48 BOOL gt_tx_stack_queue (GtTxStack *stack, const uint8_t *data,
49 size_t len);
51 /* used by tx_link to send data on the connection...argh, i can't
52 * come up with a good interface for this */
53 int gt_tx_stack_send (GtTxStack *stack, const uint8_t *data,
54 size_t len);
56 /*****************************************************************************/
58 #endif /* GIFT_GT_TX_STACK_H_ */