Line data Source code
1 : /*
2 : SSSD
3 :
4 : Data Provider -- backend request
5 :
6 : Copyright (C) Petr Cech <pcech@redhat.com> 2015
7 :
8 : This program is free software; you can redistribute it and/or modify
9 : it under the terms of the GNU General Public License as published by
10 : the Free Software Foundation; either version 3 of the License, or
11 : (at your option) any later version.
12 :
13 : This program is distributed in the hope that it will be useful,
14 : but WITHOUT ANY WARRANTY; without even the implied warranty of
15 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 : GNU General Public License for more details.
17 :
18 : You should have received a copy of the GNU General Public License
19 : along with this program. If not, see <http://www.gnu.org/licenses/>.
20 : */
21 :
22 : #include "providers/data_provider_req.h"
23 :
24 : #define be_req_to_str(req_type, be_req_t) \
25 : ((req_type) & BE_REQ_FAST) ? "FAST " #be_req_t : #be_req_t
26 :
27 0 : const char *be_req2str(dbus_uint32_t req_type)
28 : {
29 0 : switch (req_type & BE_REQ_TYPE_MASK) {
30 : case BE_REQ_USER:
31 0 : return be_req_to_str(req_type, BE_REQ_USER);
32 : case BE_REQ_GROUP:
33 0 : return be_req_to_str(req_type, BE_REQ_GROUP);
34 : case BE_REQ_INITGROUPS:
35 0 : return be_req_to_str(req_type, BE_REQ_INITGROUPS);
36 : case BE_REQ_NETGROUP:
37 0 : return be_req_to_str(req_type, BE_REQ_NETGROUP);
38 : case BE_REQ_SERVICES:
39 0 : return be_req_to_str(req_type, BE_REQ_SERVICES);
40 : case BE_REQ_SUDO_FULL:
41 0 : return be_req_to_str(req_type, BE_REQ_SUDO_FULL);
42 : case BE_REQ_SUDO_RULES:
43 0 : return be_req_to_str(req_type, BE_REQ_SUDO_RULES);
44 : case BE_REQ_AUTOFS:
45 0 : return be_req_to_str(req_type, BE_REQ_AUTOFS);
46 : case BE_REQ_HOST:
47 0 : return be_req_to_str(req_type, BE_REQ_HOST);
48 : case BE_REQ_BY_SECID:
49 0 : return be_req_to_str(req_type, BE_REQ_BY_SECID);
50 : case BE_REQ_USER_AND_GROUP:
51 0 : return be_req_to_str(req_type, BE_REQ_USER_AND_GROUP);
52 : case BE_REQ_BY_UUID:
53 0 : return be_req_to_str(req_type, BE_REQ_BY_UUID);
54 : case BE_REQ_BY_CERT:
55 0 : return be_req_to_str(req_type, BE_REQ_BY_CERT);
56 : }
57 0 : return "UNKNOWN_REQ";
58 : }
|