diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-08-22 14:49:12 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-08-22 14:49:12 +0000 |
commit | 6da21d2895d0de9373525b731c43beb184ce6eb1 (patch) | |
tree | b11aaab21135bbe4b8ec08862a87f118b23c3502 /src/transport/plugin_transport_http_common.h | |
parent | 3d66c5660bd67adafa44b98d1ffa66a3b1b2f105 (diff) | |
download | gnunet-6da21d2895d0de9373525b731c43beb184ce6eb1.tar.gz gnunet-6da21d2895d0de9373525b731c43beb184ce6eb1.zip |
changes
Diffstat (limited to 'src/transport/plugin_transport_http_common.h')
-rw-r--r-- | src/transport/plugin_transport_http_common.h | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/src/transport/plugin_transport_http_common.h b/src/transport/plugin_transport_http_common.h index b29801d24..ff2fcc41f 100644 --- a/src/transport/plugin_transport_http_common.h +++ b/src/transport/plugin_transport_http_common.h | |||
@@ -27,6 +27,21 @@ | |||
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "gnunet_common.h" | 28 | #include "gnunet_common.h" |
29 | 29 | ||
30 | #if 0 | ||
31 | GNUNET_NETWORK_STRUCT_BEGIN | ||
32 | /** | ||
33 | * HTTP addresses including a full URI | ||
34 | */ | ||
35 | struct HttpAddress | ||
36 | { | ||
37 | /** | ||
38 | * Address following | ||
39 | */ | ||
40 | char *address GNUNET_PACKED; | ||
41 | }; | ||
42 | GNUNET_NETWORK_STRUCT_END | ||
43 | #endif | ||
44 | |||
30 | /** | 45 | /** |
31 | * Convert the transports address to a nice, human-readable | 46 | * Convert the transports address to a nice, human-readable |
32 | * format. | 47 | * format. |
@@ -61,7 +76,9 @@ http_common_plugin_address_pretty_printer (void *cls, const char *type, | |||
61 | * @return string representing the same address | 76 | * @return string representing the same address |
62 | */ | 77 | */ |
63 | const char * | 78 | const char * |
64 | http_common_plugin_address_to_string (void *cls, const void *addr, size_t addrlen); | 79 | http_common_plugin_address_to_string (void *cls, |
80 | const void *addr, | ||
81 | size_t addrlen); | ||
65 | 82 | ||
66 | /** | 83 | /** |
67 | * Function called to convert a string address to | 84 | * Function called to convert a string address to |
@@ -82,4 +99,39 @@ http_common_plugin_string_to_address (void *cls, | |||
82 | void **buf, | 99 | void **buf, |
83 | size_t *added); | 100 | size_t *added); |
84 | 101 | ||
102 | |||
103 | /** | ||
104 | * Create a HTTP address from a socketaddr | ||
105 | * | ||
106 | * @param protocol protocol | ||
107 | * @param addr sockaddr * address | ||
108 | * @param addrlen length of the address | ||
109 | * @return the string | ||
110 | */ | ||
111 | char * | ||
112 | http_common_address_from_socket (const char *protocol, | ||
113 | const struct sockaddr *addr, | ||
114 | socklen_t addrlen); | ||
115 | |||
116 | /** | ||
117 | * Get the length of an address | ||
118 | * | ||
119 | * @param addr address | ||
120 | * @return the size | ||
121 | */ | ||
122 | size_t | ||
123 | http_common_address_get_size (void *addr); | ||
124 | |||
125 | |||
126 | /** | ||
127 | * Compare addr1 to addr2 | ||
128 | * | ||
129 | * @param addr1 address1 | ||
130 | * @param addrlen1 address 1 length | ||
131 | * @param addr2 address2 | ||
132 | * @param addrlen2 address 2 length | ||
133 | * @return GNUNET_YES if equal, GNUNET_NO else | ||
134 | */ | ||
135 | size_t | ||
136 | http_common_cmp_addresses (void *addr1, size_t addrlen1, void *addr2, size_t addrlen2); | ||
85 | /* end of plugin_transport_http_common.c */ | 137 | /* end of plugin_transport_http_common.c */ |