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_udp.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_udp.c')
-rw-r--r-- | src/transport/plugin_transport_udp.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index 5707415a8..565573081 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -1427,6 +1427,20 @@ session_cmp_it (void *cls, | |||
1427 | return GNUNET_YES; | 1427 | return GNUNET_YES; |
1428 | } | 1428 | } |
1429 | 1429 | ||
1430 | /** | ||
1431 | * Function obtain the network type for a session | ||
1432 | * | ||
1433 | * @param cls closure ('struct Plugin*') | ||
1434 | * @param session the session | ||
1435 | * @return the network type in HBO or GNUNET_SYSERR | ||
1436 | */ | ||
1437 | int udp_get_network (void *cls, | ||
1438 | void *session) | ||
1439 | { | ||
1440 | struct Session *s = (struct Session *) session; | ||
1441 | |||
1442 | return ntohl(s->ats.value); | ||
1443 | } | ||
1430 | 1444 | ||
1431 | /** | 1445 | /** |
1432 | * Creates a new outbound session the transport service will use to send data to the | 1446 | * Creates a new outbound session the transport service will use to send data to the |
@@ -2967,6 +2981,7 @@ libgnunet_plugin_transport_udp_init (void *cls) | |||
2967 | api->check_address = &udp_plugin_check_address; | 2981 | api->check_address = &udp_plugin_check_address; |
2968 | api->get_session = &udp_plugin_get_session; | 2982 | api->get_session = &udp_plugin_get_session; |
2969 | api->send = &udp_plugin_send; | 2983 | api->send = &udp_plugin_send; |
2984 | api->get_network = &udp_get_network; | ||
2970 | 2985 | ||
2971 | return api; | 2986 | return api; |
2972 | } | 2987 | } |