aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_udp.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-11-23 17:19:53 +0100
committerChristian Grothoff <christian@grothoff.org>2018-11-23 17:19:53 +0100
commit61787bfa37e0ac5998e01d9c4806600033c19c74 (patch)
tree1ceb843f63aa076682ebfa2de2250dc32ee65004 /src/transport/plugin_transport_udp.c
parent4a3be482811fe8ed1502fea2c12a8449b560a99e (diff)
downloadgnunet-61787bfa37e0ac5998e01d9c4806600033c19c74.tar.gz
gnunet-61787bfa37e0ac5998e01d9c4806600033c19c74.zip
rename fest: use new libgnunetnt instead of old libgnunetats logic for network type classification
Diffstat (limited to 'src/transport/plugin_transport_udp.c')
-rw-r--r--src/transport/plugin_transport_udp.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c
index abbcca2ae..9fed9b429 100644
--- a/src/transport/plugin_transport_udp.c
+++ b/src/transport/plugin_transport_udp.c
@@ -234,7 +234,7 @@ struct GNUNET_ATS_Session
234 /** 234 /**
235 * Network type of the address. 235 * Network type of the address.
236 */ 236 */
237 enum GNUNET_ATS_Network_Type scope; 237 enum GNUNET_NetworkType scope;
238 238
239 /** 239 /**
240 * Is this session about to be destroyed (sometimes we cannot 240 * Is this session about to be destroyed (sometimes we cannot
@@ -290,7 +290,7 @@ struct DefragContext
290 /** 290 /**
291 * Network type the address belongs to. 291 * Network type the address belongs to.
292 */ 292 */
293 enum GNUNET_ATS_Network_Type network_type; 293 enum GNUNET_NetworkType network_type;
294 294
295 /** 295 /**
296 * Has the @e sender field been initialized yet? 296 * Has the @e sender field been initialized yet?
@@ -660,7 +660,7 @@ udp_query_keepalive_factor (void *cls)
660 * @param session the session 660 * @param session the session
661 * @return the network type 661 * @return the network type
662 */ 662 */
663static enum GNUNET_ATS_Network_Type 663static enum GNUNET_NetworkType
664udp_plugin_get_network (void *cls, 664udp_plugin_get_network (void *cls,
665 struct GNUNET_ATS_Session *session) 665 struct GNUNET_ATS_Session *session)
666{ 666{
@@ -675,7 +675,7 @@ udp_plugin_get_network (void *cls,
675 * @param address the address 675 * @param address the address
676 * @return the network type 676 * @return the network type
677 */ 677 */
678static enum GNUNET_ATS_Network_Type 678static enum GNUNET_NetworkType
679udp_plugin_get_network_for_address (void *cls, 679udp_plugin_get_network_for_address (void *cls,
680 const struct GNUNET_HELLO_Address *address) 680 const struct GNUNET_HELLO_Address *address)
681{ 681{
@@ -720,7 +720,7 @@ udp_plugin_get_network_for_address (void *cls,
720 else 720 else
721 { 721 {
722 GNUNET_break (0); 722 GNUNET_break (0);
723 return GNUNET_ATS_NET_UNSPECIFIED; 723 return GNUNET_NT_UNSPECIFIED;
724 } 724 }
725 return plugin->env->get_address_type (plugin->env->cls, 725 return plugin->env->get_address_type (plugin->env->cls,
726 sb, 726 sb,
@@ -2627,7 +2627,7 @@ session_timeout (void *cls)
2627static struct GNUNET_ATS_Session * 2627static struct GNUNET_ATS_Session *
2628udp_plugin_create_session (void *cls, 2628udp_plugin_create_session (void *cls,
2629 const struct GNUNET_HELLO_Address *address, 2629 const struct GNUNET_HELLO_Address *address,
2630 enum GNUNET_ATS_Network_Type network_type) 2630 enum GNUNET_NetworkType network_type)
2631{ 2631{
2632 struct Plugin *plugin = cls; 2632 struct Plugin *plugin = cls;
2633 struct GNUNET_ATS_Session *s; 2633 struct GNUNET_ATS_Session *s;
@@ -2687,7 +2687,7 @@ udp_plugin_get_session (void *cls,
2687{ 2687{
2688 struct Plugin *plugin = cls; 2688 struct Plugin *plugin = cls;
2689 struct GNUNET_ATS_Session *s; 2689 struct GNUNET_ATS_Session *s;
2690 enum GNUNET_ATS_Network_Type network_type = GNUNET_ATS_NET_UNSPECIFIED; 2690 enum GNUNET_NetworkType network_type = GNUNET_NT_UNSPECIFIED;
2691 const struct IPv4UdpAddress *udp_v4; 2691 const struct IPv4UdpAddress *udp_v4;
2692 const struct IPv6UdpAddress *udp_v6; 2692 const struct IPv6UdpAddress *udp_v6;
2693 2693
@@ -2739,7 +2739,7 @@ udp_plugin_get_session (void *cls,
2739 (const struct sockaddr *) &v6, 2739 (const struct sockaddr *) &v6,
2740 sizeof (v6)); 2740 sizeof (v6));
2741 } 2741 }
2742 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != network_type); 2742 GNUNET_break (GNUNET_NT_UNSPECIFIED != network_type);
2743 return udp_plugin_create_session (cls, 2743 return udp_plugin_create_session (cls,
2744 address, 2744 address,
2745 network_type); 2745 network_type);
@@ -2760,12 +2760,12 @@ process_udp_message (struct Plugin *plugin,
2760 const struct UDPMessage *msg, 2760 const struct UDPMessage *msg,
2761 const union UdpAddress *udp_addr, 2761 const union UdpAddress *udp_addr,
2762 size_t udp_addr_len, 2762 size_t udp_addr_len,
2763 enum GNUNET_ATS_Network_Type network_type) 2763 enum GNUNET_NetworkType network_type)
2764{ 2764{
2765 struct GNUNET_ATS_Session *s; 2765 struct GNUNET_ATS_Session *s;
2766 struct GNUNET_HELLO_Address *address; 2766 struct GNUNET_HELLO_Address *address;
2767 2767
2768 GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != network_type); 2768 GNUNET_break (GNUNET_NT_UNSPECIFIED != network_type);
2769 if (0 != ntohl (msg->reserved)) 2769 if (0 != ntohl (msg->reserved))
2770 { 2770 {
2771 GNUNET_break_op(0); 2771 GNUNET_break_op(0);
@@ -2992,7 +2992,7 @@ read_process_fragment (struct Plugin *plugin,
2992 const struct GNUNET_MessageHeader *msg, 2992 const struct GNUNET_MessageHeader *msg,
2993 const union UdpAddress *udp_addr, 2993 const union UdpAddress *udp_addr,
2994 size_t udp_addr_len, 2994 size_t udp_addr_len,
2995 enum GNUNET_ATS_Network_Type network_type) 2995 enum GNUNET_NetworkType network_type)
2996{ 2996{
2997 struct DefragContext *d_ctx; 2997 struct DefragContext *d_ctx;
2998 struct GNUNET_TIME_Absolute now; 2998 struct GNUNET_TIME_Absolute now;
@@ -3092,7 +3092,7 @@ udp_select_read (struct Plugin *plugin,
3092 const struct sockaddr_in6 *sa6; 3092 const struct sockaddr_in6 *sa6;
3093 const union UdpAddress *int_addr; 3093 const union UdpAddress *int_addr;
3094 size_t int_addr_len; 3094 size_t int_addr_len;
3095 enum GNUNET_ATS_Network_Type network_type; 3095 enum GNUNET_NetworkType network_type;
3096 3096
3097 fromlen = sizeof (addr); 3097 fromlen = sizeof (addr);
3098 memset (&addr, 3098 memset (&addr,
@@ -3345,13 +3345,13 @@ analyze_send_error (struct Plugin *plugin,
3345 socklen_t slen, 3345 socklen_t slen,
3346 int error) 3346 int error)
3347{ 3347{
3348 enum GNUNET_ATS_Network_Type type; 3348 enum GNUNET_NetworkType type;
3349 3349
3350 type = plugin->env->get_address_type (plugin->env->cls, 3350 type = plugin->env->get_address_type (plugin->env->cls,
3351 sa, 3351 sa,
3352 slen); 3352 slen);
3353 if ( ( (GNUNET_ATS_NET_LAN == type) || 3353 if ( ( (GNUNET_NT_LAN == type) ||
3354 (GNUNET_ATS_NET_WAN == type) ) && 3354 (GNUNET_NT_WAN == type) ) &&
3355 ( (ENETUNREACH == errno) || 3355 ( (ENETUNREACH == errno) ||
3356 (ENETDOWN == errno) ) ) 3356 (ENETDOWN == errno) ) )
3357 { 3357 {