diff options
Diffstat (limited to 'src/transport/gnunet-service-transport_neighbours.h')
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.h | 68 |
1 files changed, 30 insertions, 38 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.h b/src/transport/gnunet-service-transport_neighbours.h index a99cd1e96..c263c33d9 100644 --- a/src/transport/gnunet-service-transport_neighbours.h +++ b/src/transport/gnunet-service-transport_neighbours.h | |||
@@ -43,17 +43,16 @@ | |||
43 | * @param connect_cb function to call if we connect to a peer | 43 | * @param connect_cb function to call if we connect to a peer |
44 | * @param disconnect_cb function to call if we disconnect from a peer | 44 | * @param disconnect_cb function to call if we disconnect from a peer |
45 | */ | 45 | */ |
46 | void | 46 | void |
47 | GST_neighbours_start (void *cls, | 47 | GST_neighbours_start (void *cls, |
48 | GNUNET_TRANSPORT_NotifyConnect connect_cb, | 48 | GNUNET_TRANSPORT_NotifyConnect connect_cb, |
49 | GNUNET_TRANSPORT_NotifyDisconnect disconnect_cb); | 49 | GNUNET_TRANSPORT_NotifyDisconnect disconnect_cb); |
50 | 50 | ||
51 | 51 | ||
52 | /** | 52 | /** |
53 | * Cleanup the neighbours subsystem. | 53 | * Cleanup the neighbours subsystem. |
54 | */ | 54 | */ |
55 | void | 55 | void GST_neighbours_stop (void); |
56 | GST_neighbours_stop (void); | ||
57 | 56 | ||
58 | 57 | ||
59 | /** | 58 | /** |
@@ -61,8 +60,7 @@ GST_neighbours_stop (void); | |||
61 | * | 60 | * |
62 | * @param target peer to try to connect to | 61 | * @param target peer to try to connect to |
63 | */ | 62 | */ |
64 | void | 63 | void GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target); |
65 | GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target); | ||
66 | 64 | ||
67 | 65 | ||
68 | /** | 66 | /** |
@@ -71,8 +69,7 @@ GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target); | |||
71 | * @param target peer to test | 69 | * @param target peer to test |
72 | * @return GNUNET_YES if we are connected, GNUNET_NO if not | 70 | * @return GNUNET_YES if we are connected, GNUNET_NO if not |
73 | */ | 71 | */ |
74 | int | 72 | int GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target); |
75 | GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target); | ||
76 | 73 | ||
77 | 74 | ||
78 | /** | 75 | /** |
@@ -81,8 +78,7 @@ GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target); | |||
81 | * @param cls closure | 78 | * @param cls closure |
82 | * @param success GNUNET_OK on success, GNUNET_NO on failure, GNUNET_SYSERR if we're not connected | 79 | * @param success GNUNET_OK on success, GNUNET_NO on failure, GNUNET_SYSERR if we're not connected |
83 | */ | 80 | */ |
84 | typedef void (*GST_NeighbourSendContinuation)(void *cls, | 81 | typedef void (*GST_NeighbourSendContinuation) (void *cls, int success); |
85 | int success); | ||
86 | 82 | ||
87 | 83 | ||
88 | /** | 84 | /** |
@@ -97,11 +93,10 @@ typedef void (*GST_NeighbourSendContinuation)(void *cls, | |||
97 | */ | 93 | */ |
98 | void | 94 | void |
99 | GST_neighbours_send (const struct GNUNET_PeerIdentity *target, | 95 | GST_neighbours_send (const struct GNUNET_PeerIdentity *target, |
100 | const void *msg, | 96 | const void *msg, |
101 | size_t msg_size, | 97 | size_t msg_size, |
102 | struct GNUNET_TIME_Relative timeout, | 98 | struct GNUNET_TIME_Relative timeout, |
103 | GST_NeighbourSendContinuation cont, | 99 | GST_NeighbourSendContinuation cont, void *cont_cls); |
104 | void *cont_cls); | ||
105 | 100 | ||
106 | 101 | ||
107 | /** | 102 | /** |
@@ -116,9 +111,8 @@ GST_neighbours_send (const struct GNUNET_PeerIdentity *target, | |||
116 | * @return how long to wait before reading more from this sender | 111 | * @return how long to wait before reading more from this sender |
117 | */ | 112 | */ |
118 | struct GNUNET_TIME_Relative | 113 | struct GNUNET_TIME_Relative |
119 | GST_neighbours_calculate_receive_delay (const struct GNUNET_PeerIdentity *sender, | 114 | GST_neighbours_calculate_receive_delay (const struct GNUNET_PeerIdentity |
120 | ssize_t size, | 115 | *sender, ssize_t size, int *do_forward); |
121 | int *do_forward); | ||
122 | 116 | ||
123 | 117 | ||
124 | /** | 118 | /** |
@@ -127,8 +121,7 @@ GST_neighbours_calculate_receive_delay (const struct GNUNET_PeerIdentity *sender | |||
127 | * | 121 | * |
128 | * @param neighbour neighbour to keep alive | 122 | * @param neighbour neighbour to keep alive |
129 | */ | 123 | */ |
130 | void | 124 | void GST_neighbours_keepalive (const struct GNUNET_PeerIdentity *neighbour); |
131 | GST_neighbours_keepalive (const struct GNUNET_PeerIdentity *neighbour); | ||
132 | 125 | ||
133 | 126 | ||
134 | /** | 127 | /** |
@@ -139,7 +132,7 @@ GST_neighbours_keepalive (const struct GNUNET_PeerIdentity *neighbour); | |||
139 | */ | 132 | */ |
140 | void | 133 | void |
141 | GST_neighbours_set_incoming_quota (const struct GNUNET_PeerIdentity *neighbour, | 134 | GST_neighbours_set_incoming_quota (const struct GNUNET_PeerIdentity *neighbour, |
142 | struct GNUNET_BANDWIDTH_Value32NBO quota); | 135 | struct GNUNET_BANDWIDTH_Value32NBO quota); |
143 | 136 | ||
144 | 137 | ||
145 | /** | 138 | /** |
@@ -147,8 +140,7 @@ GST_neighbours_set_incoming_quota (const struct GNUNET_PeerIdentity *neighbour, | |||
147 | * | 140 | * |
148 | * @param target peer to disconnect from | 141 | * @param target peer to disconnect from |
149 | */ | 142 | */ |
150 | void | 143 | void GST_neighbours_force_disconnect (const struct GNUNET_PeerIdentity *target); |
151 | GST_neighbours_force_disconnect (const struct GNUNET_PeerIdentity *target); | ||
152 | 144 | ||
153 | 145 | ||
154 | /** | 146 | /** |
@@ -159,10 +151,12 @@ GST_neighbours_force_disconnect (const struct GNUNET_PeerIdentity *target); | |||
159 | * @param ats performance data | 151 | * @param ats performance data |
160 | * @param ats_count number of entries in ats (excluding 0-termination) | 152 | * @param ats_count number of entries in ats (excluding 0-termination) |
161 | */ | 153 | */ |
162 | typedef void (*GST_NeighbourIterator)(void *cls, | 154 | typedef void (*GST_NeighbourIterator) (void *cls, |
163 | const struct GNUNET_PeerIdentity *neighbour, | 155 | const struct GNUNET_PeerIdentity * |
164 | const struct GNUNET_TRANSPORT_ATS_Information *ats, | 156 | neighbour, |
165 | uint32_t ats_count); | 157 | const struct |
158 | GNUNET_TRANSPORT_ATS_Information * ats, | ||
159 | uint32_t ats_count); | ||
166 | 160 | ||
167 | 161 | ||
168 | /** | 162 | /** |
@@ -171,9 +165,7 @@ typedef void (*GST_NeighbourIterator)(void *cls, | |||
171 | * @param cb function to call | 165 | * @param cb function to call |
172 | * @param cb_cls closure for cb | 166 | * @param cb_cls closure for cb |
173 | */ | 167 | */ |
174 | void | 168 | void GST_neighbours_iterate (GST_NeighbourIterator cb, void *cb_cls); |
175 | GST_neighbours_iterate (GST_NeighbourIterator cb, | ||
176 | void *cb_cls); | ||
177 | 169 | ||
178 | 170 | ||
179 | /** | 171 | /** |
@@ -184,7 +176,7 @@ GST_neighbours_iterate (GST_NeighbourIterator cb, | |||
184 | */ | 176 | */ |
185 | void | 177 | void |
186 | GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, | 178 | GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, |
187 | struct Session *session); | 179 | struct Session *session); |
188 | 180 | ||
189 | 181 | ||
190 | /** | 182 | /** |
@@ -202,12 +194,12 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, | |||
202 | */ | 194 | */ |
203 | void | 195 | void |
204 | GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, | 196 | GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, |
205 | const char *plugin_name, | 197 | const char *plugin_name, |
206 | const void *address, | 198 | const void *address, |
207 | size_t address_len, | 199 | size_t address_len, |
208 | struct Session *session, | 200 | struct Session *session, |
209 | const struct GNUNET_TRANSPORT_ATS_Information *ats, | 201 | const struct GNUNET_TRANSPORT_ATS_Information |
210 | uint32_t ats_count); | 202 | *ats, uint32_t ats_count); |
211 | 203 | ||
212 | 204 | ||
213 | #endif | 205 | #endif |