1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 #ifndef _MCA_OOB_TCP_COMPONENT_H_
24 #define _MCA_OOB_TCP_COMPONENT_H_
25
26 #include "orte_config.h"
27
28 #ifdef HAVE_SYS_TIME_H
29 #include <sys/time.h>
30 #endif
31
32 #include "opal/class/opal_bitmap.h"
33 #include "opal/class/opal_list.h"
34 #include "opal/class/opal_pointer_array.h"
35 #include "opal/class/opal_hash_table.h"
36 #include "opal/mca/event/event.h"
37
38 #include "orte/mca/oob/oob.h"
39 #include "oob_tcp.h"
40
41
42
43
44 typedef struct {
45 mca_oob_base_component_t super;
46 uint32_t addr_count;
47 int num_links;
48 int max_retries;
49 opal_list_t events;
50 int peer_limit;
51 opal_pointer_array_t ev_bases;
52 char** ev_threads;
53 int next_base;
54 opal_hash_table_t peers;
55
56
57 char* if_include;
58 char* if_exclude;
59 int tcp_sndbuf;
60 int tcp_rcvbuf;
61
62
63 bool disable_ipv4_family;
64 char** tcp_static_ports;
65 char** tcp_dyn_ports;
66 char** ipv4conns;
67 char** ipv4ports;
68
69
70 bool disable_ipv6_family;
71 char** tcp6_static_ports;
72 char** tcp6_dyn_ports;
73 char** ipv6conns;
74 char** ipv6ports;
75
76
77 char* my_uri;
78 int num_hnp_ports;
79 opal_list_t listeners;
80 opal_thread_t listen_thread;
81 bool listen_thread_active;
82 struct timeval listen_thread_tv;
83 int stop_thread[2];
84 int keepalive_probes;
85 int keepalive_time;
86 int keepalive_intvl;
87 int retry_delay;
88 int max_recon_attempts;
89 } mca_oob_tcp_component_t;
90
91 ORTE_MODULE_DECLSPEC extern mca_oob_tcp_component_t mca_oob_tcp_component;
92
93 ORTE_MODULE_DECLSPEC void mca_oob_tcp_component_set_module(int fd, short args, void *cbdata);
94 ORTE_MODULE_DECLSPEC void mca_oob_tcp_component_lost_connection(int fd, short args, void *cbdata);
95 ORTE_MODULE_DECLSPEC void mca_oob_tcp_component_failed_to_connect(int fd, short args, void *cbdata);
96 ORTE_MODULE_DECLSPEC void mca_oob_tcp_component_no_route(int fd, short args, void *cbdata);
97 ORTE_MODULE_DECLSPEC void mca_oob_tcp_component_hop_unknown(int fd, short args, void *cbdata);
98
99 #define ORTE_OOB_TCP_NEXT_BASE(p) \
100 do { \
101 ++mca_oob_tcp_component.next_base; \
102 if (orte_oob_base.num_threads <= mca_oob_tcp_component.next_base) { \
103 mca_oob_tcp_component.next_base = 0; \
104 } \
105 (p)->ev_base = (opal_event_base_t*)opal_pointer_array_get_item(&mca_oob_tcp_component.ev_bases, mca_oob_tcp_component.next_base); \
106 } while(0)
107
108 #endif