aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/msgr.h
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-11-18 19:19:57 -0500
committerSage Weil <sage@newdream.net>2009-11-18 19:19:57 -0500
commit4e7a5dcd1bbab6560fbc8ada29a840e7a20ed7bc (patch)
treea77e9b4563022340361ca673ef2e1beebb538e2f /fs/ceph/msgr.h
parent5f44f142601bf94c448e2d463f0f18fd159da164 (diff)
ceph: negotiate authentication protocol; implement AUTH_NONE protocol
When we open a monitor session, we send an initial AUTH message listing the auth protocols we support, our entity name, and (possibly) a previously assigned global_id. The monitor chooses a protocol and responds with an initial message. Initially implement AUTH_NONE, a dummy protocol that provides no security, but works within the new framework. It generates 'authorizers' that are used when connecting to (mds, osd) services that simply state our entity name and global_id. This is a wire protocol change. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/msgr.h')
-rw-r--r--fs/ceph/msgr.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/fs/ceph/msgr.h b/fs/ceph/msgr.h
index 8e3ea2eb1bf5..c758e8f8f71b 100644
--- a/fs/ceph/msgr.h
+++ b/fs/ceph/msgr.h
@@ -21,7 +21,7 @@
21 * whenever the wire protocol changes. try to keep this string length 21 * whenever the wire protocol changes. try to keep this string length
22 * constant. 22 * constant.
23 */ 23 */
24#define CEPH_BANNER "ceph v023" 24#define CEPH_BANNER "ceph v024"
25#define CEPH_BANNER_MAX_LEN 30 25#define CEPH_BANNER_MAX_LEN 30
26 26
27 27
@@ -46,11 +46,16 @@ struct ceph_entity_name {
46 __le64 num; 46 __le64 num;
47} __attribute__ ((packed)); 47} __attribute__ ((packed));
48 48
49#define CEPH_ENTITY_TYPE_MON 1 49#define CEPH_ENTITY_TYPE_MON 0x01
50#define CEPH_ENTITY_TYPE_MDS 2 50#define CEPH_ENTITY_TYPE_MDS 0x02
51#define CEPH_ENTITY_TYPE_OSD 3 51#define CEPH_ENTITY_TYPE_OSD 0x04
52#define CEPH_ENTITY_TYPE_CLIENT 4 52#define CEPH_ENTITY_TYPE_CLIENT 0x08
53#define CEPH_ENTITY_TYPE_ADMIN 5 53#define CEPH_ENTITY_TYPE_ADMIN 0x10
54#define CEPH_ENTITY_TYPE_AUTH 0x20
55
56#define CEPH_ENTITY_TYPE_ANY 0xFF
57
58extern const char *ceph_entity_type_name(int type);
54 59
55/* 60/*
56 * entity_addr -- network address 61 * entity_addr -- network address
@@ -94,6 +99,7 @@ struct ceph_entity_inst {
94#define CEPH_MSGR_TAG_ACK 8 /* message ack */ 99#define CEPH_MSGR_TAG_ACK 8 /* message ack */
95#define CEPH_MSGR_TAG_KEEPALIVE 9 /* just a keepalive byte! */ 100#define CEPH_MSGR_TAG_KEEPALIVE 9 /* just a keepalive byte! */
96#define CEPH_MSGR_TAG_BADPROTOVER 10 /* bad protocol version */ 101#define CEPH_MSGR_TAG_BADPROTOVER 10 /* bad protocol version */
102#define CEPH_MSGR_TAG_BADAUTHORIZER 11 /* bad authorizer */
97 103
98 104
99/* 105/*
@@ -104,6 +110,8 @@ struct ceph_msg_connect {
104 __le32 global_seq; /* count connections initiated by this host */ 110 __le32 global_seq; /* count connections initiated by this host */
105 __le32 connect_seq; /* count connections initiated in this session */ 111 __le32 connect_seq; /* count connections initiated in this session */
106 __le32 protocol_version; 112 __le32 protocol_version;
113 __le32 authorizer_protocol;
114 __le32 authorizer_len;
107 __u8 flags; /* CEPH_MSG_CONNECT_* */ 115 __u8 flags; /* CEPH_MSG_CONNECT_* */
108} __attribute__ ((packed)); 116} __attribute__ ((packed));
109 117
@@ -112,6 +120,7 @@ struct ceph_msg_connect_reply {
112 __le32 global_seq; 120 __le32 global_seq;
113 __le32 connect_seq; 121 __le32 connect_seq;
114 __le32 protocol_version; 122 __le32 protocol_version;
123 __le32 authorizer_len;
115 __u8 flags; 124 __u8 flags;
116} __attribute__ ((packed)); 125} __attribute__ ((packed));
117 126