1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2004-2009 Sage Weil <sage@newdream.net>
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
15 #ifndef CEPH_AUTHSERVICEHANDLER_H
16 #define CEPH_AUTHSERVICEHANDLER_H
18 #include <stddef.h> // for NULL
19 #include <stdint.h> // for uint64_t
20 #include "common/entity_name.h" // for EntityName
21 #include "include/buffer_fwd.h" // for bufferlist
27 struct AuthServiceHandler {
31 EntityName entity_name;
34 explicit AuthServiceHandler(CephContext *cct_) : cct(cct_), global_id(0) {}
36 virtual ~AuthServiceHandler() { }
38 virtual int start_session(EntityName& name, bufferlist::iterator& indata, bufferlist& result, AuthCapsInfo& caps) = 0;
39 virtual int handle_request(bufferlist::iterator& indata, bufferlist& result, uint64_t& global_id, AuthCapsInfo& caps, uint64_t *auid = NULL) = 0;
41 EntityName& get_entity_name() { return entity_name; }
44 extern AuthServiceHandler *get_auth_service_handler(int type, CephContext *cct, KeyServer *ks);