aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_http_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/plugin_transport_http_common.c')
-rw-r--r--src/transport/plugin_transport_http_common.c99
1 files changed, 99 insertions, 0 deletions
diff --git a/src/transport/plugin_transport_http_common.c b/src/transport/plugin_transport_http_common.c
new file mode 100644
index 000000000..b1bf7b0de
--- /dev/null
+++ b/src/transport/plugin_transport_http_common.c
@@ -0,0 +1,99 @@
1/*
2 This file is part of GNUnet
3 (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 3, 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 transport/plugin_transport_http_common.c
23 * @brief functionality shared by http client and server transport service plugin
24 * @author Matthias Wachs
25 */
26
27#include "platform.h"
28#include "gnunet_common.h"
29#include "gnunet_transport_plugin.h"
30
31/**
32 * Convert the transports address to a nice, human-readable
33 * format.
34 *
35 * @param cls closure
36 * @param type name of the transport that generated the address
37 * @param addr one of the addresses of the host, NULL for the last address
38 * the specific address format depends on the transport
39 * @param addrlen length of the address
40 * @param numeric should (IP) addresses be displayed in numeric form?
41 * @param timeout after how long should we give up?
42 * @param asc function to call on each string
43 * @param asc_cls closure for asc
44 */
45void
46http_common_plugin_address_pretty_printer (void *cls, const char *type,
47 const void *addr, size_t addrlen,
48 int numeric,
49 struct GNUNET_TIME_Relative timeout,
50 GNUNET_TRANSPORT_AddressStringCallback
51 asc, void *asc_cls)
52{
53 GNUNET_break (0);
54 asc (asc_cls, NULL);
55}
56
57
58/**
59 * Function called for a quick conversion of the binary address to
60 * a numeric address. Note that the caller must not free the
61 * address and that the next call to this function is allowed
62 * to override the address again.
63 *
64 * @param cls closure
65 * @param addr binary address
66 * @param addrlen length of the address
67 * @return string representing the same address
68 */
69const char *
70http_common_plugin_address_to_string (void *cls, const void *addr, size_t addrlen)
71{
72 GNUNET_break (0);
73 return NULL;
74}
75
76/**
77 * Function called to convert a string address to
78 * a binary address.
79 *
80 * @param cls closure ('struct Plugin*')
81 * @param addr string address
82 * @param addrlen length of the address
83 * @param buf location to store the buffer
84 * If the function returns GNUNET_SYSERR, its contents are undefined.
85 * @param added length of created address
86 * @return GNUNET_OK on success, GNUNET_SYSERR on failure
87 */
88int
89http_common_plugin_string_to_address (void *cls,
90 const char *addr,
91 uint16_t addrlen,
92 void **buf,
93 size_t *added)
94{
95 GNUNET_break (0);
96 return GNUNET_SYSERR;
97}
98
99/* end of plugin_transport_http_common.c */