msgr.h (313771e80fd253d4b5472e61a2d12b03c5293aa9) msgr.h (cd1a677cad994021b19665ed476aea63f5d54f31)
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef CEPH_MSGR_H
3#define CEPH_MSGR_H
4
5/*
6 * Data types for message passing layer used by Ceph.
7 */
8
9#define CEPH_MON_PORT 6789 /* default monitor port */
10
11/*
12 * tcp connection banner. include a protocol version. and adjust
13 * whenever the wire protocol changes. try to keep this string length
14 * constant.
15 */
16#define CEPH_BANNER "ceph v027"
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef CEPH_MSGR_H
3#define CEPH_MSGR_H
4
5/*
6 * Data types for message passing layer used by Ceph.
7 */
8
9#define CEPH_MON_PORT 6789 /* default monitor port */
10
11/*
12 * tcp connection banner. include a protocol version. and adjust
13 * whenever the wire protocol changes. try to keep this string length
14 * constant.
15 */
16#define CEPH_BANNER "ceph v027"
17#define CEPH_BANNER_LEN 9
17#define CEPH_BANNER_MAX_LEN 30
18
19
20/*
18#define CEPH_BANNER_MAX_LEN 30
19
20
21/*
22 * messenger V2 connection banner prefix.
23 * The full banner string should have the form: "ceph v2\n<le16>"
24 * the 2 bytes are the length of the remaining banner.
25 */
26#define CEPH_BANNER_V2 "ceph v2\n"
27#define CEPH_BANNER_V2_LEN 8
28#define CEPH_BANNER_V2_PREFIX_LEN (CEPH_BANNER_V2_LEN + sizeof(__le16))
29
30/*
31 * messenger V2 features
32 */
33#define CEPH_MSGR2_INCARNATION_1 (0ull)
34
35#define DEFINE_MSGR2_FEATURE(bit, incarnation, name) \
36 static const uint64_t CEPH_MSGR2_FEATURE_##name = (1ULL << bit); \
37 static const uint64_t CEPH_MSGR2_FEATUREMASK_##name = \
38 (1ULL << bit | CEPH_MSGR2_INCARNATION_##incarnation);
39
40#define HAVE_MSGR2_FEATURE(x, name) \
41 (((x) & (CEPH_MSGR2_FEATUREMASK_##name)) == (CEPH_MSGR2_FEATUREMASK_##name))
42
43DEFINE_MSGR2_FEATURE( 0, 1, REVISION_1) // msgr2.1
44
45#define CEPH_MSGR2_SUPPORTED_FEATURES (CEPH_MSGR2_FEATURE_REVISION_1)
46
47#define CEPH_MSGR2_REQUIRED_FEATURES (CEPH_MSGR2_FEATURE_REVISION_1)
48
49
50/*
21 * Rollover-safe type and comparator for 32-bit sequence numbers.
22 * Comparator returns -1, 0, or 1.
23 */
24typedef __u32 ceph_seq_t;
25
26static inline __s32 ceph_seq_cmp(__u32 a, __u32 b)
27{
28 return (__s32)a - (__s32)b;

--- 124 unchanged lines hidden (view full) ---

153 receiver: mask against ~PAGE_MASK */
154
155 struct ceph_entity_name src;
156 __le16 compat_version;
157 __le16 reserved;
158 __le32 crc; /* header crc32c */
159} __attribute__ ((packed));
160
51 * Rollover-safe type and comparator for 32-bit sequence numbers.
52 * Comparator returns -1, 0, or 1.
53 */
54typedef __u32 ceph_seq_t;
55
56static inline __s32 ceph_seq_cmp(__u32 a, __u32 b)
57{
58 return (__s32)a - (__s32)b;

--- 124 unchanged lines hidden (view full) ---

183 receiver: mask against ~PAGE_MASK */
184
185 struct ceph_entity_name src;
186 __le16 compat_version;
187 __le16 reserved;
188 __le32 crc; /* header crc32c */
189} __attribute__ ((packed));
190
191struct ceph_msg_header2 {
192 __le64 seq; /* message seq# for this session */
193 __le64 tid; /* transaction id */
194 __le16 type; /* message type */
195 __le16 priority; /* priority. higher value == higher priority */
196 __le16 version; /* version of message encoding */
197
198 __le32 data_pre_padding_len;
199 __le16 data_off; /* sender: include full offset;
200 receiver: mask against ~PAGE_MASK */
201
202 __le64 ack_seq;
203 __u8 flags;
204 /* oldest code we think can decode this. unknown if zero. */
205 __le16 compat_version;
206 __le16 reserved;
207} __attribute__ ((packed));
208
161#define CEPH_MSG_PRIO_LOW 64
162#define CEPH_MSG_PRIO_DEFAULT 127
163#define CEPH_MSG_PRIO_HIGH 196
164#define CEPH_MSG_PRIO_HIGHEST 255
165
166/*
167 * follows data payload
168 */

--- 18 unchanged lines hidden ---
209#define CEPH_MSG_PRIO_LOW 64
210#define CEPH_MSG_PRIO_DEFAULT 127
211#define CEPH_MSG_PRIO_HIGH 196
212#define CEPH_MSG_PRIO_HIGHEST 255
213
214/*
215 * follows data payload
216 */

--- 18 unchanged lines hidden ---