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_client.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_client.c')
-rw-r--r-- | src/transport/plugin_transport_http_client.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c index e06c41b3b..7c3cebee3 100644 --- a/src/transport/plugin_transport_http_client.c +++ b/src/transport/plugin_transport_http_client.c | |||
@@ -1437,6 +1437,21 @@ client_connect (struct Session *s) | |||
1437 | return res; | 1437 | return res; |
1438 | } | 1438 | } |
1439 | 1439 | ||
1440 | /** | ||
1441 | * Function obtain the network type for a session | ||
1442 | * | ||
1443 | * @param cls closure ('struct Plugin*') | ||
1444 | * @param session the session | ||
1445 | * @return the network type in HBO or GNUNET_SYSERR | ||
1446 | */ | ||
1447 | int http_client_get_network (void *cls, | ||
1448 | void *session) | ||
1449 | { | ||
1450 | struct Session *s = (struct Session *) session; | ||
1451 | GNUNET_assert (NULL != s); | ||
1452 | return ntohl(s->ats_address_network_type); | ||
1453 | } | ||
1454 | |||
1440 | 1455 | ||
1441 | /** | 1456 | /** |
1442 | * Creates a new outbound session the transport service will use to send data to the | 1457 | * Creates a new outbound session the transport service will use to send data to the |
@@ -1786,7 +1801,7 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls) | |||
1786 | api->address_to_string = &http_plugin_address_to_string; | 1801 | api->address_to_string = &http_plugin_address_to_string; |
1787 | api->string_to_address = &http_common_plugin_string_to_address; | 1802 | api->string_to_address = &http_common_plugin_string_to_address; |
1788 | api->address_pretty_printer = &http_common_plugin_address_pretty_printer; | 1803 | api->address_pretty_printer = &http_common_plugin_address_pretty_printer; |
1789 | 1804 | api->get_network = &http_client_get_network; | |
1790 | 1805 | ||
1791 | #if BUILD_HTTPS | 1806 | #if BUILD_HTTPS |
1792 | plugin->name = "transport-https_client"; | 1807 | plugin->name = "transport-https_client"; |