implemented the Main Controller's 'reconf' command (artf468488)
[deliverable/titan.core.git] / mctr2 / mctr / MainController.h
CommitLineData
d44e3c4f 1/******************************************************************************
2 * Copyright (c) 2000-2016 Ericsson Telecom AB
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Baji, Laszlo
10 * Balasko, Jeno
f08ff9ca 11 * Baranyi, Botond
d44e3c4f 12 * Bene, Tamas
13 * Czimbalmos, Eduard
14 * Feher, Csaba
15 * Forstner, Matyas
16 * Gecse, Roland
17 * Kovacs, Ferenc
18 * Lovassy, Arpad
19 * Raduly, Csaba
20 * Szabo, Janos Zoltan – initial implementation
21 * Zalanyi, Balazs Andor
22 *
23 ******************************************************************************/
970ed795
EL
24//
25// Description: Header file for MainController
26// Author: Janos Zoltan Szabo
27// mail: tmpjsz@eth.ericsson.se
28//
3abe9331 29// Copyright (c) 2000-2015 Ericsson Telecom AB
970ed795
EL
30//
31#ifndef MCTR_MAINCONTROLLER_H
32#define MCTR_MAINCONTROLLER_H
33//----------------------------------------------------------------------------
34
35#include <pthread.h>
36#include <sys/types.h>
37#include <netinet/in.h>
38
39#include "../../core/Types.h"
40#include "../../common/NetworkHandler.hh"
41class Text_Buf;
42
43#include "UserInterface.h"
44
45#ifdef USE_EPOLL
46struct epoll_event;
47#else
48struct pollfd;
49#endif
50
51struct sigaction;
52
53//----------------------------------------------------------------------------
54
55namespace mctr {
56
57//----------------------------------------------------------------------------
58
59/* Type definitions */
60
61/** For representing the global state of MC */
62enum mc_state_enum {
63 MC_INACTIVE, MC_LISTENING, MC_LISTENING_CONFIGURED, MC_HC_CONNECTED,
64 MC_CONFIGURING, MC_ACTIVE, MC_SHUTDOWN, MC_CREATING_MTC, MC_READY,
65 MC_TERMINATING_MTC, MC_EXECUTING_CONTROL, MC_EXECUTING_TESTCASE,
b0caada2 66 MC_TERMINATING_TESTCASE, MC_PAUSED, MC_RECONFIGURING
970ed795
EL
67};
68
69/** Data structure for unknown incoming connections (before receiving
70 * the first message) */
71struct unknown_connection {
72 int fd;
73 IPAddress *ip_addr;
74 Text_Buf *text_buf;
75 unknown_connection *prev, *next;
76 bool unix_socket; // true only if the connection is through unix domain socket
77};
78
79/** Data structure for describing the component location
80 * constraints */
81struct string_set {
82 int n_elements;
83 char **elements;
84};
85
86/** Data structure for describing the component location
87 * constraints */
88struct host_group_struct {
89 char *group_name;
90 boolean has_all_hosts, has_all_components;
91 string_set host_members, assigned_components;
92};
93
94/** Possible states of a HC */
95enum hc_state_enum { HC_IDLE, HC_CONFIGURING, HC_ACTIVE, HC_OVERLOADED,
96 HC_CONFIGURING_OVERLOADED, HC_EXITING, HC_DOWN };
97
98/** Data structure for each host (and the corresponding HC) */
99struct host_struct {
100 IPAddress *ip_addr;
101 char *hostname; /**< hostname retrieved from DNS */
102 char *hostname_local; /**< hostname sent in VERSION message */
103 char *machine_type;
104 char *system_name;
105 char *system_release;
106 char *system_version;
107 boolean transport_supported[TRANSPORT_NUM];
108 char *log_source;
109 hc_state_enum hc_state;
110 int hc_fd;
111 Text_Buf *text_buf;
112 int n_components;
113 component *components;
114 /* to implement load balancing mechanisms */
115 string_set allowed_components;
116 boolean all_components_allowed;
117 boolean local_hostname_different;
118 int n_active_components;
119};
120
121struct component_struct;
122
123/** Container of test components (when a pending operation can be
124 * requested by several components) */
125struct requestor_struct {
126 int n_components;
127 union {
128 component_struct *the_component;
129 component_struct **components;
130 };
131};
132
133/** Possible states of a port connection or mapping */
134enum conn_state_enum { CONN_LISTENING, CONN_CONNECTING, CONN_CONNECTED,
135 CONN_DISCONNECTING, CONN_MAPPING, CONN_MAPPED, CONN_UNMAPPING };
136
137/** Data structure for representing a port connection */
138struct port_connection {
139 conn_state_enum conn_state;
140 transport_type_enum transport_type;
141 struct {
142 component comp_ref;
143 char *port_name;
144 port_connection *next, *prev;
145 } head, tail;
146 requestor_struct requestors;
147};
148
149
150/** Structure for timers */
151struct timer_struct {
152 double expiration;
153 union {
154 void *dummy_ptr;
155 component_struct *component_ptr;
156 } timer_argument;
157 timer_struct *prev, *next;
158};
159
160/** Possible states of a TC (MTC or PTC) */
161enum tc_state_enum { TC_INITIAL, TC_IDLE, TC_CREATE, TC_START, TC_STOP, TC_KILL,
162 TC_CONNECT, TC_DISCONNECT, TC_MAP, TC_UNMAP, TC_STOPPING, TC_EXITING,
163 TC_EXITED,
164 MTC_CONTROLPART, MTC_TESTCASE, MTC_ALL_COMPONENT_STOP,
165 MTC_ALL_COMPONENT_KILL, MTC_TERMINATING_TESTCASE, MTC_PAUSED,
166 PTC_FUNCTION, PTC_STARTING, PTC_STOPPED, PTC_KILLING, PTC_STOPPING_KILLING,
b0caada2 167 PTC_STALE, TC_SYSTEM, MTC_CONFIGURING };
970ed795
EL
168
169/** Data structure for each TC */
170struct component_struct {
171 component comp_ref;
172 qualified_name comp_type;
173 char *comp_name;
174 char *log_source; /**< used for console log messages. format: name\@host */
175 host_struct *comp_location;
176 tc_state_enum tc_state;
177 verdicttype local_verdict;
178 char* verdict_reason;
179 int tc_fd;
180 Text_Buf *text_buf;
181 /** Identifier of the TTCN-3 testcase or function that is currently being
182 * executed on the test component */
183 qualified_name tc_fn_name;
184 /* fields for implementing the construct 'value returning done' */
185 char *return_type;
186 int return_value_len;
187 void *return_value;
188 boolean is_alive;
189 boolean stop_requested; /**< only for 'all component.running' */
190 boolean process_killed;
191 union {
192 /** used in state TC_INITIAL */
193 struct {
194 component_struct *create_requestor;
195 char *location_str;
196 } initial;
197 /** used in state PTC_STARTING */
198 struct {
199 component_struct *start_requestor;
200 int arguments_len;
201 void *arguments_ptr;
202 requestor_struct cancel_done_sent_to;
203 } starting;
204 /** used in states TC_STOPPING, PTC_STOPPING_KILLING, PTC_KILLING */
205 struct {
206 requestor_struct stop_requestors;
207 requestor_struct kill_requestors;
208 } stopping_killing;
209 };
210 requestor_struct done_requestors;
211 requestor_struct killed_requestors;
212 requestor_struct cancel_done_sent_for;
213 timer_struct *kill_timer;
214 /* fields for registering port connections */
215 port_connection *conn_head_list, *conn_tail_list;
216 int conn_head_count, conn_tail_count;
217};
218
219/** Selector for the table of file descriptors */
220enum fd_type_enum { FD_UNUSED, FD_PIPE, FD_SERVER, FD_UNKNOWN, FD_HC, FD_TC };
221
222/** Element of the file descriptor table. The table is indexed by the
223 * fd itself. */
224struct fd_table_struct {
225 fd_type_enum fd_type;
226 union {
227 unknown_connection *unknown_ptr;
228 host_struct *host_ptr;
229 component_struct *component_ptr;
230 void *dummy_ptr;
231 };
232};
233
234/** Structure for storing the checksum of a module */
235struct module_version_info {
236 char *module_name;
237 int checksum_length;
238 unsigned char *module_checksum;
239};
240
241/** Possible reasons for waking up the MC thread from the main thread. */
242enum wakeup_reason_t { REASON_NOTHING, REASON_SHUTDOWN, REASON_MTC_KILL_TIMER };
243
016a1a93
BB
244/** Structure for storing the settings needed to initialize the debugger of a
245 * newly connected HC */
246struct debugger_settings_struct {
247 char* on_switch;
248 char* output_type;
249 char* output_file;
250 char* error_behavior;
f08ff9ca 251 char* error_batch_file;
016a1a93 252 char* fail_behavior;
f08ff9ca
BB
253 char* fail_batch_file;
254 char* global_batch_state;
255 char* global_batch_file;
cf2b6056
BB
256 char* function_calls_cfg;
257 char* function_calls_file;
016a1a93
BB
258 int nof_breakpoints;
259 struct breakpoint_struct {
260 char* module;
261 char* line;
f08ff9ca 262 char* batch_file;
016a1a93
BB
263 }* breakpoints;
264};
265
266struct debug_command_struct {
267 int command;
268 char* arguments;
269};
270
970ed795
EL
271/** The MainController class. The collection of all functions and data
272 * structures */
273class MainController {
274 /* private members */
275 static UserInterface *ui;
276 static NetworkHandler nh;
277
278 static mc_state_enum mc_state;
279 static char *mc_hostname;
280
281 static int server_fd;
282 static int server_fd_unix; // for efficient local communication
283 static boolean server_fd_disabled;
284 static void disable_server_fd();
285 static void enable_server_fd();
286
287 static pthread_mutex_t mutex;
288 static void lock();
289 static void unlock();
290
291#ifdef USE_EPOLL
292 static const int EPOLL_SIZE_HINT = 1000;
293 static const int EPOLL_MAX_EVENTS = 250;
294 static epoll_event *epoll_events;
295 static int epfd;
296#else
297 static unsigned int nfds, new_nfds;
298 static struct pollfd *ufds, *new_ufds;
299 static boolean pollfds_modified;
300 static void update_pollfds();
301#endif
302 static void add_poll_fd(int fd);
303 static void remove_poll_fd(int fd);
304
305 static int fd_table_size;
306 static fd_table_struct *fd_table;
307 static void add_fd_to_table(int fd);
308 static void remove_fd_from_table(int fd);
309
310 static void set_close_on_exec(int fd);
311
312 static unknown_connection *unknown_head, *unknown_tail;
313 static unknown_connection *new_unknown_connection(bool unix_socket);
314 static void delete_unknown_connection(unknown_connection *conn);
315 static void close_unknown_connection(unknown_connection *conn);
316
317 static void init_string_set(string_set *set);
318 static void free_string_set(string_set *set);
319 static void add_string_to_set(string_set *set, const char *str);
320 static void remove_string_from_set(string_set *set, const char *str);
321 static boolean set_has_string(const string_set *set, const char *str);
322 static const char *get_string_from_set(const string_set *set, int index);
323
324 static int n_host_groups;
325 static host_group_struct *host_groups;
326 static string_set assigned_components;
327 static boolean all_components_assigned;
328 static host_group_struct *add_host_group(const char *group_name);
329 static host_group_struct *lookup_host_group(const char *group_name);
330 static boolean is_similar_hostname(const char *host1, const char *host2);
331 static boolean host_has_name(const host_struct *host, const char *name);
332 static boolean member_of_group(const host_struct *host,
333 const host_group_struct *group);
334 static void add_allowed_components(host_struct *host);
335 static host_struct *choose_ptc_location(const char *component_type,
336 const char *component_name, const char *component_location);
337
338 static int n_hosts;
339 static host_struct **hosts;
340 static char *config_str;
016a1a93
BB
341 static debugger_settings_struct debugger_settings;
342 static debug_command_struct last_debug_command;
970ed795
EL
343 static host_struct *add_new_host(unknown_connection *conn);
344 static void close_hc_connection(host_struct *hc);
345 static boolean is_hc_in_state(hc_state_enum checked_state);
346 static boolean all_hc_in_state(hc_state_enum checked_state);
347 static void configure_host(host_struct *host, boolean should_notify);
b0caada2 348 static void configure_mtc();
970ed795
EL
349 static void check_all_hc_configured();
350 static void add_component_to_host(host_struct *host,
351 component_struct *comp);
352 static void remove_component_from_host(component_struct *comp);
353
354 static boolean version_known;
355 static int n_modules;
356 static module_version_info *modules;
357 static boolean check_version(unknown_connection *conn);
358
359 static int n_components, n_active_ptcs, max_ptcs;
360 static component_struct **components;
361 static component_struct *mtc, *system;
016a1a93 362 static const component_struct* debugger_active_tc;
970ed795
EL
363 static component next_comp_ref, tc_first_comp_ref;
364 static boolean any_component_done_requested, any_component_done_sent,
365 all_component_done_requested, any_component_killed_requested,
366 all_component_killed_requested;
367 static void add_component(component_struct *comp);
368 static component_struct *lookup_component(component comp_ref);
369 static void destroy_all_components();
370 static void close_tc_connection(component_struct *comp);
371 static boolean stop_after_tc, stop_requested;
372 static boolean ready_to_finish_testcase();
373 static void finish_testcase();
374 static boolean message_expected(component_struct *from,
375 const char *message_name);
376 static boolean request_allowed(component_struct *from,
377 const char *message_name);
378 static boolean valid_endpoint(component component_reference,
379 boolean new_connection, component_struct *requestor,
380 const char *operation);
381 static void destroy_connection(port_connection *conn, component_struct *tc);
382 static void destroy_mapping(port_connection *conn);
383 static boolean stop_all_components();
384 static void check_all_component_stop();
385 static void send_stop_ack_to_requestors(component_struct *tc);
386 static boolean kill_all_components(boolean testcase_ends);
387 static void check_all_component_kill();
388 static void send_kill_ack_to_requestors(component_struct *tc);
389 static void send_component_status_to_requestor(component_struct *tc,
390 component_struct *requestor, boolean done_status,
391 boolean killed_status);
392 static void component_stopped(component_struct *tc);
393 static void component_terminated(component_struct *tc);
394 static void done_cancelled(component_struct *from,
395 component_struct *started_tc);
396 static void start_kill_timer(component_struct *tc);
397
398 static boolean component_is_alive(component_struct *tc);
399 static boolean component_is_running(component_struct *tc);
400 static boolean component_is_done(component_struct *tc);
401 static boolean is_any_component_alive();
402 static boolean is_all_component_alive();
403 static boolean is_any_component_running();
404 static boolean is_all_component_running();
405 static boolean is_any_component_done();
406
407 static void init_connections(component_struct *tc);
408 static void add_connection(port_connection *c);
409 static void remove_connection(port_connection *c);
410 static port_connection *find_connection(component head_comp,
411 const char *head_port, component tail_comp, const char *tail_port);
412 static void remove_all_connections(component head_or_tail);
413 static transport_type_enum choose_port_connection_transport(
414 component head_comp, component tail_comp);
415 static void send_connect_ack_to_requestors(port_connection *conn);
416 static void send_error_to_connect_requestors(port_connection *conn,
417 const char *fmt, ...)
418 __attribute__ ((__format__ (__printf__, 2, 3)));
419 static void send_disconnect_to_server(port_connection *conn);
420 static void send_disconnect_ack_to_requestors(port_connection *conn);
421
422 static void init_requestors(requestor_struct *reqs, component_struct *tc);
423 static void add_requestor(requestor_struct *reqs, component_struct *tc);
424 static void remove_requestor(requestor_struct *reqs, component_struct *tc);
425 static boolean has_requestor(const requestor_struct *reqs,
426 component_struct *tc);
427 static component_struct *get_requestor(const requestor_struct *reqs,
428 int index);
429 static void free_requestors(requestor_struct *reqs);
430
431 static void init_qualified_name(qualified_name *name);
432 static void free_qualified_name(qualified_name *name);
433
434 static double kill_timer;
435 static double time_now();
436 static timer_struct *timer_head, *timer_tail;
437 static void register_timer(timer_struct *timer);
438 static void cancel_timer(timer_struct *timer);
439 static int get_poll_timeout();
440 static void handle_expired_timers();
441 static void handle_kill_timer(timer_struct *timer);
442
443 // Custom signal handling for termination signals to remove temporary
444 // files /tmp/ttcn3-mctr-*. Related to HP67376.
445 static struct sigaction new_action, old_action;
446 static void register_termination_handlers();
447 static void termination_handler(int signum);
f08ff9ca
BB
448
449 static void execute_batch_file(const char* file_name);
970ed795
EL
450
451public:
452 static void error(const char *fmt, ...)
453 __attribute__ ((__format__ (__printf__, 1, 2)));
454private:
455 static void notify(const char *fmt, ...)
456 __attribute__ ((__format__ (__printf__, 1, 2)));
457 static void notify(const struct timeval *timestamp, const char *source,
458 int severity, const char *message);
459 static void status_change();
460
461 static void fatal_error(const char *fmt, ...)
462 __attribute__ ((__format__ (__printf__, 1, 2), __noreturn__));
463
464 static void *thread_main(void *arg);
465 static void dispatch_socket_event(int fd);
466 static int pipe_fd[2];
467 static wakeup_reason_t wakeup_reason;
468 static void wakeup_thread(wakeup_reason_t reason);
469
470 static void handle_pipe();
471 static void handle_incoming_connection(int p_serverfd);
472 static int recv_to_buffer(int fd, Text_Buf& text_buf,
473 boolean recv_from_socket);
474 static void handle_unknown_data(unknown_connection *conn);
475 static void handle_hc_data(host_struct *hc, boolean recv_from_socket);
476 static void handle_tc_data(component_struct *tc, boolean recv_from_socket);
477
478 static void unlink_unix_socket(int socket_fd);
479
480 static void shutdown_server();
481 static void perform_shutdown();
482
483 static void clean_up();
484
485 static const char *get_host_name(const struct in_addr *ip_address);
486 static boolean get_ip_address(struct in_addr *ip_address,
487 const char *host_name);
488
489 /* Messages to HCs */
490 static void send_configure(host_struct *hc, const char *config_file);
491 static void send_exit_hc(host_struct *hc);
492 static void send_create_mtc(host_struct *hc);
493 static void send_create_ptc(host_struct *hc, component component_reference,
494 const qualified_name& component_type, const char *component_name,
495 boolean is_alive, const qualified_name& current_testcase);
496 static void send_kill_process(host_struct *hc,
497 component component_reference);
498
499 /* Messages to TCs */
500 static void send_create_ack(component_struct *tc,
501 component component_reference);
502 static void send_start_ack(component_struct *tc);
503 static void send_stop(component_struct *tc);
504 static void send_stop_ack(component_struct *tc);
505 static void send_kill_ack(component_struct *tc);
506 static void send_running(component_struct *tc, boolean answer);
507 static void send_alive(component_struct *tc, boolean answer);
508 static void send_done_ack(component_struct *tc, boolean answer,
509 const char *return_type, int return_value_len,
510 const void *return_value);
511 static void send_killed_ack(component_struct *tc, boolean answer);
512 static void send_connect_listen(component_struct *tc,
513 const char *local_port, component remote_comp,
514 const char *remote_comp_name, const char *remote_port,
515 transport_type_enum transport_type);
516 static void send_connect(component_struct *tc,
517 const char *local_port, component remote_comp,
518 const char *remote_comp_name, const char *remote_port,
519 transport_type_enum transport_type, int remote_address_len,
520 const void *remote_address);
521 static void send_connect_ack(component_struct *tc);
522 static void send_disconnect(component_struct *tc,
523 const char *local_port, component remote_comp, const char *remote_port);
524 static void send_disconnect_ack(component_struct *tc);
525 static void send_map(component_struct *tc,
526 const char *local_port, const char *system_port);
527 static void send_map_ack(component_struct *tc);
528 static void send_unmap(component_struct *tc,
529 const char *local_port, const char *system_port);
530 static void send_unmap_ack(component_struct *tc);
016a1a93
BB
531 static void send_debug_command(int fd, int commandID, const char* arguments);
532 static void send_debug_setup(host_struct *hc);
970ed795
EL
533
534 /* Messages to MTC */
535 static void send_cancel_done_mtc(component component_reference,
536 boolean cancel_any);
537 static void send_component_status_mtc(component component_reference,
538 boolean is_done, boolean is_killed, boolean is_any_done,
539 boolean is_all_done, boolean is_any_killed, boolean is_all_killed,
540 const char *return_type, int return_value_len,
541 const void *return_value);
542 static void send_execute_control(const char *module_name);
543 static void send_execute_testcase(const char *module_name,
544 const char *testcase_name);
545 static void send_ptc_verdict(boolean continue_execution);
546 static void send_continue();
547 static void send_exit_mtc();
b0caada2 548 static void send_configure_mtc(const char *config_file);
970ed795
EL
549
550 /** Messages to PTCs */
551 static void send_cancel_done_ptc(component_struct *tc,
552 component component_reference);
553 static void send_component_status_ptc(component_struct *tc,
554 component component_reference,
555 boolean is_done, boolean is_killed, const char *return_type,
556 int return_value_len, const void *return_value);
557 static void send_start(component_struct *tc,
558 const qualified_name& function_name, int arg_len, const void *arg_ptr);
559 static void send_kill(component_struct *tc);
560
561 static void send_error(int fd, const char *fmt, ...)
562 __attribute__ ((__format__ (__printf__, 2, 3)));
563 static void send_error_str(int fd, const char *reason);
564 static void send_message(int fd, Text_Buf& text_buf);
565
566 /* Incoming messages on unknown connections (generic and first messages) */
567 static void process_error(unknown_connection *conn);
568 static void process_log(unknown_connection *conn);
569 static void process_version(unknown_connection *conn);
570 static void process_mtc_created(unknown_connection *conn);
571 static void process_ptc_created(unknown_connection *conn);
572
573 /* Incoming messages from HCs */
574 static void process_error(host_struct *hc);
575 static void process_log(host_struct *hc);
576 static void process_configure_ack(host_struct *hc);
577 static void process_configure_nak(host_struct *hc);
578 static void process_create_nak(host_struct *hc);
579 static void process_hc_ready(host_struct *hc);
580
581 /* Incoming messages from TCs */
582 static void process_error(component_struct *tc);
583 static void process_log(component_struct *tc);
584 static void process_create_req(component_struct *tc);
585 static void process_start_req(component_struct *tc, int message_end);
586 static void process_stop_req(component_struct *tc);
587 static void process_kill_req(component_struct *tc);
588 static void process_is_running(component_struct *tc);
589 static void process_is_alive(component_struct *tc);
590 static void process_done_req(component_struct *tc);
591 static void process_killed_req(component_struct *tc);
592 static void process_cancel_done_ack(component_struct *tc);
593 static void process_connect_req(component_struct *tc);
594 static void process_connect_listen_ack(component_struct *tc, int message_end);
595 static void process_connected(component_struct *tc);
596 static void process_connect_error(component_struct *tc);
597 static void process_disconnect_req(component_struct *tc);
598 static void process_disconnected(component_struct *tc);
599 static void process_map_req(component_struct *tc);
600 static void process_mapped(component_struct *tc);
601 static void process_unmap_req(component_struct *tc);
602 static void process_unmapped(component_struct *tc);
f08ff9ca
BB
603 static void process_debug_return_value(Text_Buf& text_buf, char* log_source,
604 int msg_end, bool from_mtc);
605 static void process_debug_broadcast_req(component_struct *tc, int commandID);
606 static void process_debug_batch(component_struct *tc);
970ed795
EL
607
608 /* Incoming messages from MTC */
609 static void process_testcase_started();
610 static void process_testcase_finished();
611 static void process_mtc_ready();
b0caada2
BB
612 static void process_configure_ack_mtc();
613 static void process_configure_nak_mtc();
970ed795
EL
614
615 /* Incoming messages from PTCs */
616 static void process_stopped(component_struct *tc, int message_end);
617 static void process_stopped_killed(component_struct *tc, int message_end);
618 static void process_killed(component_struct *tc);
619
620public:
621 static void initialize(UserInterface& par_ui, int par_max_ptcs);
622 static void terminate();
623
624 static void add_host(const char *group_name, const char *host_name);
625 static void assign_component(const char *host_or_group,
626 const char *component_id);
627 static void destroy_host_groups();
628
629 static void set_kill_timer(double timer_val);
630
631 static unsigned short start_session(const char *local_address,
632 unsigned short tcp_port, bool unix_sockets_enabled);
633 static void shutdown_session();
634
635 static void configure(const char *config_file);
b0caada2 636 static bool start_reconfiguring();
970ed795
EL
637
638 static void create_mtc(int host_index);
639 static void exit_mtc();
640
641 static void execute_control(const char *module_name);
642 static void execute_testcase(const char *module_name,
643 const char *testcase_name);
644 static void stop_after_testcase(boolean new_state);
645 static void continue_testcase();
646 static void stop_execution();
016a1a93
BB
647
648 static void debug_command(int commandID, char* arguments);
970ed795
EL
649
650 static mc_state_enum get_state();
651 static boolean get_stop_after_testcase();
652
653 static int get_nof_hosts();
654 static host_struct *get_host_data(int host_index);
655 static component_struct *get_component_data(int component_reference);
656 static void release_data();
657
658 static const char *get_mc_state_name(mc_state_enum state);
659 static const char *get_hc_state_name(hc_state_enum state);
660 static const char *get_tc_state_name(tc_state_enum state);
661 static const char *get_transport_name(transport_type_enum transport);
662};
663
664//----------------------------------------------------------------------------
665
666} /* namespace mctr */
667
668//----------------------------------------------------------------------------
669#endif // MCTR_MAINCONTROLLER_H
670
671// Local Variables:
672// mode: C++
673// indent-tabs-mode: nil
674// c-basic-offset: 2
675// End:
This page took 0.048873 seconds and 5 git commands to generate.