diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-02-14 12:33:43 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-02-14 12:33:43 +0000 |
commit | 277f2ffeed022c1de410776902858d1edeaee910 (patch) | |
tree | 8ca3ec07dbf8dd783947e3f04ed25e270ad22457 /src/testbed/testbed_api_hosts.h | |
parent | a6492d071ad383beff300d825740fd9bfe41c34e (diff) | |
download | gnunet-277f2ffeed022c1de410776902858d1edeaee910.tar.gz gnunet-277f2ffeed022c1de410776902858d1edeaee910.zip |
move parallel overlay connect operation queue from controller handle to host handle
Diffstat (limited to 'src/testbed/testbed_api_hosts.h')
-rw-r--r-- | src/testbed/testbed_api_hosts.h | 109 |
1 files changed, 66 insertions, 43 deletions
diff --git a/src/testbed/testbed_api_hosts.h b/src/testbed/testbed_api_hosts.h index c0f42909a..f2a2e63e8 100644 --- a/src/testbed/testbed_api_hosts.h +++ b/src/testbed/testbed_api_hosts.h | |||
@@ -87,49 +87,6 @@ GNUNET_TESTBED_host_get_ssh_port_ (const struct GNUNET_TESTBED_Host *host); | |||
87 | 87 | ||
88 | 88 | ||
89 | /** | 89 | /** |
90 | * Opaque wrapper around GNUNET_HELPER_Handle | ||
91 | */ | ||
92 | struct GNUNET_TESTBED_HelperHandle; | ||
93 | |||
94 | |||
95 | /* /\** */ | ||
96 | /* * Run a given helper process at the given host. Communication */ | ||
97 | /* * with the helper will be via GNUnet messages on stdin/stdout. */ | ||
98 | /* * Runs the process via 'ssh' at the specified host, or locally. */ | ||
99 | /* * Essentially an SSH-wrapper around the 'gnunet_helper_lib.h' API. */ | ||
100 | /* * */ | ||
101 | /* * @param controller_ip the ip address of the controller. Will be set as TRUSTED */ | ||
102 | /* * host when starting testbed controller at host */ | ||
103 | /* * @param host host to use, use "NULL" for localhost */ | ||
104 | /* * @param binary_argv binary name and command-line arguments to give to the */ | ||
105 | /* * binary */ | ||
106 | /* * @param cfg template configuration to use for the remote controller; the */ | ||
107 | /* * remote controller will be started with a slightly modified */ | ||
108 | /* * configuration (port numbers, unix domain sockets and service home */ | ||
109 | /* * values are changed as per TESTING library on the remote host) */ | ||
110 | /* * @param cb the callback to run when helper process dies; cannot be NULL */ | ||
111 | /* * @param cb_cls the closure for the above callback */ | ||
112 | /* * @return handle to terminate the command, NULL on error */ | ||
113 | /* *\/ */ | ||
114 | /* struct GNUNET_TESTBED_HelperHandle * */ | ||
115 | /* GNUNET_TESTBED_host_run_ (const char *controller_ip, */ | ||
116 | /* const struct GNUNET_TESTBED_Host *host, */ | ||
117 | /* const struct GNUNET_CONFIGURATION_Handle *cfg, */ | ||
118 | /* GNUNET_HELPER_ExceptionCallback cb, */ | ||
119 | /* void *cb_cls); */ | ||
120 | |||
121 | |||
122 | |||
123 | /* /\** */ | ||
124 | /* * Stops a helper in the HelperHandle using GNUNET_HELPER_stop */ | ||
125 | /* * */ | ||
126 | /* * @param handle the handle returned from GNUNET_TESTBED_host_start_ */ | ||
127 | /* *\/ */ | ||
128 | /* void */ | ||
129 | /* GNUNET_TESTBED_host_stop_ (struct GNUNET_TESTBED_HelperHandle *handle); */ | ||
130 | |||
131 | |||
132 | /** | ||
133 | * Marks a host as registered with a controller | 90 | * Marks a host as registered with a controller |
134 | * | 91 | * |
135 | * @param host the host to mark | 92 | * @param host the host to mark |
@@ -154,6 +111,72 @@ GNUNET_TESTBED_is_host_registered_ (const struct GNUNET_TESTBED_Host *host, | |||
154 | *controller); | 111 | *controller); |
155 | 112 | ||
156 | 113 | ||
114 | /** | ||
115 | * (re)sets the operation queue for parallel overlay connects | ||
116 | * | ||
117 | * @param h the host handle | ||
118 | * @param npoc the number of parallel overlay connects - the queue size | ||
119 | */ | ||
120 | void | ||
121 | GNUNET_TESTBED_set_num_parallel_overlay_connects_ (struct | ||
122 | GNUNET_TESTBED_Host *h, | ||
123 | unsigned int npoc); | ||
124 | |||
125 | |||
126 | /** | ||
127 | * Releases a time slot thus making it available for be used again | ||
128 | * | ||
129 | * @param h the host handle | ||
130 | * @param index the index of the the time slot | ||
131 | * @param key the key to prove ownership of the timeslot | ||
132 | * @return GNUNET_YES if the time slot is successfully removed; GNUNET_NO if the | ||
133 | * time slot cannot be removed - this could be because of the index | ||
134 | * greater than existing number of time slots or `key' being different | ||
135 | */ | ||
136 | int | ||
137 | GNUNET_TESTBED_release_time_slot_ (struct GNUNET_TESTBED_Host *h, | ||
138 | unsigned int index, void *key); | ||
139 | |||
140 | |||
141 | /** | ||
142 | * Function to update a time slot | ||
143 | * | ||
144 | * @param h the host handle | ||
145 | * @param index the index of the time slot to update | ||
146 | * @param key the key to identify ownership of the slot | ||
147 | * @param time the new time | ||
148 | * @param failed should this reading be treated as coming from a fail event | ||
149 | */ | ||
150 | void | ||
151 | GNUNET_TESTBED_update_time_slot_ (struct GNUNET_TESTBED_Host *h, | ||
152 | unsigned int index, void *key, | ||
153 | struct GNUNET_TIME_Relative time, int failed); | ||
154 | |||
155 | |||
156 | /** | ||
157 | * Returns a timing slot which will be exclusively locked | ||
158 | * | ||
159 | * @param h the host handle | ||
160 | * @param key a pointer which is associated to the returned slot; should not be | ||
161 | * NULL. It serves as a key to determine the correct owner of the slot | ||
162 | * @return the time slot index in the array of time slots in the controller | ||
163 | * handle | ||
164 | */ | ||
165 | unsigned int | ||
166 | GNUNET_TESTBED_get_tslot_ (struct GNUNET_TESTBED_Host *h, void *key); | ||
167 | |||
168 | |||
169 | /** | ||
170 | * Queues the given operation in the queue for parallel overlay connects of the | ||
171 | * given host | ||
172 | * | ||
173 | * @param h the host handle | ||
174 | * @param op the operation to queue in the given host's parally overlay connect | ||
175 | * queue | ||
176 | */ | ||
177 | void | ||
178 | GNUNET_TESTBED_host_queue_oc (struct GNUNET_TESTBED_Host *h, | ||
179 | struct GNUNET_TESTBED_Operation *op); | ||
157 | 180 | ||
158 | #endif | 181 | #endif |
159 | /* end of testbed_api_hosts.h */ | 182 | /* end of testbed_api_hosts.h */ |