Greenbone Vulnerability Management Libraries: util/ldaputils.h Source File

Greenbone Vulnerability Management Libraries 23.1.1

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
10
11#ifndef _GVM_UTIL_LDAPUTILS_H
12#define _GVM_UTIL_LDAPUTILS_H
13
14#include <glib.h>
15
17 typedef struct ldap_auth_info *ldap_auth_info_t;
18
25 struct ldap_auth_info
26{
27 gchar *ldap_host;
28 gchar *auth_dn;
29 gboolean allow_plaintext;
30 gboolean ldaps_only;
31};
32
33int
34 ldap_enable_debug (void);
35
36int
37 ldap_connect_authenticate (const gchar *, const gchar *,
38 /* ldap_auth_info_t */ void *, const gchar *);
39
40void ldap_auth_info_free (ldap_auth_info_t);
41
42 ldap_auth_info_t
43 ldap_auth_info_new (const gchar *, const gchar *, gboolean);
44
45 ldap_auth_info_t
46 ldap_auth_info_new_2 (const gchar *, const gchar *, gboolean, gboolean);
47
48#ifdef ENABLE_LDAP_AUTH
49
50#include <ldap.h>
51
52gchar *
53ldap_auth_info_auth_dn (const ldap_auth_info_t, const gchar *);
54
55LDAP *
56ldap_auth_bind (const gchar *, const gchar *, const gchar *, gboolean,
57 const gchar *);
58
59LDAP *
60ldap_auth_bind_2 (const gchar *, const gchar *, const gchar *, gboolean,
61 const gchar *, gboolean);
62
63gboolean
64ldap_auth_dn_is_good (const gchar *);
65
66#endif /* ENABLE_LDAP_AUTH */
67
68#endif /* not _GVM_UTIL_LDAPUTILS_H */
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_t
struct ldap_auth_info * ldap_auth_info_t
Authentication schema and address type.
Definition ldaputils.h:17
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_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_free
void ldap_auth_info_free(ldap_auth_info_t)
Dummy function for Manager.
Definition ldaputils.c:713
ldap_enable_debug
int ldap_enable_debug(void)
Dummy function for enabling LDAP debugging for manager.
Definition ldaputils.c:631
ldap_auth_info
Schema (dn) and info to use for a basic ldap authentication.
Definition ldaputils.h:26
ldap_auth_info::allow_plaintext
gboolean allow_plaintext
!Whether or not StartTLS or LDAPS is required.
Definition ldaputils.h:29
ldap_auth_info::ldaps_only
gboolean ldaps_only
Whether to try LDAPS before StartTLS.
Definition ldaputils.h:30
ldap_auth_info::ldap_host
gchar * ldap_host
Address of the ldap server, might include port.
Definition ldaputils.h:27
ldap_auth_info::auth_dn
gchar * auth_dn
DN to authenticate with.
Definition ldaputils.h:28