aboutsummaryrefslogtreecommitdiff
path: root/src/transport/transport_api_address_to_string.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-11-29 15:43:11 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-11-29 15:43:11 +0000
commit0c3e3371bcc2dad9c4f14561068a1752f01b1756 (patch)
tree6aa926c5f1ad962594f6c9ad9b238500ad644702 /src/transport/transport_api_address_to_string.c
parentfd2601f3fce6eefbb7e0f9aaca61f9169b25d3f4 (diff)
downloadgnunet-0c3e3371bcc2dad9c4f14561068a1752f01b1756.tar.gz
gnunet-0c3e3371bcc2dad9c4f14561068a1752f01b1756.zip
- latest changes for refactoring: iterate sends disassembled hello-address
Diffstat (limited to 'src/transport/transport_api_address_to_string.c')
-rw-r--r--src/transport/transport_api_address_to_string.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/transport/transport_api_address_to_string.c b/src/transport/transport_api_address_to_string.c
index 259c77152..2e5a34ce2 100644
--- a/src/transport/transport_api_address_to_string.c
+++ b/src/transport/transport_api_address_to_string.c
@@ -76,7 +76,7 @@ address_response_processor (void *cls, const struct GNUNET_MessageHeader *msg)
76 return; 76 return;
77 } 77 }
78 GNUNET_break (ntohs (msg->type) == 78 GNUNET_break (ntohs (msg->type) ==
79 GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_REPLY); 79 GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_ITERATE_RESPONSE);
80 size = ntohs (msg->size); 80 size = ntohs (msg->size);
81 if (size == sizeof (struct GNUNET_MessageHeader)) 81 if (size == sizeof (struct GNUNET_MessageHeader))
82 { 82 {
@@ -108,10 +108,8 @@ address_response_processor (void *cls, const struct GNUNET_MessageHeader *msg)
108 * 108 *
109 * @param cfg configuration to use 109 * @param cfg configuration to use
110 * @param address address to convert (binary format) 110 * @param address address to convert (binary format)
111 * @param addressLen number of bytes in address
112 * @param numeric should (IP) addresses be displayed in numeric form 111 * @param numeric should (IP) addresses be displayed in numeric form
113 * (otherwise do reverse DNS lookup) 112 * (otherwise do reverse DNS lookup)
114 * @param nameTrans name of the transport to which the address belongs
115 * @param timeout how long is the lookup allowed to take at most 113 * @param timeout how long is the lookup allowed to take at most
116 * @param aluc function to call with the results 114 * @param aluc function to call with the results
117 * @param aluc_cls closure for aluc 115 * @param aluc_cls closure for aluc
@@ -132,6 +130,7 @@ GNUNET_TRANSPORT_address_to_string (const struct GNUNET_CONFIGURATION_Handle *cf
132 struct GNUNET_CLIENT_Connection *client; 130 struct GNUNET_CLIENT_Connection *client;
133 char *addrbuf; 131 char *addrbuf;
134 132
133 GNUNET_assert (address != NULL);
135 alen = GNUNET_HELLO_address_get_size (address); 134 alen = GNUNET_HELLO_address_get_size (address);
136 len = sizeof (struct AddressLookupMessage) + alen; 135 len = sizeof (struct AddressLookupMessage) + alen;
137 if (len >= GNUNET_SERVER_MAX_MESSAGE_SIZE) 136 if (len >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
@@ -139,12 +138,15 @@ GNUNET_TRANSPORT_address_to_string (const struct GNUNET_CONFIGURATION_Handle *cf
139 GNUNET_break (0); 138 GNUNET_break (0);
140 return NULL; 139 return NULL;
141 } 140 }
141
142 client = GNUNET_CLIENT_connect ("transport", cfg); 142 client = GNUNET_CLIENT_connect ("transport", cfg);
143 if (client == NULL) 143 if (client == NULL)
144 return NULL; 144 return NULL;
145 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
146 "GNUNET_TRANSPORT_address_to_string\n");
145 msg = GNUNET_malloc (len); 147 msg = GNUNET_malloc (len);
146 msg->header.size = htons (len); 148 msg->header.size = htons (len);
147 msg->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_LOOKUP); 149 msg->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_TO_STRING);
148 msg->numeric_only = htonl (numeric); 150 msg->numeric_only = htonl (numeric);
149 msg->timeout = GNUNET_TIME_relative_hton (timeout); 151 msg->timeout = GNUNET_TIME_relative_hton (timeout);
150 msg->addrlen = htonl (alen); 152 msg->addrlen = htonl (alen);