OpenVAS Libraries  8.0.3
ldap_connect_auth.h
Go to the documentation of this file.
1 /* OpenVAS Libraries
2  * $Id$
3  * Description: Header for LDAP-Connect Authentication module.
4  *
5  * Authors:
6  * Felix Wolfsteller <felix.wolfsteller@intevation.de>
7  *
8  * Copyright:
9  * Copyright (C) 2012 Greenbone Networks GmbH
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (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, write to the Free Software
23  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24  */
25 
26 #ifndef ENABLE_LDAP_AUTH
27 // Handle cases where openldap is not available.
28 #else
29 
30 #ifndef LDAP_CONNECT_AUTH_H
31 #define LDAP_CONNECT_AUTH_H
32 
33 #include <glib.h>
34 #include <ldap.h>
35 
37 typedef struct ldap_auth_info *ldap_auth_info_t;
38 
45 struct ldap_auth_info
46 {
47  gchar *ldap_host;
48  gchar *auth_dn;
49 
51  gchar *role_attribute;
52  gchar **role_admin_values;
53  gchar **role_observer_values;
54  gchar **role_user_values;
55  gchar *ruletype_attribute;
56  gchar *rule_attribute;
57  gboolean allow_plaintext;
58  int (*user_set_role) (const gchar *,
59  const gchar *,
60  const gchar *);
61 };
62 
63 ldap_auth_info_t
64 ldap_auth_info_from_key_file (GKeyFile *, const gchar *);
65 
66 int ldap_connect_authenticate (const gchar *, const gchar *,
67  /*ldap_auth_info_t */ void *);
68 
69 void ldap_auth_info_free (ldap_auth_info_t);
70 
71 ldap_auth_info_t
72 ldap_auth_info_new (const gchar *, const gchar *, const gchar *, gchar **,
73  gchar **, gchar **, const gchar *, const gchar *, gboolean,
74  gboolean);
75 
76 gchar*
77 ldap_auth_info_auth_dn (const ldap_auth_info_t, const gchar*);
78 
79 LDAP *
80 ldap_auth_bind (const gchar *, const gchar *, const gchar *, gboolean);
81 
82 gboolean ldap_auth_dn_is_good (const gchar *);
83 
84 #endif /* not LDAP_CONNECT_AUTH_H */
85 
86 #endif /* ENABLE_LDAP_AUTH */
int(* user_set_role)(const gchar *, const gchar *, const gchar *)
Definition: openvas_auth.c:159