diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-06-27 15:02:11 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-06-27 15:02:11 +0000 |
commit | e7e99d8571ea6f90626a41fdea321e19d6426578 (patch) | |
tree | de68652672d48408991509be4cb15613e8b0e1b9 /src/transport/plugin_transport_http_common.h | |
parent | 67ba272f86ae7aed754aeb94ba2aa19477a4e9e4 (diff) | |
download | gnunet-e7e99d8571ea6f90626a41fdea321e19d6426578.tar.gz gnunet-e7e99d8571ea6f90626a41fdea321e19d6426578.zip |
Implementing bug 0002910
- extended plugin to contain option field in addresses
Implementing bug 0002677
- adding ssl verification for external hostname having
- the server send the HTTP_OPTIONS_VERIFY_CERTIFICATE option
- client use this option to enable ssl verification
Diffstat (limited to 'src/transport/plugin_transport_http_common.h')
-rw-r--r-- | src/transport/plugin_transport_http_common.h | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/src/transport/plugin_transport_http_common.h b/src/transport/plugin_transport_http_common.h index 31676c284..528f50243 100644 --- a/src/transport/plugin_transport_http_common.h +++ b/src/transport/plugin_transport_http_common.h | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "gnunet_common.h" | 28 | #include "gnunet_common.h" |
29 | #include "gnunet_transport_plugin.h" | 29 | #include "gnunet_transport_plugin.h" |
30 | |||
30 | /** | 31 | /** |
31 | * Timeout values for testing | 32 | * Timeout values for testing |
32 | */ | 33 | */ |
@@ -53,6 +54,33 @@ | |||
53 | #define HTTP_DEFAULT_PORT 80 | 54 | #define HTTP_DEFAULT_PORT 80 |
54 | #define HTTPS_DEFAULT_PORT 443 | 55 | #define HTTPS_DEFAULT_PORT 443 |
55 | 56 | ||
57 | enum HTTP_OPTIONS | ||
58 | { | ||
59 | HTTP_OPTIONS_NONE = 0, | ||
60 | HTTP_OPTIONS_VERIFY_CERTIFICATE = 1 | ||
61 | }; | ||
62 | |||
63 | |||
64 | GNUNET_NETWORK_STRUCT_BEGIN | ||
65 | |||
66 | /** | ||
67 | * HttpAddress | ||
68 | */ | ||
69 | struct HttpAddress | ||
70 | { | ||
71 | /** | ||
72 | * Address options | ||
73 | */ | ||
74 | uint32_t options; | ||
75 | |||
76 | /** | ||
77 | * Length of URL located after struct | ||
78 | * | ||
79 | */ | ||
80 | uint32_t urlen; | ||
81 | }; | ||
82 | |||
83 | GNUNET_NETWORK_STRUCT_END | ||
56 | 84 | ||
57 | struct SplittedHTTPAddress; | 85 | struct SplittedHTTPAddress; |
58 | 86 | ||
@@ -94,6 +122,7 @@ http_common_plugin_address_pretty_printer (void *cls, const char *type, | |||
94 | */ | 122 | */ |
95 | const char * | 123 | const char * |
96 | http_common_plugin_address_to_string (void *cls, | 124 | http_common_plugin_address_to_string (void *cls, |
125 | char *plugin, | ||
97 | const void *addr, | 126 | const void *addr, |
98 | size_t addrlen); | 127 | size_t addrlen); |
99 | 128 | ||
@@ -125,10 +154,10 @@ http_common_plugin_string_to_address (void *cls, | |||
125 | * @param addrlen length of the address | 154 | * @param addrlen length of the address |
126 | * @return the string | 155 | * @return the string |
127 | */ | 156 | */ |
128 | char * | 157 | struct HttpAddress * |
129 | http_common_address_from_socket (const char *protocol, | 158 | http_common_address_from_socket (const char *protocol, |
130 | const struct sockaddr *addr, | 159 | const struct sockaddr *addr, |
131 | socklen_t addrlen); | 160 | socklen_t addrlen); |
132 | 161 | ||
133 | /** | 162 | /** |
134 | * Create a socketaddr from a HTTP address | 163 | * Create a socketaddr from a HTTP address |
@@ -144,6 +173,9 @@ http_common_address_from_socket (const char *protocol, | |||
144 | struct sockaddr * | 173 | struct sockaddr * |
145 | http_common_socket_from_address (const void *addr, size_t addrlen, int *res); | 174 | http_common_socket_from_address (const void *addr, size_t addrlen, int *res); |
146 | 175 | ||
176 | const char * | ||
177 | http_common_plugin_address_to_url (void *cls, const void *addr, size_t addrlen); | ||
178 | |||
147 | /** | 179 | /** |
148 | * Get the length of an address | 180 | * Get the length of an address |
149 | * | 181 | * |
@@ -151,7 +183,7 @@ http_common_socket_from_address (const void *addr, size_t addrlen, int *res); | |||
151 | * @return the size | 183 | * @return the size |
152 | */ | 184 | */ |
153 | size_t | 185 | size_t |
154 | http_common_address_get_size (const void *addr); | 186 | http_common_address_get_size (const struct HttpAddress * addr); |
155 | 187 | ||
156 | 188 | ||
157 | /** | 189 | /** |