1 /*
2 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3 * University Research and Technology
4 * Corporation. All rights reserved.
5 * Copyright (c) 2004-2007 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) 2011 Cisco Systems, Inc. All rights reserved.
13 * $COPYRIGHT$
14 *
15 * Additional copyrights may follow
16 *
17 * $HEADER$
18 */
19 /**
20 * @file
21 */
22 #ifndef MCA_BTL_TCP_ADDR_H
23 #define MCA_BTL_TCP_ADDR_H
24
25 #ifdef HAVE_SYS_TYPES_H
26 #include <sys/types.h>
27 #endif
28 #ifdef HAVE_SYS_SOCKET_H
29 #include <sys/socket.h>
30 #endif
31 #ifdef HAVE_NETINET_IN_H
32 #include <netinet/in.h>
33 #endif
34
35
36 /**
37 * Structure used to publish TCP connection information to peers.
38 */
39
40 struct mca_btl_tcp2_addr_t {
41 /* the following information is exchanged between different
42 machines (read: byte order), so use network byte order
43 for everything and don't add padding
44 */
45 #if OPAL_ENABLE_IPV6
46 struct in6_addr addr_inet; /**< IPv4/IPv6 listen address > */
47 #else
48 /* Bug, FIXME: needs testing */
49 struct my_in6_addr {
50 union {
51 uint32_t u6_addr32[4];
52 struct _my_in6_addr {
53 struct in_addr _addr_inet;
54 uint32_t _pad[3];
55 } _addr__inet;
56 } _union_inet;
57 } addr_inet;
58 #endif
59 in_port_t addr_port; /**< listen port */
60 uint16_t addr_ifkindex; /**< remote interface index assigned with
61 this address */
62 unsigned short addr_inuse; /**< local meaning only */
63 uint8_t addr_family; /**< AF_INET or AF_INET6 */
64 };
65 typedef struct mca_btl_tcp2_addr_t mca_btl_tcp2_addr_t;
66
67 #define MCA_BTL_TCP_AF_INET 0
68 #if OPAL_ENABLE_IPV6
69 # define MCA_BTL_TCP_AF_INET6 1
70 #endif
71
72 #endif
73