diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-07-09 15:39:23 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-07-09 15:39:23 +0000 |
commit | cb6a3ffd26cad8cda2c2b47eea54621dfff025e2 (patch) | |
tree | 62219fd4fcb4cf067e456a149486f30cd756cd95 /src/transport/plugin_transport_http_server.c | |
parent | c8a965baf8d65b79d03570c05bcc962fae8239c6 (diff) | |
download | gnunet-cb6a3ffd26cad8cda2c2b47eea54621dfff025e2.tar.gz gnunet-cb6a3ffd26cad8cda2c2b47eea54621dfff025e2.zip |
get function implementation in all plugins
Diffstat (limited to 'src/transport/plugin_transport_http_server.c')
-rw-r--r-- | src/transport/plugin_transport_http_server.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index b7967296f..dfa3a4998 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c | |||
@@ -3004,6 +3004,20 @@ const char *http_plugin_address_to_string (void *cls, | |||
3004 | return http_common_plugin_address_to_string (cls, p->protocol, addr, addrlen); | 3004 | return http_common_plugin_address_to_string (cls, p->protocol, addr, addrlen); |
3005 | } | 3005 | } |
3006 | 3006 | ||
3007 | /** | ||
3008 | * Function obtain the network type for a session | ||
3009 | * | ||
3010 | * @param cls closure ('struct Plugin*') | ||
3011 | * @param session the session | ||
3012 | * @return the network type in HBO or GNUNET_SYSERR | ||
3013 | */ | ||
3014 | int http_server_get_network (void *cls, | ||
3015 | void *session) | ||
3016 | { | ||
3017 | struct Session *s = (struct Session *) session; | ||
3018 | GNUNET_assert (NULL != s); | ||
3019 | return ntohl(s->ats_address_network_type); | ||
3020 | } | ||
3007 | 3021 | ||
3008 | /** | 3022 | /** |
3009 | * Entry point for the plugin. | 3023 | * Entry point for the plugin. |
@@ -3044,6 +3058,7 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls) | |||
3044 | api->address_to_string = &http_plugin_address_to_string; | 3058 | api->address_to_string = &http_plugin_address_to_string; |
3045 | api->string_to_address = &http_common_plugin_string_to_address; | 3059 | api->string_to_address = &http_common_plugin_string_to_address; |
3046 | api->address_pretty_printer = &http_common_plugin_address_pretty_printer; | 3060 | api->address_pretty_printer = &http_common_plugin_address_pretty_printer; |
3061 | api->get_network = &http_server_get_network; | ||
3047 | 3062 | ||
3048 | #if BUILD_HTTPS | 3063 | #if BUILD_HTTPS |
3049 | plugin->name = "transport-https_server"; | 3064 | plugin->name = "transport-https_server"; |