Greenbone Vulnerability Management Libraries  22.8.0
ldaputils.h
Go to the documentation of this file.
1 /* SPDX-FileCopyrightText: 2012-2023 Greenbone AG
2  *
3  * SPDX-License-Identifier: GPL-2.0-or-later
4  */
5 
11 #ifndef _GVM_LDAPUTILS_H
12 #define _GVM_LDAPUTILS_H
13 
14 #include <glib.h>
15 
18 
26 {
27  gchar *ldap_host;
28  gchar *auth_dn;
29  gboolean allow_plaintext;
30  gboolean ldaps_only;
31 };
32 
33 int
34 ldap_enable_debug (void);
35 
36 int
37 ldap_connect_authenticate (const gchar *, const gchar *,
38  /* ldap_auth_info_t */ void *, const gchar *);
39 
41 
43 ldap_auth_info_new (const gchar *, const gchar *, gboolean);
44 
46 ldap_auth_info_new_2 (const gchar *, const gchar *, gboolean, gboolean);
47 
48 #ifdef ENABLE_LDAP_AUTH
49 
50 #include <ldap.h>
51 
52 gchar *
53 ldap_auth_info_auth_dn (const ldap_auth_info_t, const gchar *);
54 
55 LDAP *
56 ldap_auth_bind (const gchar *, const gchar *, const gchar *, gboolean,
57  const gchar *);
58 
59 LDAP *
60 ldap_auth_bind_2 (const gchar *, const gchar *, const gchar *, gboolean,
61  const gchar *, gboolean);
62 
63 gboolean
64 ldap_auth_dn_is_good (const gchar *);
65 
66 #endif /* ENABLE_LDAP_AUTH */
67 
68 #endif /* not _GVM_LDAPUTILS_H */
ldap_auth_info::ldap_host
gchar * ldap_host
Address of the ldap server, might include port.
Definition: ldaputils.h:27
ldap_connect_authenticate
int ldap_connect_authenticate(const gchar *, const gchar *, void *, const gchar *)
Dummy function for Manager.
Definition: ldaputils.c:696
ldap_auth_info::auth_dn
gchar * auth_dn
DN to authenticate with.
Definition: ldaputils.h:28
ldap_auth_info::allow_plaintext
gboolean allow_plaintext
!Whether or not StartTLS or LDAPS is required.
Definition: ldaputils.h:29
ldap_auth_info
Schema (dn) and info to use for a basic ldap authentication.
Definition: ldaputils.h:26
ldap_enable_debug
int ldap_enable_debug(void)
Dummy function for enabling LDAP debugging for manager.
Definition: ldaputils.c:631
ldap_auth_info_free
void ldap_auth_info_free(ldap_auth_info_t)
Dummy function for Manager.
Definition: ldaputils.c:713
ldap_auth_info_t
struct ldap_auth_info * ldap_auth_info_t
Authentication schema and address type.
Definition: ldaputils.h:17
ldap_auth_info_new_2
ldap_auth_info_t ldap_auth_info_new_2(const gchar *, const gchar *, gboolean, gboolean)
Dummy function for manager.
Definition: ldaputils.c:675
ldap_auth_info_new
ldap_auth_info_t ldap_auth_info_new(const gchar *, const gchar *, gboolean)
Dummy function for manager.
Definition: ldaputils.c:651
ldap_auth_info::ldaps_only
gboolean ldaps_only
Whether to try LDAPS before StartTLS.
Definition: ldaputils.h:30