aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo-tool
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-11-08 23:20:42 +0000
committerChristian Grothoff <christian@grothoff.org>2011-11-08 23:20:42 +0000
commita983a0267109b1b6a8e16e476e2f2956a8771b94 (patch)
tree79bcae73cdb7b87b4f55d4396e79baea76ef53a6 /src/peerinfo-tool
parenta3f8ef5b89dc44fc3acfb8f081a502f3409e4224 (diff)
downloadgnunet-a983a0267109b1b6a8e16e476e2f2956a8771b94.tar.gz
gnunet-a983a0267109b1b6a8e16e476e2f2956a8771b94.zip
refactoring how we handle peer addresses in peerinfo/ats/transport/hello subsystems -- use a struct instead of 3--4 arguments
Diffstat (limited to 'src/peerinfo-tool')
-rw-r--r--src/peerinfo-tool/gnunet-peerinfo.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c
index 00ab22993..e40615a9b 100644
--- a/src/peerinfo-tool/gnunet-peerinfo.c
+++ b/src/peerinfo-tool/gnunet-peerinfo.c
@@ -96,16 +96,14 @@ process_resolved_address (void *cls, const char *address)
96 * Iterator callback to go over all addresses. 96 * Iterator callback to go over all addresses.
97 * 97 *
98 * @param cls closure 98 * @param cls closure
99 * @param tname name of the transport 99 * @param address the address
100 * @param expiration expiration time 100 * @param expiration expiration time
101 * @param addr the address
102 * @param addrlen length of the address
103 * @return GNUNET_OK to keep the address and continue 101 * @return GNUNET_OK to keep the address and continue
104 */ 102 */
105static int 103static int
106count_address (void *cls, const char *tname, 104count_address (void *cls,
107 struct GNUNET_TIME_Absolute expiration, const void *addr, 105 const struct GNUNET_HELLO_Address *address,
108 uint16_t addrlen) 106 struct GNUNET_TIME_Absolute expiration)
109{ 107{
110 struct PrintContext *pc = cls; 108 struct PrintContext *pc = cls;
111 109
@@ -118,20 +116,21 @@ count_address (void *cls, const char *tname,
118 * Iterator callback to go over all addresses. 116 * Iterator callback to go over all addresses.
119 * 117 *
120 * @param cls closure 118 * @param cls closure
121 * @param tname name of the transport 119 * @param address the address
122 * @param expiration expiration time 120 * @param expiration expiration time
123 * @param addr the address
124 * @param addrlen length of the address
125 * @return GNUNET_OK to keep the address and continue 121 * @return GNUNET_OK to keep the address and continue
126 */ 122 */
127static int 123static int
128print_address (void *cls, const char *tname, 124print_address (void *cls,
129 struct GNUNET_TIME_Absolute expiration, const void *addr, 125 const struct GNUNET_HELLO_Address *address,
130 uint16_t addrlen) 126 struct GNUNET_TIME_Absolute expiration)
131{ 127{
132 struct PrintContext *pc = cls; 128 struct PrintContext *pc = cls;
133 129
134 GNUNET_TRANSPORT_address_lookup (cfg, addr, addrlen, no_resolve, tname, 130 GNUNET_TRANSPORT_address_lookup (cfg,
131 address->address,
132 address->address_length, no_resolve,
133 address->transport_name,
135 GNUNET_TIME_relative_multiply 134 GNUNET_TIME_relative_multiply
136 (GNUNET_TIME_UNIT_SECONDS, 10), 135 (GNUNET_TIME_UNIT_SECONDS, 10),
137 &process_resolved_address, pc); 136 &process_resolved_address, pc);