From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- src/cls/otp/cls_otp_ops.h | 166 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 src/cls/otp/cls_otp_ops.h (limited to 'src/cls/otp/cls_otp_ops.h') diff --git a/src/cls/otp/cls_otp_ops.h b/src/cls/otp/cls_otp_ops.h new file mode 100644 index 00000000..51cec3eb --- /dev/null +++ b/src/cls/otp/cls_otp_ops.h @@ -0,0 +1,166 @@ +#ifndef CEPH_CLS_OTP_OPS_H +#define CEPH_CLS_OTP_OPS_H + +#include "include/types.h" +#include "include/utime.h" +#include "cls/otp/cls_otp_types.h" + +struct cls_otp_set_otp_op +{ + list entries; + + void encode(bufferlist &bl) const { + ENCODE_START(1, 1, bl); + encode(entries, bl); + ENCODE_FINISH(bl); + } + void decode(bufferlist::const_iterator &bl) { + DECODE_START(1, bl); + decode(entries, bl); + DECODE_FINISH(bl); + } +}; +WRITE_CLASS_ENCODER(cls_otp_set_otp_op) + +struct cls_otp_check_otp_op +{ + string id; + string val; + string token; + + void encode(bufferlist &bl) const { + ENCODE_START(1, 1, bl); + encode(id, bl); + encode(val, bl); + encode(token, bl); + ENCODE_FINISH(bl); + } + void decode(bufferlist::const_iterator &bl) { + DECODE_START(1, bl); + decode(id, bl); + decode(val, bl); + decode(token, bl); + DECODE_FINISH(bl); + } +}; +WRITE_CLASS_ENCODER(cls_otp_check_otp_op) + +struct cls_otp_get_result_op +{ + string token; + + void encode(bufferlist &bl) const { + ENCODE_START(1, 1, bl); + encode(token, bl); + ENCODE_FINISH(bl); + } + void decode(bufferlist::const_iterator &bl) { + DECODE_START(1, bl); + decode(token, bl); + DECODE_FINISH(bl); + } +}; +WRITE_CLASS_ENCODER(cls_otp_get_result_op) + +struct cls_otp_get_result_reply +{ + rados::cls::otp::otp_check_t result; + + void encode(bufferlist &bl) const { + ENCODE_START(1, 1, bl); + encode(result, bl); + ENCODE_FINISH(bl); + } + void decode(bufferlist::const_iterator &bl) { + DECODE_START(1, bl); + decode(result, bl); + DECODE_FINISH(bl); + } +}; +WRITE_CLASS_ENCODER(cls_otp_get_result_reply) + +struct cls_otp_remove_otp_op +{ + list ids; + + void encode(bufferlist &bl) const { + ENCODE_START(1, 1, bl); + encode(ids, bl); + ENCODE_FINISH(bl); + } + void decode(bufferlist::const_iterator &bl) { + DECODE_START(1, bl); + decode(ids, bl); + DECODE_FINISH(bl); + } +}; +WRITE_CLASS_ENCODER(cls_otp_remove_otp_op) + +struct cls_otp_get_otp_op +{ + bool get_all{false}; + list ids; + + void encode(bufferlist &bl) const { + ENCODE_START(1, 1, bl); + encode(get_all, bl); + encode(ids, bl); + ENCODE_FINISH(bl); + } + void decode(bufferlist::const_iterator &bl) { + DECODE_START(1, bl); + decode(get_all, bl); + decode(ids, bl); + DECODE_FINISH(bl); + } +}; +WRITE_CLASS_ENCODER(cls_otp_get_otp_op) + +struct cls_otp_get_otp_reply +{ + list found_entries; + + void encode(bufferlist &bl) const { + ENCODE_START(1, 1, bl); + encode(found_entries, bl); + ENCODE_FINISH(bl); + } + void decode(bufferlist::const_iterator &bl) { + DECODE_START(1, bl); + decode(found_entries, bl); + DECODE_FINISH(bl); + } +}; +WRITE_CLASS_ENCODER(cls_otp_get_otp_reply) + +struct cls_otp_get_current_time_op +{ + void encode(bufferlist &bl) const { + ENCODE_START(1, 1, bl); + ENCODE_FINISH(bl); + } + void decode(bufferlist::const_iterator &bl) { + DECODE_START(1, bl); + DECODE_FINISH(bl); + } +}; +WRITE_CLASS_ENCODER(cls_otp_get_current_time_op) + +struct cls_otp_get_current_time_reply +{ + ceph::real_time time; + + void encode(bufferlist &bl) const { + ENCODE_START(1, 1, bl); + encode(time, bl); + ENCODE_FINISH(bl); + } + void decode(bufferlist::const_iterator &bl) { + DECODE_START(1, bl); + decode(time, bl); + DECODE_FINISH(bl); + } +}; +WRITE_CLASS_ENCODER(cls_otp_get_current_time_reply) + +#endif -- cgit v1.2.3