"Fossies" - the Fresh Open Source Software Archive

Member "gvm-libs-11.0.1/util/ldaputils.h" (12 May 2020, 2106 Bytes) of package /linux/misc/openvas/gvm-libs-11.0.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ldaputils.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 1.0-beta2_vs_1.0.0.

    1 /* Copyright (C) 2012-2019 Greenbone Networks GmbH
    2  *
    3  * SPDX-License-Identifier: GPL-2.0-or-later
    4  *
    5  * This program is free software; you can redistribute it and/or
    6  * modify it under the terms of the GNU General Public License
    7  * as published by the Free Software Foundation; either version 2
    8  * of the License, or (at your option) any later version.
    9  *
   10  * This program is distributed in the hope that it will be useful,
   11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13  * GNU General Public License for more details.
   14  *
   15  * You should have received a copy of the GNU General Public License
   16  * along with this program; if not, write to the Free Software
   17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   18  */
   19 
   20 /**
   21  * @file
   22  * @brief Header for LDAP-Connect Authentication module.
   23  */
   24 
   25 #ifndef _GVM_LDAPUTILS_H
   26 #define _GVM_LDAPUTILS_H
   27 
   28 #include <glib.h>
   29 
   30 /** @brief Authentication schema and address type. */
   31 typedef struct ldap_auth_info *ldap_auth_info_t;
   32 
   33 /**
   34  * @brief Schema (dn) and info to use for a basic ldap authentication.
   35  *
   36  * Use like an opaque struct, create with ldap_auth_schema_new, do not modify,
   37  * free with ldap_auth_schema_free.
   38  */
   39 struct ldap_auth_info
   40 {
   41   gchar *ldap_host;         ///< Address of the ldap server, might include port.
   42   gchar *auth_dn;           ///< DN to authenticate with.
   43   gboolean allow_plaintext; ///< !Whether or not StartTLS is required.
   44 };
   45 
   46 int
   47 ldap_connect_authenticate (const gchar *, const gchar *,
   48                            /* ldap_auth_info_t */ void *, const gchar *);
   49 
   50 void ldap_auth_info_free (ldap_auth_info_t);
   51 
   52 ldap_auth_info_t
   53 ldap_auth_info_new (const gchar *, const gchar *, gboolean);
   54 
   55 #ifdef ENABLE_LDAP_AUTH
   56 
   57 #include <ldap.h>
   58 
   59 gchar *
   60 ldap_auth_info_auth_dn (const ldap_auth_info_t, const gchar *);
   61 
   62 LDAP *
   63 ldap_auth_bind (const gchar *, const gchar *, const gchar *, gboolean,
   64                 const gchar *);
   65 
   66 gboolean
   67 ldap_auth_dn_is_good (const gchar *);
   68 
   69 #endif /* ENABLE_LDAP_AUTH */
   70 
   71 #endif /* not _GVM_LDAPUTILS_H */