updated Doxyfile
[strongswan.git] / src / charon / network / sender.h
1 /*
2 * Copyright (C) 2005-2007 Martin Willi
3 * Copyright (C) 2005 Jan Hutter
4 * Hochschule fuer Technik Rapperswil
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 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
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 MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * $Id$
17 */
18
19 /**
20 * @defgroup sender sender
21 * @{ @ingroup network
22 */
23
24 #ifndef SENDER_H_
25 #define SENDER_H_
26
27 typedef struct sender_t sender_t;
28
29 #include <library.h>
30 #include <network/packet.h>
31
32 /**
33 * Thread responsible for sending packets over the socket.
34 */
35 struct sender_t {
36
37 /**
38 * Send a packet over the network.
39 *
40 * This function is non blocking and adds the packet to a queue.
41 * Whenever the sender thread thinks it's good to send the packet,
42 * it'll do so.
43 *
44 * @param packet packet to send
45 */
46 void (*send) (sender_t *this, packet_t *packet);
47
48 /**
49 * Destroys a sender object.
50 */
51 void (*destroy) (sender_t *this);
52 };
53
54 /**
55 * Create the sender thread.
56 *
57 * The thread will start to work, getting packets
58 * from its queue and sends them out.
59 *
60 * @return created sender object
61 */
62 sender_t * sender_create(void);
63
64 #endif /** SENDER_H_ @}*/