26 #ifndef _MCA_OOB_TCP_H_
27 #define _MCA_OOB_TCP_H_
29 #include "orte_config.h"
31 #ifdef HAVE_SYS_TYPES_H
32 #include <sys/types.h>
34 #ifdef HAVE_SYS_SOCKET_H
35 #include <sys/socket.h>
40 #include "opal/mca/base/base.h"
41 #include "opal/class/opal_free_list.h"
44 #include "opal/threads/condition.h"
45 #include "opal/threads/threads.h"
46 #include "opal/mca/timer/base/base.h"
57 #define OOB_TCP_DEBUG_CONNECT_FAIL 1
58 #define OOB_TCP_DEBUG_CONNECT 2
59 #define OOB_TCP_DEBUG_INFO 3
60 #define OOB_TCP_DEBUG_ALL 4
67 mca_oob_t* mca_oob_tcp_component_init(
int* priority);
180 struct sockaddr* inaddr
189 int mca_oob_tcp_ft_event(
int state);
191 typedef enum { OOB_TCP_EVENT, OOB_TCP_LISTEN_THREAD } mca_oob_tcp_listen_type_t;
218 unsigned short tcp6_listen_port;
219 char** tcp6_static_ports;
220 char** tcp6_dyn_ports;
233 mca_oob_tcp_listen_type_t tcp_listen_type;
241 int tcp_connections_pipe[2];
259 extern int mca_oob_tcp_output_handle;
261 #if defined(__WINDOWS__)
262 #define CLOSE_THE_SOCKET(socket) closesocket(socket)
265 #define CLOSE_THE_SOCKET(socket) \
267 shutdown(socket, 2); \
opal_hash_table_t tcp_peer_names
cache of peer contact info sorted by name
Definition: oob_tcp.h:202
opal_list_t tcp_msg_completed
list of completed messages
Definition: oob_tcp.h:226
Definition: opal_hash_table.h:42
void mca_oob_tcp_set_socket_options(int sd)
Setup socket options.
Definition: oob_tcp_peer.c:1189
char * mca_oob_tcp_get_addr(void)
Obtain contact information for this host (e.g.
Definition: oob_tcp.c:1934
opal_mutex_t tcp_match_lock
lock held while searching/posting messages
Definition: oob_tcp.h:227
int tcp_rcvbuf
socket recv buffer size
Definition: oob_tcp.h:207
opal_list_t tcp_connections_return
List of connection fragments being returned to accept thread.
Definition: oob_tcp.h:239
opal_condition_t tcp_match_cond
condition variable used in finalize
Definition: oob_tcp.h:228
Contains the internal functions and typedefs for the use of the oob.
int mca_oob_tcp_fini(void)
Cleanup resources during shutdown.
Definition: oob_tcp.c:1847
Definition: condition.h:49
opal_hash_table_t tcp_peers
peers sorted by name
Definition: oob_tcp.h:201
opal_event_t tcp_recv_event
event structure for IPv4 recvs
Definition: oob_tcp.h:209
opal_list_t tcp_msg_post
list of recieves user has posted
Definition: oob_tcp.h:224
opal_list_t tcp_msg_recv
list of recieved messages
Definition: oob_tcp.h:225
unsigned short tcp_listen_port
IPv4 listen port.
Definition: oob_tcp.h:211
Structure to represent a single event.
Definition: event_struct.h:87
struct timeval tcp_listen_thread_tv
Timeout when using listen thread.
Definition: oob_tcp.h:247
Contains the data structure which describes each connection.
Definition: mutex_unix.h:53
int disable_family
disable AF: 0-nothing, 4-IPv4, 6-IPv6
Definition: oob_tcp.h:214
opal_free_list_t tcp_msgs
free list of messages
Definition: oob_tcp.h:208
int tcp_peer_limit
max size of tcp peer cache
Definition: oob_tcp.h:204
int mca_oob_tcp_recv_cancel(orte_process_name_t *peer, int tag)
Cancel non-blocking receive.
Definition: oob_tcp_recv.c:173
int tcp_match_count
number of matched recvs in progress
Definition: oob_tcp.h:229
char ** tcp4_dyn_ports
Dynamic ports - IPV4.
Definition: oob_tcp.h:213
int tcp_listen_thread_num_sockets
Number of sockets in tcp_listen_thread_sds.
Definition: oob_tcp.h:245
opal_list_t tcp_peer_list
list of peers sorted in mru order
Definition: oob_tcp.h:200
Definition: opal_list.h:98
int mca_oob_tcp_set_addr(const orte_process_name_t *, const char *)
Setup cached addresses for the peers.
Definition: oob_tcp.c:2084
int mca_oob_tcp_process_name_compare(const orte_process_name_t *n1, const orte_process_name_t *n2)
Compare two process names for equality.
Definition: oob_tcp.c:1924
void(* orte_rml_callback_fn_t)(int status, struct orte_process_name_t *peer, struct iovec *msg, int count, orte_rml_tag_t tag, void *cbdata)
Funtion prototype for callback from non-blocking iovec send and receive.
Definition: rml.h:123
int mca_oob_tcp_parse_uri(const char *uri, struct sockaddr *inaddr)
Parse a URI string into an IP address and port number.
Definition: oob_tcp.c:1971
Definition: opal_free_list.h:47
opal_free_list_t tcp_peer_free
free list of peers
Definition: oob_tcp.h:203
contains the data structure we will use to describe a message
int mca_oob_tcp_recv_nb(orte_process_name_t *peer, struct iovec *msg, int count, int tag, int flags, orte_rml_callback_fn_t cbfunc, void *cbdata)
Non-blocking version of mca_oob_recv().
Definition: oob_tcp_recv.c:92
Definition: opal_free_list.h:31
int tcp_sndbuf
socket send buffer size
Definition: oob_tcp.h:206
int mca_oob_tcp_ping(const orte_process_name_t *, const char *uri, const struct timeval *tv)
A routine to ping a given process name to determine if it is reachable.
Definition: oob_tcp_ping.c:79
char * tcp_exclude
list of ip interfaces to exclude
Definition: oob_tcp.h:199
Definition: oob_tcp.h:274
char ** tcp4_static_ports
Static ports - IPV4.
Definition: oob_tcp.h:212
Definition: util-internal.h:214
A hash table that may be indexed with either fixed length (e.g.
int tcp_listen_sd
listen socket for incoming IPv4 connection requests
Definition: oob_tcp.h:210
int tcp_copy_max_size
Max size of the copy list before copying must commence.
Definition: oob_tcp.h:244
Definition: ompi_uio.h:29
int mca_oob_tcp_resolve(mca_oob_tcp_peer_t *)
Attempt to map a peer name to its corresponding address.
Definition: oob_tcp.c:1586
int tcp_peer_retries
max number of retries before declaring peer gone
Definition: oob_tcp.h:205
opal_list_t tcp_events
list of pending events (accepts)
Definition: oob_tcp.h:223
This structure describes a peer.
Definition: oob_tcp_peer.h:59
Definition: opal_list.h:147
OOB TCP Component.
Definition: oob_tcp.h:196
OOB Module.
Definition: oob.h:161
opal_mutex_t tcp_lock
lock for accessing module state
Definition: oob_tcp.h:222
opal_mutex_t tcp_connections_lock
Lock protecting pending_connections and connections_return.
Definition: oob_tcp.h:240
mca_oob_base_component_2_0_0_t super
base OOB component
Definition: oob_tcp.h:197
Definition: oob_tcp.h:282
opal_list_t tcp_pending_connections
handle to the listening thread
Definition: oob_tcp.h:238
int mca_oob_tcp_init(void)
Hook function to allow the selected oob components to register their contact info with the registry...
Definition: oob_tcp.c:1719
int tcp_listen_thread_sds[2]
Room for IPv4 and IPv6.
Definition: oob_tcp.h:246
Mutual exclusion functions.
int tcp_debug
debug level
Definition: oob_tcp.h:230
char * tcp_include
list of ip interfaces to include
Definition: oob_tcp.h:198
#define OBJ_CLASS_DECLARATION(NAME)
Declaration for class descriptor.
Definition: opal_object.h:236