]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-dencoder: add AuthMonitor::Incremental
authorSage Weil <sage@inktank.com>
Wed, 16 May 2012 23:10:52 +0000 (16:10 -0700)
committerSage Weil <sage@inktank.com>
Wed, 16 May 2012 23:10:52 +0000 (16:10 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/AuthMonitor.h
src/test/encoding/types.h

index 5d913e6959ddb291c25916bf452f78a0e8c0ffa1..2936b248e375363e080fdc206b27316e74e47573 100644 (file)
@@ -45,6 +45,8 @@ public:
     uint32_t auth_type;
     bufferlist auth_data;
 
+    Incremental() : inc_type(GLOBAL_ID), max_global_id(0), auth_type(0) {}
+
     void encode(bufferlist& bl) const {
       ENCODE_START(2, 2, bl);
       __u32 _type = (__u32)inc_type;
@@ -71,6 +73,22 @@ public:
       }
       DECODE_FINISH(bl);
     }
+    void dump(Formatter *f) const {
+      f->dump_int("type", inc_type);
+      f->dump_int("max_global_id", max_global_id);
+      f->dump_int("auth_type", auth_type);
+      f->dump_int("auth_data_len", auth_data.length());
+    }
+    static void generate_test_instances(list<Incremental*>& ls) {
+      ls.push_back(new Incremental);
+      ls.push_back(new Incremental);
+      ls.back()->inc_type = GLOBAL_ID;
+      ls.back()->max_global_id = 1234;
+      ls.push_back(new Incremental);
+      ls.back()->inc_type = AUTH_DATA;
+      ls.back()->auth_type = 12;
+      ls.back()->auth_data.append("foo");
+    }
   };
 
 private:
index 45fe618faf18421cdd9073580f703c96edeeac61..de78b30c5fd689940b6f644a33a44a0ed1aa0d61 100644 (file)
@@ -69,6 +69,9 @@ TYPE(SequencerPosition)
 #include "os/hobject.h"
 TYPE(hobject_t)
 
+#include "mon/AuthMonitor.h"
+TYPE(AuthMonitor::Incremental)
+
 #include "mon/PGMap.h"
 TYPE(PGMap::Incremental)
 TYPE(PGMap)