-spell param(eter) correctly
[oweals/gnunet.git] / src / conversation / gnunet_conversation.h
1 /*
2       This file is part of GNUnet
3       (C) 
4
5       GNUnet is free software; you can redistribute it and/or modify
6       it under the terms of the GNU General Public License as published
7       by the Free Software Foundation; either version 2, or (at your
8       option) any later version.
9
10       GNUnet is distributed in the hope that it will be useful, but
11       WITHOUT ANY WARRANTY; without even the implied warranty of
12       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13       General Public License for more details.
14
15       You should have received a copy of the GNU General Public License
16       along with GNUnet; see the file COPYING.  If not, write to the
17       Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18       Boston, MA 02111-1307, USA.
19  */
20
21 /**
22  * @file include/gnunet_conversation.h
23  * @brief Header to the conversation service
24  * @author Simon Dieterle
25  * @author Andreas Fuchs
26  */
27 #ifndef GNUNET_CONVERSATION_H
28 #define GNUNET_CONVERSATION_H
29
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #if 0                           /* keep Emacsens' auto-indent happy */
34 }
35 #endif
36 #endif
37
38 #define MAX_TRANSMIT_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
39
40 /**
41 * Reasons for rejecting an incoming call
42 */
43 enum reject_reason
44 {
45   REJECT_REASON_GENERIC = 0,
46   REJECT_REASON_NOT_AVAILABLE,
47   REJECT_REASON_NO_CLIENT,
48   REJECT_REASON_ACTIVE_CALL,
49   REJECT_REASON_NO_ANSWER
50 };
51
52 /*
53 * The possible connection status
54 */
55 enum connection_status
56 {
57   LISTEN,
58   CALLER,
59   CALLEE,
60   CONNECTED
61 };
62
63 /**
64  * VoipClient.
65  */
66 struct VoipClient
67 {
68   /**
69    * Handle for a conversation client.
70    */
71   struct GNUNET_SERVER_Client *client;
72 };
73
74 /**
75 * The connection status of the service
76 */
77 struct ConnectionStatus
78 {
79         /**
80         * The client which is in interaction
81         */
82   struct GNUNET_SERVER_Client *client;
83
84         /**
85         * The PeerIdentity of the peer
86         */
87   struct GNUNET_PeerIdentity peer;
88
89         /**
90         * The status (see enum)
91         */
92   int status;
93 };
94
95 /**
96 * Iformation about a missed call
97 */
98 struct MissedCall
99 {
100         /**
101         * The PeerIdentity of the peer
102         */
103   struct GNUNET_PeerIdentity peer;
104
105         /**
106         * The time the call was
107         */
108   struct GNUNET_TIME_Absolute time;
109
110 };
111
112 /**
113 * Transmit a mesh message
114  * @param cls closure, NULL
115  * @param size number of bytes available in buf
116  * @param buf where the callee should write the error message
117  * @return number of bytes written to buf
118  */
119 static size_t transmit_mesh_message (void *cls, size_t size, void *buf);
120
121 /**
122  * Function called to send a peer no answer message to the client.
123  * "buf" will be NULL and "size" zero if the socket was closed for writing in
124  * the meantime.
125  *
126  * @param cls closure, NULL
127  * @param size number of bytes available in buf
128  * @param buf where the callee should write the peer no answer message
129  * @return number of bytes written to buf
130  */
131 static size_t
132 transmit_server_no_answer_message (void *cls, size_t size, void *buf);
133
134 /**
135  * Task to schedule a audio transmission.
136  * 
137  * @param cls Closure.
138  * @param tc Task Context.
139  */
140 static void
141 transmit_audio_task (void *cls,
142                      const struct GNUNET_SCHEDULER_TaskContext *tc);
143
144 /**
145 * Start the audio helpers
146 */
147 int start_helpers (void);
148
149 /**
150 * Stop the audio helpers
151 */
152 void stop_helpers (void);
153
154
155
156 #if 0                           /* keep Emacsens' auto-indent happy */
157 {
158 #endif
159 #ifdef __cplusplus
160 }
161 #endif
162
163 #endif