diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-07-24 12:58:10 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-07-24 12:58:10 +0000 |
commit | 821e1221afc9f9fd127379865bd2e470232bd918 (patch) | |
tree | 348d3bce4b2766b736159d346f022212ff0f3c67 | |
parent | c057bd312c783e0a2f3783dfd888a66f490b0a30 (diff) | |
download | gnunet-821e1221afc9f9fd127379865bd2e470232bd918.tar.gz gnunet-821e1221afc9f9fd127379865bd2e470232bd918.zip |
fixing documentation
-rw-r--r-- | src/transport/gnunet-transport.c | 119 | ||||
-rw-r--r-- | src/transport/plugin_transport_http_client.c | 16 | ||||
-rw-r--r-- | src/transport/plugin_transport_http_common.c | 10 | ||||
-rw-r--r-- | src/transport/plugin_transport_http_server.c | 22 | ||||
-rw-r--r-- | src/transport/plugin_transport_unix.c | 4 |
5 files changed, 134 insertions, 37 deletions
diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c index 0fef7784e..354060ac8 100644 --- a/src/transport/gnunet-transport.c +++ b/src/transport/gnunet-transport.c | |||
@@ -39,56 +39,148 @@ | |||
39 | * Should match NAT_SERVER_TIMEOUT in 'nat_test.c'. | 39 | * Should match NAT_SERVER_TIMEOUT in 'nat_test.c'. |
40 | */ | 40 | */ |
41 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 20) | 41 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 20) |
42 | |||
43 | /** | ||
44 | * Timeout for a name resolution | ||
45 | */ | ||
42 | #define RESOLUTION_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) | 46 | #define RESOLUTION_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) |
47 | |||
48 | /** | ||
49 | * Timeout for an operations | ||
50 | */ | ||
43 | #define OP_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) | 51 | #define OP_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) |
44 | 52 | ||
45 | 53 | ||
54 | /** | ||
55 | * Context to store name resolutions for valiation | ||
56 | */ | ||
46 | struct ValidationResolutionContext | 57 | struct ValidationResolutionContext |
47 | { | 58 | { |
59 | /** | ||
60 | * Next in DLL | ||
61 | */ | ||
48 | struct ValidationResolutionContext *next; | 62 | struct ValidationResolutionContext *next; |
49 | 63 | ||
64 | /** | ||
65 | * Previous in DLL | ||
66 | */ | ||
50 | struct ValidationResolutionContext *prev; | 67 | struct ValidationResolutionContext *prev; |
51 | 68 | ||
69 | /** | ||
70 | * Peer identity | ||
71 | */ | ||
52 | struct GNUNET_PeerIdentity id; | 72 | struct GNUNET_PeerIdentity id; |
53 | 73 | ||
74 | /** | ||
75 | * Address to resolve | ||
76 | */ | ||
54 | struct GNUNET_HELLO_Address *addrcp; | 77 | struct GNUNET_HELLO_Address *addrcp; |
55 | 78 | ||
79 | /** | ||
80 | * Time of last validation | ||
81 | */ | ||
56 | struct GNUNET_TIME_Absolute last_validation; | 82 | struct GNUNET_TIME_Absolute last_validation; |
57 | 83 | ||
84 | /** | ||
85 | * Address is valid until | ||
86 | */ | ||
58 | struct GNUNET_TIME_Absolute valid_until; | 87 | struct GNUNET_TIME_Absolute valid_until; |
59 | 88 | ||
89 | /** | ||
90 | * Time of next validation | ||
91 | */ | ||
60 | struct GNUNET_TIME_Absolute next_validation; | 92 | struct GNUNET_TIME_Absolute next_validation; |
61 | 93 | ||
94 | /** | ||
95 | * state of validation process | ||
96 | */ | ||
62 | enum GNUNET_TRANSPORT_ValidationState state; | 97 | enum GNUNET_TRANSPORT_ValidationState state; |
63 | 98 | ||
99 | /** | ||
100 | * Tranport conversion handle | ||
101 | */ | ||
64 | struct GNUNET_TRANSPORT_AddressToStringContext *asc; | 102 | struct GNUNET_TRANSPORT_AddressToStringContext *asc; |
65 | 103 | ||
104 | /** | ||
105 | * plugin name | ||
106 | */ | ||
66 | char *transport; | 107 | char *transport; |
67 | 108 | ||
109 | /** | ||
110 | * was the entry printed | ||
111 | */ | ||
68 | int printed; | 112 | int printed; |
69 | }; | 113 | }; |
70 | 114 | ||
71 | 115 | /** | |
116 | * Struct to store information about peers in monitor mode | ||
117 | */ | ||
72 | struct MonitoredPeer | 118 | struct MonitoredPeer |
73 | { | 119 | { |
120 | /** | ||
121 | * State of the peer | ||
122 | */ | ||
74 | enum GNUNET_TRANSPORT_PeerState state; | 123 | enum GNUNET_TRANSPORT_PeerState state; |
75 | 124 | ||
125 | /** | ||
126 | * Timeout | ||
127 | */ | ||
76 | struct GNUNET_TIME_Absolute state_timeout; | 128 | struct GNUNET_TIME_Absolute state_timeout; |
77 | 129 | ||
130 | /** | ||
131 | * The address to convert | ||
132 | */ | ||
78 | struct GNUNET_HELLO_Address *address; | 133 | struct GNUNET_HELLO_Address *address; |
79 | }; | 134 | }; |
80 | 135 | ||
81 | 136 | /** | |
137 | * Context to store name resolutions for valiation | ||
138 | */ | ||
82 | struct PeerResolutionContext | 139 | struct PeerResolutionContext |
83 | { | 140 | { |
141 | /** | ||
142 | * Next in DLL | ||
143 | */ | ||
84 | struct PeerResolutionContext *next; | 144 | struct PeerResolutionContext *next; |
145 | |||
146 | /** | ||
147 | * Prev in DLL | ||
148 | */ | ||
85 | struct PeerResolutionContext *prev; | 149 | struct PeerResolutionContext *prev; |
150 | |||
151 | /** | ||
152 | * The peer id | ||
153 | */ | ||
86 | struct GNUNET_PeerIdentity id; | 154 | struct GNUNET_PeerIdentity id; |
155 | |||
156 | /** | ||
157 | * address to resolve | ||
158 | */ | ||
87 | struct GNUNET_HELLO_Address *addrcp; | 159 | struct GNUNET_HELLO_Address *addrcp; |
160 | |||
161 | /** | ||
162 | * transport conversiion context | ||
163 | */ | ||
88 | struct GNUNET_TRANSPORT_AddressToStringContext *asc; | 164 | struct GNUNET_TRANSPORT_AddressToStringContext *asc; |
165 | |||
166 | /** | ||
167 | * peer state | ||
168 | */ | ||
89 | enum GNUNET_TRANSPORT_PeerState state; | 169 | enum GNUNET_TRANSPORT_PeerState state; |
170 | |||
171 | /** | ||
172 | * state timeout | ||
173 | */ | ||
90 | struct GNUNET_TIME_Absolute state_timeout; | 174 | struct GNUNET_TIME_Absolute state_timeout; |
175 | |||
176 | /** | ||
177 | * transport plugin | ||
178 | */ | ||
91 | char *transport; | 179 | char *transport; |
180 | |||
181 | /** | ||
182 | * was the entry printed | ||
183 | */ | ||
92 | int printed; | 184 | int printed; |
93 | }; | 185 | }; |
94 | 186 | ||
@@ -349,12 +441,24 @@ struct TestContext *head; | |||
349 | */ | 441 | */ |
350 | struct TestContext *tail; | 442 | struct TestContext *tail; |
351 | 443 | ||
444 | /** | ||
445 | * DLL: head of validation resolution entries | ||
446 | */ | ||
352 | static struct ValidationResolutionContext *vc_head; | 447 | static struct ValidationResolutionContext *vc_head; |
353 | 448 | ||
449 | /** | ||
450 | * DLL: tail of validation resolution entries | ||
451 | */ | ||
354 | static struct ValidationResolutionContext *vc_tail; | 452 | static struct ValidationResolutionContext *vc_tail; |
355 | 453 | ||
454 | /** | ||
455 | * DLL: head of resolution entries | ||
456 | */ | ||
356 | static struct PeerResolutionContext *rc_head; | 457 | static struct PeerResolutionContext *rc_head; |
357 | 458 | ||
459 | /** | ||
460 | * DLL: head of resolution entries | ||
461 | */ | ||
358 | static struct PeerResolutionContext *rc_tail; | 462 | static struct PeerResolutionContext *rc_tail; |
359 | 463 | ||
360 | 464 | ||
@@ -596,8 +700,7 @@ display_test_result (struct TestContext *tc, | |||
596 | * Clean up and update GUI. | 700 | * Clean up and update GUI. |
597 | * | 701 | * |
598 | * @param cls test context | 702 | * @param cls test context |
599 | * @param success currently always #GNUNET_OK | 703 | * @param result status code |
600 | * @param emsg error message, NULL on success | ||
601 | */ | 704 | */ |
602 | static void | 705 | static void |
603 | result_callback (void *cls, | 706 | result_callback (void *cls, |
@@ -633,8 +736,8 @@ resolve_validation_address (const struct GNUNET_PeerIdentity *id, | |||
633 | /** | 736 | /** |
634 | * Function to call with a textual representation of an address. This | 737 | * Function to call with a textual representation of an address. This |
635 | * function will be called several times with different possible | 738 | * function will be called several times with different possible |
636 | * textual representations, and a last time with @address being NULL | 739 | * textual representations, and a last time with @a address being NULL |
637 | * to signal the end of the iteration. Note that @address NULL | 740 | * to signal the end of the iteration. Note that @a address NULL |
638 | * always is the last call, regardless of the value in @a res. | 741 | * always is the last call, regardless of the value in @a res. |
639 | * | 742 | * |
640 | * @param cls closure | 743 | * @param cls closure |
@@ -1205,8 +1308,8 @@ print_info (const struct GNUNET_PeerIdentity *id, | |||
1205 | /** | 1308 | /** |
1206 | * Function called with a textual representation of an address. This | 1309 | * Function called with a textual representation of an address. This |
1207 | * function will be called several times with different possible | 1310 | * function will be called several times with different possible |
1208 | * textual representations, and a last time with @address being NULL | 1311 | * textual representations, and a last time with @a address being NULL |
1209 | * to signal the end of the iteration. Note that @address NULL | 1312 | * to signal the end of the iteration. Note that @a address NULL |
1210 | * always is the last call, regardless of the value in @a res. | 1313 | * always is the last call, regardless of the value in @a res. |
1211 | * | 1314 | * |
1212 | * @param cls closure | 1315 | * @param cls closure |
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c index 38b0775f3..615639a6e 100644 --- a/src/transport/plugin_transport_http_client.c +++ b/src/transport/plugin_transport_http_client.c | |||
@@ -2077,18 +2077,12 @@ client_configure_plugin (struct HTTP_Client_Plugin *plugin) | |||
2077 | 2077 | ||
2078 | 2078 | ||
2079 | /** | 2079 | /** |
2080 | * Function called by the pretty printer for the resolved address for | 2080 | * Function to convert an address to a human-readable string. |
2081 | * each human-readable address obtained. The callback can be called | ||
2082 | * several times. The last invocation must be with a @a address of | ||
2083 | * NULL and a @a res of #GNUNET_OK. Thus, to indicate conversion | ||
2084 | * errors, the callback might be called first with @a address NULL and | ||
2085 | * @a res being #GNUNET_SYSERR. In that case, there must still be a | ||
2086 | * subsequent call later with @a address NULL and @a res #GNUNET_OK. | ||
2087 | * | 2081 | * |
2088 | * @param cls closure | 2082 | * @param cls closure |
2089 | * @param address one of the names for the host, NULL on last callback | 2083 | * @param addr address to convert |
2090 | * @param res #GNUNET_OK if conversion was successful, #GNUNET_SYSERR on failure, | 2084 | * @param addrlen address length |
2091 | * #GNUNET_OK on last callback | 2085 | * @return res string if conversion was successful, NULL otherwise |
2092 | */ | 2086 | */ |
2093 | static const char * | 2087 | static const char * |
2094 | http_client_plugin_address_to_string (void *cls, | 2088 | http_client_plugin_address_to_string (void *cls, |
@@ -2126,7 +2120,7 @@ http_client_plugin_update_session_timeout (void *cls, | |||
2126 | * | 2120 | * |
2127 | * @param cls closure | 2121 | * @param cls closure |
2128 | * @param peer which peer was the session for | 2122 | * @param peer which peer was the session for |
2129 | * @param session which session is being updated | 2123 | * @param s which session is being updated |
2130 | * @param delay new delay to use for receiving | 2124 | * @param delay new delay to use for receiving |
2131 | */ | 2125 | */ |
2132 | static void | 2126 | static void |
diff --git a/src/transport/plugin_transport_http_common.c b/src/transport/plugin_transport_http_common.c index a420b8cdc..f1246bdb4 100644 --- a/src/transport/plugin_transport_http_common.c +++ b/src/transport/plugin_transport_http_common.c | |||
@@ -244,13 +244,15 @@ static struct PrettyPrinterContext *dll_ppc_tail; | |||
244 | * to override the address again. | 244 | * to override the address again. |
245 | * | 245 | * |
246 | * @param plugin the name of the plugin | 246 | * @param plugin the name of the plugin |
247 | * @param addr binary address | 247 | * @param saddr the splitted http address |
248 | * @param addrlen length of the address | 248 | * @param options address options |
249 | * @return string representing the same address | 249 | * @param dnsresult dns name to include in address |
250 | * @return string representing the same address or NULL on error | ||
250 | */ | 251 | */ |
251 | static const char * | 252 | static const char * |
252 | http_common_plugin_dnsresult_to_address (const char *plugin, | 253 | http_common_plugin_dnsresult_to_address (const char *plugin, |
253 | const struct SplittedHTTPAddress *saddr, uint32_t options, | 254 | const struct SplittedHTTPAddress *saddr, |
255 | uint32_t options, | ||
254 | const char *dnsresult) | 256 | const char *dnsresult) |
255 | { | 257 | { |
256 | static char rbuf[1024]; | 258 | static char rbuf[1024]; |
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index bed2de34f..74375462d 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c | |||
@@ -952,6 +952,7 @@ server_v6_run (void *cls, | |||
952 | * | 952 | * |
953 | * @param plugin plugin | 953 | * @param plugin plugin |
954 | * @param daemon_handle the MHD daemon handle | 954 | * @param daemon_handle the MHD daemon handle |
955 | * @param now schedule now | ||
955 | * @return gnunet task identifier | 956 | * @return gnunet task identifier |
956 | */ | 957 | */ |
957 | static GNUNET_SCHEDULER_TaskIdentifier | 958 | static GNUNET_SCHEDULER_TaskIdentifier |
@@ -3210,18 +3211,15 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls) | |||
3210 | 3211 | ||
3211 | 3212 | ||
3212 | /** | 3213 | /** |
3213 | * Function called by the pretty printer for the resolved address for | 3214 | * Function called for a quick conversion of the binary address to |
3214 | * each human-readable address obtained. The callback can be called | 3215 | * a numeric address. Note that the caller must not free the |
3215 | * several times. The last invocation must be with a @a address of | 3216 | * address and that the next call to this function is allowed |
3216 | * NULL and a @a res of #GNUNET_OK. Thus, to indicate conversion | 3217 | * to override the address again. |
3217 | * errors, the callback might be called first with @a address NULL and | ||
3218 | * @a res being #GNUNET_SYSERR. In that case, there must still be a | ||
3219 | * subsequent call later with @a address NULL and @a res #GNUNET_OK. | ||
3220 | * | 3218 | * |
3221 | * @param cls closure | 3219 | * @param cls unused |
3222 | * @param address one of the names for the host, NULL on last callback | 3220 | * @param addr binary address |
3223 | * @param res #GNUNET_OK if conversion was successful, #GNUNET_SYSERR on failure, | 3221 | * @param addrlen length of the address |
3224 | * #GNUNET_OK on last callback | 3222 | * @return string representing the same address |
3225 | */ | 3223 | */ |
3226 | static const char * | 3224 | static const char * |
3227 | http_server_plugin_address_to_string (void *cls, | 3225 | http_server_plugin_address_to_string (void *cls, |
@@ -3262,7 +3260,7 @@ http_server_plugin_get_network (void *cls, | |||
3262 | static void | 3260 | static void |
3263 | http_server_plugin_update_inbound_delay (void *cls, | 3261 | http_server_plugin_update_inbound_delay (void *cls, |
3264 | const struct GNUNET_PeerIdentity *peer, | 3262 | const struct GNUNET_PeerIdentity *peer, |
3265 | struct Session *s, | 3263 | struct Session *session, |
3266 | struct GNUNET_TIME_Relative delay) | 3264 | struct GNUNET_TIME_Relative delay) |
3267 | { | 3265 | { |
3268 | s->next_receive = GNUNET_TIME_relative_to_absolute (delay); | 3266 | s->next_receive = GNUNET_TIME_relative_to_absolute (delay); |
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c index 5cf9c5432..947ec5d71 100644 --- a/src/transport/plugin_transport_unix.c +++ b/src/transport/plugin_transport_unix.c | |||
@@ -561,7 +561,7 @@ reschedule_session_timeout (struct Session *session) | |||
561 | * Convert unix path to a `struct sockaddr_un *` | 561 | * Convert unix path to a `struct sockaddr_un *` |
562 | * | 562 | * |
563 | * @param unixpath path to convert | 563 | * @param unixpath path to convert |
564 | * @param sock_len[out] set to the length of the address | 564 | * @param[out] sock_len set to the length of the address |
565 | * @return converted unix path | 565 | * @return converted unix path |
566 | */ | 566 | */ |
567 | static struct sockaddr_un * | 567 | static struct sockaddr_un * |
@@ -1096,7 +1096,7 @@ unix_plugin_do_read (struct Plugin *plugin) | |||
1096 | /** | 1096 | /** |
1097 | * Write to UNIX domain socket (it is ready). | 1097 | * Write to UNIX domain socket (it is ready). |
1098 | * | 1098 | * |
1099 | * @param session session to write data for | 1099 | * @param plugin handle to the plugin |
1100 | */ | 1100 | */ |
1101 | static void | 1101 | static void |
1102 | unix_plugin_do_write (struct Plugin *plugin) | 1102 | unix_plugin_do_write (struct Plugin *plugin) |