sss_nss_idmap  1.14.2
sss_nss_idmap.h
1 /*
2  SSSD
3 
4  NSS Responder ID-mapping interface
5 
6  Authors:
7  Sumit Bose <sbose@redhat.com>
8 
9  Copyright (C) 2013 Red Hat
10 
11  This program is free software; you can redistribute it and/or modify
12  it under the terms of the GNU General Public License as published by
13  the Free Software Foundation; either version 3 of the License, or
14  (at your option) any later version.
15 
16  This program is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with this program. If not, see <http://www.gnu.org/licenses/>.
23 */
24 
25 #ifndef SSS_NSS_IDMAP_H_
26 #define SSS_NSS_IDMAP_H_
27 
28 #include <stdint.h>
29 
33 enum sss_id_type {
34  SSS_ID_TYPE_NOT_SPECIFIED = 0,
35  SSS_ID_TYPE_UID,
36  SSS_ID_TYPE_GID,
37  SSS_ID_TYPE_BOTH /* used for user or magic private groups */
38 };
39 
40 struct sss_nss_kv {
41  char *key;
42  char *value;
43 };
44 
62 int sss_nss_getsidbyname(const char *fq_name, char **sid,
63  enum sss_id_type *type);
64 
76 int sss_nss_getsidbyid(uint32_t id, char **sid, enum sss_id_type *type);
77 
89 int sss_nss_getnamebysid(const char *sid, char **fq_name,
90  enum sss_id_type *type);
91 
102 int sss_nss_getidbysid(const char *sid, uint32_t *id,
103  enum sss_id_type *id_type);
104 
123 int sss_nss_getorigbyname(const char *fq_name, struct sss_nss_kv **kv_list,
124  enum sss_id_type *type);
125 
138 int sss_nss_getnamebycert(const char *cert, char **fq_name,
139  enum sss_id_type *type);
140 
146 void sss_nss_free_kv(struct sss_nss_kv *kv_list);
147 #endif /* SSS_NSS_IDMAP_H_ */