aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-01-19 13:23:04 +0000
committerNathan S. Evans <evans@in.tum.de>2010-01-19 13:23:04 +0000
commit71c69f178dd8ad00e917c8724c4f2417f8d9648f (patch)
treef2d68f75774acfc311f26b2a657dedc3be3e3ece /src/include
parent691f0bfb0a1cbd2a862c4707c40b35aba13c92f1 (diff)
downloadgnunet-71c69f178dd8ad00e917c8724c4f2417f8d9648f.tar.gz
gnunet-71c69f178dd8ad00e917c8724c4f2417f8d9648f.zip
moderate udp support, not really tested (:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_network_lib.h26
-rw-r--r--src/include/gnunet_protocols.h9
-rw-r--r--src/include/gnunet_scheduler_lib.h4
3 files changed, 37 insertions, 2 deletions
diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h
index 513787e08..71c8d4346 100644
--- a/src/include/gnunet_network_lib.h
+++ b/src/include/gnunet_network_lib.h
@@ -124,6 +124,27 @@ int GNUNET_NETWORK_socket_getsockopt(const struct GNUNET_NETWORK_Handle *desc, i
124int GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc, int backlog); 124int GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc, int backlog);
125 125
126/** 126/**
127 * How much data is available to be read on this descriptor?
128 * @param desc socket
129 */
130unsigned int
131GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle * desc);
132
133/**
134 * Read data from a connected socket (always non-blocking).
135 * @param desc socket
136 * @param buffer buffer
137 * @param length length of buffer
138 * @param src_addr either the source to recv from, or all zeroes
139 * to be filled in by recvfrom
140 * @param addrlen length of the addr
141 */
142ssize_t
143GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle * desc,
144 void *buffer, size_t length,
145 struct sockaddr *src_addr, socklen_t *addrlen);
146
147/**
127 * Read data from a connected socket (always non-blocking). 148 * Read data from a connected socket (always non-blocking).
128 * 149 *
129 * @param desc socket 150 * @param desc socket
@@ -248,6 +269,11 @@ void GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst,
248void GNUNET_NETWORK_fdset_copy(struct GNUNET_NETWORK_FDSet *to, 269void GNUNET_NETWORK_fdset_copy(struct GNUNET_NETWORK_FDSet *to,
249 const struct GNUNET_NETWORK_FDSet *from); 270 const struct GNUNET_NETWORK_FDSet *from);
250 271
272/*
273 * Return file descriptor for this network handle
274 */
275int
276GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc);
251/** 277/**
252 * Copy a native fd set 278 * Copy a native fd set
253 * @param to destination 279 * @param to destination
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h
index 51442958c..cdf5d0df3 100644
--- a/src/include/gnunet_protocols.h
+++ b/src/include/gnunet_protocols.h
@@ -242,6 +242,15 @@ extern "C"
242 */ 242 */
243#define GNUNET_MESSAGE_TYPE_TRANSPORT_TCP_DATA 43 243#define GNUNET_MESSAGE_TYPE_TRANSPORT_TCP_DATA 43
244 244
245/*
246 * UDP Ping message
247 */
248#define GNUNET_MESSAGE_TYPE_TRANSPORT_UDP_PING 51
249
250/*
251 * UDP Pong message
252 */
253#define GNUNET_MESSAGE_TYPE_TRANSPORT_UDP_PONG 52
245 254
246/** 255/**
247 * Initial setup message from core client to core. 256 * Initial setup message from core client to core.
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h
index 9ba4399ad..3205729a3 100644
--- a/src/include/gnunet_scheduler_lib.h
+++ b/src/include/gnunet_scheduler_lib.h
@@ -290,7 +290,7 @@ GNUNET_SCHEDULER_add_continuation (struct GNUNET_SCHEDULER_Handle *sched,
290 * @param sched scheduler to use 290 * @param sched scheduler to use
291 * @param prerequisite_task run this task after the task with the given 291 * @param prerequisite_task run this task after the task with the given
292 * task identifier completes (and any of our other 292 * task identifier completes (and any of our other
293 * conditions, such as delay, read or write-readyness 293 * conditions, such as delay, read or write-readiness
294 * are satisfied). Use GNUNET_SCHEDULER_NO_TASK to not have any dependency 294 * are satisfied). Use GNUNET_SCHEDULER_NO_TASK to not have any dependency
295 * on completion of other tasks (this will cause the task to run as 295 * on completion of other tasks (this will cause the task to run as
296 * soon as possible). 296 * soon as possible).
@@ -480,7 +480,7 @@ GNUNET_SCHEDULER_add_write_file (struct GNUNET_SCHEDULER_Handle *sched,
480 * @param prio how important is this task? 480 * @param prio how important is this task?
481 * @param prerequisite_task run this task after the task with the given 481 * @param prerequisite_task run this task after the task with the given
482 * task identifier completes (and any of our other 482 * task identifier completes (and any of our other
483 * conditions, such as delay, read or write-readyness 483 * conditions, such as delay, read or write-readiness
484 * are satisfied). Use GNUNET_SCHEDULER_NO_TASK to not have any dependency 484 * are satisfied). Use GNUNET_SCHEDULER_NO_TASK to not have any dependency
485 * on completion of other tasks. 485 * on completion of other tasks.
486 * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever", 486 * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever",