diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-03-29 11:50:08 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-03-29 11:50:08 +0000 |
commit | 24260f6061bba1c694fe34defcf38b6c66cd6a8e (patch) | |
tree | 057f661d9c4af47aff97e3b4ca66ed774c6d96c3 /src/include | |
parent | 9df3d510bfb933e77347d214f24a1471c5df880f (diff) | |
download | gnunet-24260f6061bba1c694fe34defcf38b6c66cd6a8e.tar.gz gnunet-24260f6061bba1c694fe34defcf38b6c66cd6a8e.zip |
ideas
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/Makefile.am | 1 | ||||
-rw-r--r-- | src/include/gnunet_applications.h | 83 | ||||
-rw-r--r-- | src/include/gnunet_mesh_service.h | 14 |
3 files changed, 94 insertions, 4 deletions
diff --git a/src/include/Makefile.am b/src/include/Makefile.am index ea12f3339..fcc106d10 100644 --- a/src/include/Makefile.am +++ b/src/include/Makefile.am | |||
@@ -17,6 +17,7 @@ gnunetinclude_HEADERS = \ | |||
17 | $(WINPROC) \ | 17 | $(WINPROC) \ |
18 | block_dns.h \ | 18 | block_dns.h \ |
19 | block_fs.h \ | 19 | block_fs.h \ |
20 | gnunet_applications.h \ | ||
20 | gnunet_arm_service.h \ | 21 | gnunet_arm_service.h \ |
21 | gnunet_bandwidth_lib.h \ | 22 | gnunet_bandwidth_lib.h \ |
22 | gnunet_bio_lib.h \ | 23 | gnunet_bio_lib.h \ |
diff --git a/src/include/gnunet_applications.h b/src/include/gnunet_applications.h new file mode 100644 index 000000000..6304a2444 --- /dev/null +++ b/src/include/gnunet_applications.h | |||
@@ -0,0 +1,83 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | (C) 2011 Christian Grothoff (and other contributing authors) | ||
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_applications.h | ||
23 | * @brief constants for network applications operating on top of the MESH service | ||
24 | * @author Christian Grothoff | ||
25 | */ | ||
26 | |||
27 | #ifndef GNUNET_APPLICATIONS_H | ||
28 | #define GNUNET_APPLICATIONS_H | ||
29 | |||
30 | #ifdef __cplusplus | ||
31 | extern "C" | ||
32 | { | ||
33 | #if 0 /* keep Emacsens' auto-indent happy */ | ||
34 | } | ||
35 | #endif | ||
36 | #endif | ||
37 | |||
38 | /** | ||
39 | * Test. | ||
40 | */ | ||
41 | #define GNUNET_APPLICATION_TYPE_TEST 1 | ||
42 | |||
43 | /** | ||
44 | * Internet DNS resolution (external DNS gateway). | ||
45 | */ | ||
46 | #define GNUNET_APPLICATION_TYPE_INTERNET_RESOLVER 2 | ||
47 | |||
48 | /** | ||
49 | * Internet HTTP gateway (port 80). | ||
50 | */ | ||
51 | #define GNUNET_APPLICATION_TYPE_INTERNET_HTTP_GATEWAY 3 | ||
52 | |||
53 | /** | ||
54 | * Internet HTTPS gateway (port 443). | ||
55 | */ | ||
56 | #define GNUNET_APPLICATION_TYPE_INTERNET_HTTPS_GATEWAY 4 | ||
57 | |||
58 | /** | ||
59 | * Internet TCP gateway (any port). | ||
60 | */ | ||
61 | #define GNUNET_APPLICATION_TYPE_INTERNET_TCP_GATEWAY 5 | ||
62 | |||
63 | /** | ||
64 | * Internet UDP gateway (any port). | ||
65 | */ | ||
66 | #define GNUNET_APPLICATION_TYPE_INTERNET_UDP_GATEWAY 6 | ||
67 | |||
68 | /** | ||
69 | * GNUnet VPN Search Engine (searches HTTP sites hosted within GNUnet) [example] | ||
70 | */ | ||
71 | #define GNUNET_APPLICATION_TYPE_GNUNET_SEARCH 7 | ||
72 | |||
73 | |||
74 | #if 0 /* keep Emacsens' auto-indent happy */ | ||
75 | { | ||
76 | #endif | ||
77 | #ifdef __cplusplus | ||
78 | } | ||
79 | #endif | ||
80 | |||
81 | /* ifndef GNUNET_APPLICATIONS_H */ | ||
82 | #endif | ||
83 | /* end of gnunet_applications.h */ | ||
diff --git a/src/include/gnunet_mesh_service.h b/src/include/gnunet_mesh_service.h index aefdd209a..0c90f2105 100644 --- a/src/include/gnunet_mesh_service.h +++ b/src/include/gnunet_mesh_service.h | |||
@@ -116,6 +116,12 @@ typedef void (GNUNET_MESH_TunnelEndHandler)(void *cls, | |||
116 | 116 | ||
117 | 117 | ||
118 | /** | 118 | /** |
119 | * Type for an application. Values defined in gnunet_applications.h | ||
120 | */ | ||
121 | typedef uint32_t GNUNET_MESH_ApplicationType; | ||
122 | |||
123 | |||
124 | /** | ||
119 | * Connect to the mesh service. | 125 | * Connect to the mesh service. |
120 | * | 126 | * |
121 | * @param cfg configuration to use | 127 | * @param cfg configuration to use |
@@ -132,8 +138,8 @@ struct GNUNET_MESH_Handle * | |||
132 | GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | 138 | GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, |
133 | void *cls, | 139 | void *cls, |
134 | GNUNET_MESH_TunnelEndHandler cleaner, | 140 | GNUNET_MESH_TunnelEndHandler cleaner, |
135 | const struct GNUNET_MESH_MessageHandler *handlers); | 141 | const struct GNUNET_MESH_MessageHandler *handlers, |
136 | 142 | const GNUNET_MESH_ServiceType *stypes); | |
137 | 143 | ||
138 | /** | 144 | /** |
139 | * Get the peer on the other side of this tunnel if it is just one. Return NULL otherwise | 145 | * Get the peer on the other side of this tunnel if it is just one. Return NULL otherwise |
@@ -268,7 +274,7 @@ GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, | |||
268 | * | 274 | * |
269 | * @param h mesh handle | 275 | * @param h mesh handle |
270 | * @param timeout how long to try to establish a connection | 276 | * @param timeout how long to try to establish a connection |
271 | * @param message_type message type that must be supported by the peer (MESH should | 277 | * @param app_type application type that must be supported by the peer (MESH should |
272 | * discover peer in proximity handling this type) | 278 | * discover peer in proximity handling this type) |
273 | * @param connect_handler function to call on successful connect (or timeout); | 279 | * @param connect_handler function to call on successful connect (or timeout); |
274 | * will be called for EACH of the peers in the list and | 280 | * will be called for EACH of the peers in the list and |
@@ -282,7 +288,7 @@ GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, | |||
282 | struct GNUNET_MESH_Tunnel * | 288 | struct GNUNET_MESH_Tunnel * |
283 | GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Handle *h, | 289 | GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Handle *h, |
284 | struct GNUNET_TIME_Relative timeout, | 290 | struct GNUNET_TIME_Relative timeout, |
285 | uint16_t message_type, | 291 | GNUNET_MESH_ApplicationType app_type, |
286 | GNUNET_MESH_TunnelConnectHandler connect_handler, | 292 | GNUNET_MESH_TunnelConnectHandler connect_handler, |
287 | GNUNET_MESH_TunnelDisconnectHandler disconnect_handler, | 293 | GNUNET_MESH_TunnelDisconnectHandler disconnect_handler, |
288 | void *handler_cls); | 294 | void *handler_cls); |