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