OpenMPI  0.1.1
oob_tcp_hdr.h
Go to the documentation of this file.
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-2005 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$
13  *
14  * Additional copyrights may follow
15  *
16  * $HEADER$
17  */
18 /** @file:
19  *
20  * Contains header used by tcp oob.
21  */
22 
23 #ifndef _MCA_OOB_TCP_HDR_H_
24 #define _MCA_OOB_TCP_HDR_H_
25 
26 #include "orte_config.h"
27 #include "orte/types.h"
28 
29 BEGIN_C_DECLS
30 
31 #define MCA_OOB_TCP_PROBE 1
32 #define MCA_OOB_TCP_CONNECT 2
33 #define MCA_OOB_TCP_IDENT 3
34 #define MCA_OOB_TCP_DATA 4
35 #define MCA_OOB_TCP_PING 5
36 
37 /**
38  * Header used by tcp oob protocol.
39  */
41  orte_process_name_t msg_origin;
42  orte_process_name_t msg_src;
43  orte_process_name_t msg_dst;
44  uint32_t msg_type; /**< type of message */
45  uint32_t msg_size; /**< the total size of the message body - excluding header */
46  int32_t msg_tag; /**< user provided tag */
47 };
49 
50 /**
51  * Convert the message header to host byte order
52  */
53 #define MCA_OOB_TCP_HDR_NTOH(h) \
54  ORTE_PROCESS_NAME_NTOH((h)->msg_origin); \
55  ORTE_PROCESS_NAME_NTOH((h)->msg_src); \
56  ORTE_PROCESS_NAME_NTOH((h)->msg_dst); \
57  (h)->msg_type = ntohl((h)->msg_type); \
58  (h)->msg_size = ntohl((h)->msg_size); \
59  (h)->msg_tag = ntohl((h)->msg_tag);
60 
61 /**
62  * Convert the message header to network byte order
63  */
64 #define MCA_OOB_TCP_HDR_HTON(h) \
65  ORTE_PROCESS_NAME_HTON((h)->msg_origin); \
66  ORTE_PROCESS_NAME_HTON((h)->msg_src); \
67  ORTE_PROCESS_NAME_HTON((h)->msg_dst); \
68  (h)->msg_type = htonl((h)->msg_type); \
69  (h)->msg_size = htonl((h)->msg_size); \
70  (h)->msg_tag = htonl((h)->msg_tag);
71 
72 END_C_DECLS
73 
74 #endif /* _MCA_OOB_TCP_MESSAGE_H_ */
75 
uint32_t msg_type
type of message
Definition: oob_tcp_hdr.h:44
Definition: types.h:146
Header used by tcp oob protocol.
Definition: oob_tcp_hdr.h:40
uint32_t msg_size
the total size of the message body - excluding header
Definition: oob_tcp_hdr.h:45
int32_t msg_tag
user provided tag
Definition: oob_tcp_hdr.h:46