This source file includes following definitions.
- ceph_seq_cmp
1
2 #ifndef CEPH_MSGR_H
3 #define CEPH_MSGR_H
4
5
6
7
8
9 #define CEPH_MON_PORT 6789
10
11
12
13
14
15
16 #define CEPH_PORT_FIRST 6789
17 #define CEPH_PORT_START 6800
18 #define CEPH_PORT_LAST 6900
19
20
21
22
23
24
25 #define CEPH_BANNER "ceph v027"
26 #define CEPH_BANNER_MAX_LEN 30
27
28
29
30
31
32
33 typedef __u32 ceph_seq_t;
34
35 static inline __s32 ceph_seq_cmp(__u32 a, __u32 b)
36 {
37 return (__s32)a - (__s32)b;
38 }
39
40
41
42
43
44
45 struct ceph_entity_name {
46 __u8 type;
47 __le64 num;
48 } __attribute__ ((packed));
49
50 #define CEPH_ENTITY_TYPE_MON 0x01
51 #define CEPH_ENTITY_TYPE_MDS 0x02
52 #define CEPH_ENTITY_TYPE_OSD 0x04
53 #define CEPH_ENTITY_TYPE_CLIENT 0x08
54 #define CEPH_ENTITY_TYPE_AUTH 0x20
55
56 #define CEPH_ENTITY_TYPE_ANY 0xFF
57
58 extern const char *ceph_entity_type_name(int type);
59
60
61
62
63 struct ceph_entity_addr {
64 __le32 type;
65 __le32 nonce;
66 struct sockaddr_storage in_addr;
67 } __attribute__ ((packed));
68
69 struct ceph_entity_inst {
70 struct ceph_entity_name name;
71 struct ceph_entity_addr addr;
72 } __attribute__ ((packed));
73
74
75
76 #define CEPH_MSGR_TAG_READY 1
77 #define CEPH_MSGR_TAG_RESETSESSION 2
78 #define CEPH_MSGR_TAG_WAIT 3
79
80 #define CEPH_MSGR_TAG_RETRY_SESSION 4
81
82 #define CEPH_MSGR_TAG_RETRY_GLOBAL 5
83
84 #define CEPH_MSGR_TAG_CLOSE 6
85 #define CEPH_MSGR_TAG_MSG 7
86 #define CEPH_MSGR_TAG_ACK 8
87 #define CEPH_MSGR_TAG_KEEPALIVE 9
88 #define CEPH_MSGR_TAG_BADPROTOVER 10
89 #define CEPH_MSGR_TAG_BADAUTHORIZER 11
90 #define CEPH_MSGR_TAG_FEATURES 12
91 #define CEPH_MSGR_TAG_SEQ 13
92 #define CEPH_MSGR_TAG_KEEPALIVE2 14
93 #define CEPH_MSGR_TAG_KEEPALIVE2_ACK 15
94 #define CEPH_MSGR_TAG_CHALLENGE_AUTHORIZER 16
95
96
97
98
99 struct ceph_msg_connect {
100 __le64 features;
101 __le32 host_type;
102 __le32 global_seq;
103 __le32 connect_seq;
104 __le32 protocol_version;
105 __le32 authorizer_protocol;
106 __le32 authorizer_len;
107 __u8 flags;
108 } __attribute__ ((packed));
109
110 struct ceph_msg_connect_reply {
111 __u8 tag;
112 __le64 features;
113 __le32 global_seq;
114 __le32 connect_seq;
115 __le32 protocol_version;
116 __le32 authorizer_len;
117 __u8 flags;
118 } __attribute__ ((packed));
119
120 #define CEPH_MSG_CONNECT_LOSSY 1
121
122
123
124
125
126 struct ceph_msg_header_old {
127 __le64 seq;
128 __le64 tid;
129 __le16 type;
130 __le16 priority;
131 __le16 version;
132
133 __le32 front_len;
134 __le32 middle_len;
135 __le32 data_len;
136 __le16 data_off;
137
138
139 struct ceph_entity_inst src, orig_src;
140 __le32 reserved;
141 __le32 crc;
142 } __attribute__ ((packed));
143
144 struct ceph_msg_header {
145 __le64 seq;
146 __le64 tid;
147 __le16 type;
148 __le16 priority;
149 __le16 version;
150
151 __le32 front_len;
152 __le32 middle_len;
153 __le32 data_len;
154 __le16 data_off;
155
156
157 struct ceph_entity_name src;
158 __le16 compat_version;
159 __le16 reserved;
160 __le32 crc;
161 } __attribute__ ((packed));
162
163 #define CEPH_MSG_PRIO_LOW 64
164 #define CEPH_MSG_PRIO_DEFAULT 127
165 #define CEPH_MSG_PRIO_HIGH 196
166 #define CEPH_MSG_PRIO_HIGHEST 255
167
168
169
170
171 struct ceph_msg_footer_old {
172 __le32 front_crc, middle_crc, data_crc;
173 __u8 flags;
174 } __attribute__ ((packed));
175
176 struct ceph_msg_footer {
177 __le32 front_crc, middle_crc, data_crc;
178
179 __le64 sig;
180 __u8 flags;
181 } __attribute__ ((packed));
182
183 #define CEPH_MSG_FOOTER_COMPLETE (1<<0)
184 #define CEPH_MSG_FOOTER_NOCRC (1<<1)
185 #define CEPH_MSG_FOOTER_SIGNED (1<<2)
186
187
188 #endif