]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | /* | |
4 | * Ceph - scalable distributed file system | |
5 | * | |
6 | * Copyright (C) 2004-2009 Sage Weil <sage@newdream.net> | |
7 | * | |
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. | |
12 | * | |
13 | */ | |
14 | ||
15 | #ifndef CEPH_AUTHSERVICEHANDLER_H | |
16 | #define CEPH_AUTHSERVICEHANDLER_H | |
17 | ||
18 | #include "include/types.h" | |
19 | #include "Auth.h" | |
20 | ||
21 | class CephContext; | |
22 | class KeyServer; | |
23 | ||
24 | struct AuthServiceHandler { | |
25 | protected: | |
26 | CephContext *cct; | |
27 | public: | |
28 | EntityName entity_name; | |
29 | uint64_t global_id; | |
30 | ||
31 | explicit AuthServiceHandler(CephContext *cct_) : cct(cct_), global_id(0) {} | |
32 | ||
33 | virtual ~AuthServiceHandler() { } | |
34 | ||
35 | virtual int start_session(EntityName& name, bufferlist::iterator& indata, bufferlist& result, AuthCapsInfo& caps) = 0; | |
36 | virtual int handle_request(bufferlist::iterator& indata, bufferlist& result, uint64_t& global_id, AuthCapsInfo& caps, uint64_t *auid = NULL) = 0; | |
37 | ||
38 | EntityName& get_entity_name() { return entity_name; } | |
39 | }; | |
40 | ||
41 | extern AuthServiceHandler *get_auth_service_handler(int type, CephContext *cct, KeyServer *ks); | |
42 | ||
43 | #endif |