root/orte/mca/oob/tcp/oob_tcp.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2006 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
   9  *                         University of Stuttgart.  All rights reserved.
  10  * Copyright (c) 2004-2005 The Regents of the University of California.
  11  *                         All rights reserved.
  12  * Copyright (c) 2006-2013 Los Alamos National Security, LLC.
  13  *                         All rights reserved.
  14  * Copyright (c) 2010-2011 Cisco Systems, Inc.  All rights reserved.
  15  * Copyright (c) 2014-2017 Intel, Inc.  All rights reserved.
  16  * $COPYRIGHT$
  17  *
  18  * Additional copyrights may follow
  19  *
  20  * $HEADER$
  21  */
  22 
  23 #ifndef _MCA_OOB_TCP_H_
  24 #define _MCA_OOB_TCP_H_
  25 
  26 #include "orte_config.h"
  27 
  28 #include "orte/types.h"
  29 
  30 #include "opal/mca/base/base.h"
  31 #include "opal/class/opal_free_list.h"
  32 #include "opal/class/opal_hash_table.h"
  33 #include "opal/mca/event/event.h"
  34 
  35 #include "orte/mca/oob/oob.h"
  36 #include "orte/mca/oob/base/base.h"
  37 
  38 
  39 BEGIN_C_DECLS
  40 
  41 /* define some debug levels */
  42 #define OOB_TCP_DEBUG_FAIL      2
  43 #define OOB_TCP_DEBUG_CONNECT   7
  44 
  45 /* forward declare a couple of structures */
  46 struct mca_oob_tcp_module_t;
  47 struct mca_oob_tcp_msg_error_t;
  48 
  49 /* define a struct for tracking NIC addresses */
  50 typedef struct {
  51     opal_list_item_t super;
  52     uint16_t af_family;
  53     struct sockaddr addr;
  54 } mca_oob_tcp_nicaddr_t;
  55 OBJ_CLASS_DECLARATION(mca_oob_tcp_nicaddr_t);
  56 
  57 /* Module definition */
  58 typedef void (*mca_oob_tcp_module_accept_connection_fn_t)(const int accepted_fd,
  59                                                           const struct sockaddr *addr);
  60 typedef void (*mca_oob_tcp_module_ping_fn_t)(const orte_process_name_t *proc);
  61 typedef void (*mca_oob_tcp_module_send_nb_fn_t)(orte_rml_send_t *msg);
  62 typedef void (*mca_oob_tcp_module_ft_event_fn_t)(int state);
  63 
  64 typedef struct {
  65     mca_oob_tcp_module_accept_connection_fn_t  accept_connection;
  66     mca_oob_tcp_module_ping_fn_t               ping;
  67     mca_oob_tcp_module_send_nb_fn_t            send_nb;
  68     mca_oob_tcp_module_ft_event_fn_t           ft_event;
  69 } mca_oob_tcp_module_t;
  70 ORTE_MODULE_DECLSPEC extern mca_oob_tcp_module_t mca_oob_tcp_module;
  71 
  72 /**
  73  * the state of the connection
  74  */
  75 typedef enum {
  76     MCA_OOB_TCP_UNCONNECTED,
  77     MCA_OOB_TCP_CLOSED,
  78     MCA_OOB_TCP_RESOLVE,
  79     MCA_OOB_TCP_CONNECTING,
  80     MCA_OOB_TCP_CONNECT_ACK,
  81     MCA_OOB_TCP_CONNECTED,
  82     MCA_OOB_TCP_FAILED,
  83     MCA_OOB_TCP_ACCEPTING
  84 } mca_oob_tcp_state_t;
  85 
  86 /* module-level shared functions */
  87 ORTE_MODULE_DECLSPEC void mca_oob_tcp_send_handler(int fd, short args, void *cbdata);
  88 ORTE_MODULE_DECLSPEC void mca_oob_tcp_recv_handler(int fd, short args, void *cbdata);
  89 ORTE_MODULE_DECLSPEC void mca_oob_tcp_queue_msg(int sd, short args, void *cbdata);
  90 
  91 
  92 END_C_DECLS
  93 
  94 #endif /* MCA_OOB_TCP_H_ */

/* [<][>][^][v][top][bottom][index][help] */