@@ -104,6 +104,8 @@ extern int ceph_handle_auth_reply(struct ceph_auth_client *ac,
void *buf, size_t len,
void *reply_buf, size_t reply_len);
extern int ceph_entity_name_encode(const char *name, void **p, void *end);
+extern int ceph_entity_name_decode(struct ceph_entity_name *name, void **p,
+ void *end);
extern int ceph_build_auth(struct ceph_auth_client *ac,
void *msg_buf, size_t msg_len);
@@ -94,6 +94,17 @@ int ceph_entity_name_encode(const char *name, void **p, void *end)
return 0;
}
+int ceph_entity_name_decode(struct ceph_entity_name *name, void **p, void *end)
+{
+ ceph_decode_8_safe(p, end, name->type, bad);
+ ceph_decode_64_safe(p, end, name->num, bad);
+
+ return 0;
+
+bad:
+ return -ERANGE;
+}
+
/*
* Initiate protocol negotiation with monitor. Include entity name
* and list supported protocols.
Signed-off-by: Douglas Fuller <dfuller@redhat.com> --- include/linux/ceph/auth.h | 2 ++ net/ceph/auth.c | 11 +++++++++++ 2 files changed, 13 insertions(+)