diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-05-06 16:06:08 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-05-06 16:06:08 +0000 |
commit | ad25eef39dc8c15b85bd70c6585af95d7e687fd5 (patch) | |
tree | 152df39da268b913fd5a93467556ca9249e20416 /src/testbed/gnunet-service-testbed_links.h | |
parent | e2bb863887e78b5847fd86ef5a399a5d13d856d3 (diff) | |
download | gnunet-ad25eef39dc8c15b85bd70c6585af95d7e687fd5.tar.gz gnunet-ad25eef39dc8c15b85bd70c6585af95d7e687fd5.zip |
- doc
Diffstat (limited to 'src/testbed/gnunet-service-testbed_links.h')
-rw-r--r-- | src/testbed/gnunet-service-testbed_links.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/testbed/gnunet-service-testbed_links.h b/src/testbed/gnunet-service-testbed_links.h index 65741c21c..9134ab545 100644 --- a/src/testbed/gnunet-service-testbed_links.h +++ b/src/testbed/gnunet-service-testbed_links.h | |||
@@ -25,6 +25,10 @@ | |||
25 | * @author Sree Harsha Totakura | 25 | * @author Sree Harsha Totakura |
26 | */ | 26 | */ |
27 | 27 | ||
28 | |||
29 | /** | ||
30 | * A connected controller which is not our child | ||
31 | */ | ||
28 | struct Neighbour; | 32 | struct Neighbour; |
29 | 33 | ||
30 | 34 | ||
@@ -92,36 +96,97 @@ extern struct Slave **GST_slave_list; | |||
92 | */ | 96 | */ |
93 | extern unsigned int GST_slave_list_size; | 97 | extern unsigned int GST_slave_list_size; |
94 | 98 | ||
99 | |||
100 | /** | ||
101 | * Cleans up the neighbour list | ||
102 | */ | ||
95 | void | 103 | void |
96 | GST_neighbour_list_clean(); | 104 | GST_neighbour_list_clean(); |
97 | 105 | ||
106 | |||
107 | /** | ||
108 | * Get a neighbour from the neighbour list | ||
109 | * | ||
110 | * @param id the index of the neighbour in the neighbour list | ||
111 | * @return the Neighbour; NULL if the given index in invalid (index greater than | ||
112 | * the list size or neighbour at that index is NULL) | ||
113 | */ | ||
98 | struct Neighbour * | 114 | struct Neighbour * |
99 | GST_get_neighbour (uint32_t id); | 115 | GST_get_neighbour (uint32_t id); |
100 | 116 | ||
117 | |||
118 | /** | ||
119 | * Function to cleanup the neighbour connect contexts | ||
120 | */ | ||
101 | void | 121 | void |
102 | GST_free_nccq (); | 122 | GST_free_nccq (); |
103 | 123 | ||
124 | |||
125 | /** | ||
126 | * Notification context to be used to notify when connection to the neighbour's | ||
127 | * controller is opened | ||
128 | */ | ||
104 | struct NeighbourConnectNotification; | 129 | struct NeighbourConnectNotification; |
105 | 130 | ||
131 | |||
132 | /** | ||
133 | * The notification callback to call when we are connect to neighbour | ||
134 | * | ||
135 | * @param cls the closure given to GST_neighbour_get_connection() | ||
136 | * @param controller the controller handle to the neighbour | ||
137 | */ | ||
106 | typedef void (*GST_NeigbourConnectNotifyCallback) (void *cls, | 138 | typedef void (*GST_NeigbourConnectNotifyCallback) (void *cls, |
107 | struct | 139 | struct |
108 | GNUNET_TESTBED_Controller | 140 | GNUNET_TESTBED_Controller |
109 | *controller); | 141 | *controller); |
110 | 142 | ||
143 | |||
144 | /** | ||
145 | * Try to open a connection to the given neigbour. If the connection is open | ||
146 | * already, then it is re-used. If not, the request is queued in the operation | ||
147 | * queues responsible for bounding the total number of file descriptors. The | ||
148 | * actual connection will happen when the operation queue marks the | ||
149 | * corresponding operation as active. | ||
150 | * | ||
151 | * @param n the neighbour to open a connection to | ||
152 | * @param cb the notification callback to call when the connection is opened | ||
153 | * @param cb_cls the closure for the above callback | ||
154 | */ | ||
111 | struct NeighbourConnectNotification * | 155 | struct NeighbourConnectNotification * |
112 | GST_neighbour_get_connection (struct Neighbour *n, | 156 | GST_neighbour_get_connection (struct Neighbour *n, |
113 | GST_NeigbourConnectNotifyCallback cb, | 157 | GST_NeigbourConnectNotifyCallback cb, |
114 | void *cb_cls); | 158 | void *cb_cls); |
115 | 159 | ||
160 | |||
161 | /** | ||
162 | * Cancel the request for opening a connection to the neighbour | ||
163 | * | ||
164 | * @param h the notification handle | ||
165 | */ | ||
116 | void | 166 | void |
117 | GST_neighbour_get_connection_cancel (struct NeighbourConnectNotification *h); | 167 | GST_neighbour_get_connection_cancel (struct NeighbourConnectNotification *h); |
118 | 168 | ||
169 | |||
170 | /** | ||
171 | * Release the connection to the neighbour. The actual connection will be | ||
172 | * closed if connections to other neighbour are waiting (to maintain a bound on | ||
173 | * the total number of connections that are open). | ||
174 | * | ||
175 | * @param n the neighbour whose connection can be closed | ||
176 | */ | ||
119 | void | 177 | void |
120 | GST_neighbour_release_connection (struct Neighbour *n); | 178 | GST_neighbour_release_connection (struct Neighbour *n); |
121 | 179 | ||
180 | |||
181 | /** | ||
182 | * Function to create a neigbour and add it into the neighbour list | ||
183 | * | ||
184 | * @param host the host of the neighbour | ||
185 | */ | ||
122 | struct Neighbour * | 186 | struct Neighbour * |
123 | GST_create_neighbour (struct GNUNET_TESTBED_Host *host); | 187 | GST_create_neighbour (struct GNUNET_TESTBED_Host *host); |
124 | 188 | ||
189 | |||
125 | /** | 190 | /** |
126 | * Message handler for GNUNET_MESSAGE_TYPE_TESTBED_LCONTROLLERS message | 191 | * Message handler for GNUNET_MESSAGE_TYPE_TESTBED_LCONTROLLERS message |
127 | * | 192 | * |