~ubuntu-branches/ubuntu/quantal/ceph/quantal

« back to all changes in this revision

Viewing changes to src/mon/MonCaps.cc

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-07-16 09:56:24 UTC
  • mfrom: (0.3.11)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: package-import@ubuntu.com-20120716095624-azr2w4hbhei1rxmx
Tags: upstream-0.48
ImportĀ upstreamĀ versionĀ 0.48

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#include "common/Formatter.h"
19
19
#include "MonCaps.h"
20
20
#include "mon_types.h"
 
21
#include "include/ceph_features.h"
21
22
 
22
23
#define dout_subsys ceph_subsys_auth
23
24
 
339
340
 
340
341
// ----
341
342
 
342
 
void MonCaps::encode(bufferlist& bl) const
 
343
void MonCaps::encode(bufferlist& bl, uint64_t features) const
343
344
{
344
 
  __u8 v = 2;
345
 
  ::encode(v, bl);
 
345
  if ((features & CEPH_FEATURE_MONENC) == 0) {
 
346
    __u8 v = 2;
 
347
    ::encode(v, bl);
 
348
    ::encode(text, bl);
 
349
    ::encode(default_action, bl);
 
350
    ::encode(services_map, bl);
 
351
    ::encode(pool_auid_map, bl);
 
352
    ::encode(allow_all, bl);
 
353
    ::encode(auid, bl);
 
354
    ::encode(cmd_allow, bl);
 
355
    return;
 
356
  }
 
357
 
 
358
  ENCODE_START(3, 3, bl);
346
359
  ::encode(text, bl);
347
360
  ::encode(default_action, bl);
348
361
  ::encode(services_map, bl);
350
363
  ::encode(allow_all, bl);
351
364
  ::encode(auid, bl);
352
365
  ::encode(cmd_allow, bl);
 
366
  ENCODE_FINISH(bl);
353
367
}
354
368
 
355
369
void MonCaps::decode(bufferlist::iterator& bl)
356
370
{
357
 
  __u8 v;
358
 
  ::decode(v, bl);
 
371
  DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, bl);
359
372
  ::decode(text, bl);
360
373
  ::decode(default_action, bl);
361
374
  ::decode(services_map, bl);
363
376
  ::decode(allow_all, bl);
364
377
  ::decode(auid, bl);
365
378
  ::decode(cmd_allow, bl);
 
379
  DECODE_FINISH(bl);
366
380
}
367
381
 
368
382
void MonCaps::dump(Formatter *f) const