1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #ifndef MCA_BTL_TCP_HDR_H
21 #define MCA_BTL_TCP_HDR_H
22
23
24 #include "ompi_config.h"
25 #include "ompi/mca/btl/base/base.h"
26 #include "btl_tcp2.h"
27
28 BEGIN_C_DECLS
29
30
31
32
33
34 #define MCA_BTL_TCP_HDR_TYPE_SEND 1
35 #define MCA_BTL_TCP_HDR_TYPE_PUT 2
36 #define MCA_BTL_TCP_HDR_TYPE_GET 3
37
38 struct mca_btl_tcp2_hdr_t {
39 mca_btl_base_header_t base;
40 uint8_t type;
41 uint16_t count;
42 uint32_t size;
43 };
44 typedef struct mca_btl_tcp2_hdr_t mca_btl_tcp2_hdr_t;
45
46 #define MCA_BTL_TCP_HDR_HTON(hdr) \
47 do { \
48 hdr.count = htons(hdr.count); \
49 hdr.size = htonl(hdr.size); \
50 } while (0)
51
52 #define MCA_BTL_TCP_HDR_NTOH(hdr) \
53 do { \
54 hdr.count = ntohs(hdr.count); \
55 hdr.size = ntohl(hdr.size); \
56 } while (0)
57
58 END_C_DECLS
59 #endif