File: btl_tcp_addr.h

package info (click to toggle)
openmpi 5.0.8-4
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 201,684 kB
  • sloc: ansic: 613,078; makefile: 42,353; sh: 11,194; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,179; python: 1,859; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (93 lines) | stat: -rw-r--r-- 3,253 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
 *                         University Research and Technology
 *                         Corporation.  All rights reserved.
 * Copyright (c) 2004-2007 The University of Tennessee and The University
 *                         of Tennessee Research Foundation.  All rights
 *                         reserved.
 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
 *                         University of Stuttgart.  All rights reserved.
 * Copyright (c) 2004-2005 The Regents of the University of California.
 *                         All rights reserved.
 * Copyright (c) 2019      Amazon.com, Inc. or its affiliates.  All Rights
 *                         reserved.
 *
 * $COPYRIGHT$
 *
 * Additional copyrights may follow
 *
 * $HEADER$
 */
/**
 * @file
 */
#ifndef MCA_BTL_TCP_ADDR_H
#define MCA_BTL_TCP_ADDR_H

#ifdef HAVE_SYS_TYPES_H
#    include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#    include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#    include <netinet/in.h>
#endif
#include <assert.h>

/**
 * Modex address structure.
 *
 * One of these structures will be sent for every btl module in use by
 * the local BTL TCP component. This is used to construct an opal_if_t
 * structure for the reachability component as well as populate the
 * mca_btl_tcp_addr_t structure on remote procs. These will be used
 * for interface matching and filling out the mca_btl_base_endpoint_t
 * structure.
 */
struct mca_btl_tcp_modex_addr_t {
    uint8_t addr[16];        /* endpoint address.  for addr_family
                                of MCA_BTL_TCP_AF_INET, only the
                                first 4 bytes have meaning. */
    uint32_t addr_ifkindex;  /* endpoint kernel index */
    uint32_t addr_mask;      /* ip mask */
    uint32_t addr_bandwidth; /* interface bandwidth */
    uint16_t addr_port;      /* endpoint listen port */
    uint8_t addr_family;     /* endpoint address family.  Note that
                                this is
                                MCA_BTL_TCP_AF_{INET,INET6}, not
                                the traditional
                                AF_INET/AF_INET6. */
    uint8_t padding[1];      /* pad out to an 8-byte word */
};
typedef struct mca_btl_tcp_modex_addr_t mca_btl_tcp_modex_addr_t;

#if (__STDC_VERSION__ >= 201112L)
_Static_assert(sizeof(struct mca_btl_tcp_modex_addr_t) == 32, "mca_btl_tcp_modex_addr_t");
#endif

/**
 * Remote peer address structure
 *
 * One of these structures will be allocated for every remote endpoint
 * associated with a remote proc.  The data is pulled from the
 * mca_btl_tcp_modex_addr_t structure.
 */
struct mca_btl_tcp_addr_t {
    union {
        struct in_addr addr_inet; /* IPv6 listen address */
#if OPAL_ENABLE_IPV6
        struct in6_addr addr_inet6; /* IPv6 listen address */
#endif
    } addr_union;
    in_port_t addr_port; /**< listen port */
    int addr_ifkindex;   /**< remote interface index assigned with
                              this address */
    uint8_t addr_family; /**< AF_INET or AF_INET6 */
};
typedef struct mca_btl_tcp_addr_t mca_btl_tcp_addr_t;

#define MCA_BTL_TCP_AF_INET  0
#define MCA_BTL_TCP_AF_INET6 1

#endif