Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ldapconf_defs.h

Go to the documentation of this file.
00001 /* Common includes */
00002 #include "ldapconf.h"
00003 #include "ldapconf.m"
00004 #include "loghandler.h"
00005 #include <stdio.h>
00006 #include <string.h>
00007 #include <translat.h>
00008 #include <subsys.h>
00009 #include <dialog.h>
00010 #include "fields.h"
00011 
00012 class LDAPPROFILE;
00013 class LDAPOBJECT;
00014 class LDAPDB;
00015 
00016 /* Configuration */
00017 
00018 #define LDAPCONF_RELEASE "0.18.0"
00019 #define ATTR_VAL_MAX 1024  // Max length of attribute value
00020 #define ATTR_NAME_MAX 128  // Max length of attribute name
00021 #define COMMAND_MAX 256    // Max length of command line
00022 
00023 // Uncomment this to compile with internal debug support
00024 //#define DEBUG 
00025 
00026 // Uncomment this to compile with exprimental code (not used)
00027 //#define DEVEL
00028 
00029 /* Conditional */
00030 
00031 // Disable debug code if DEBUG is undefined
00032 #ifdef DEBUG
00033 # define D(a) a;
00034 #else
00035 # define D(a) {}
00036 #endif
00037 
00038 /* Declarations */
00039 
00040 extern const char PAM_SERVICES[];
00041 extern const char PAM_MODULES[];
00042 extern const char OPENLDAP_DATA_DIR[];
00043 extern const char OPENLDAP_CONF_DIR[];
00044 extern const char LDAPCONF_CONF_DIR[];
00045 extern const char DBCONF_DIR[];
00046 extern const char DBBIND_DIR[];
00047 extern const char DBFORM_DIR[];
00048 extern const char PROFILE_DIR[];
00049 extern const char DBCONF_SUFFIX[];
00050 
00051 extern const char subsys_ldap[];
00052 
00053 // Helpfiles
00054 extern HELP_FILE help_index;
00055 extern HELP_FILE help_ldap;
00056 extern HELP_FILE help_ldapuser;
00057 extern HELP_FILE help_ldapclient;
00058 extern HELP_FILE help_ldapsystem;
00059 extern HELP_FILE help_formclient;
00060 extern HELP_FILE help_groupadmin;
00061 extern HELP_FILE help_setup;
00062 
00063 // Linuxconf privilege support (not used yet)
00064 extern PRIVILEGE p_ldap_admin;
00065 extern PRIVILEGE p_ldap_user;
00066 extern LINUXCONF_SUBSYS sub_ldap;
00067 
00068 // Configuration files used by ldapconf
00069 extern CONFIG_FILE f_slapd_conf;
00070 extern CONFIG_FILE f_ldap_conf;
00071 extern CONFIG_FILE f_ldap_sec;
00072 extern CONFIG_FILE f_nss_conf;
00073 extern CONFIG_FILE f_ldapconf;
00074 
00075 // Ldapconf module options
00076 extern char mode_ldap_system;
00077 extern char mode_ldap_client;
00078 extern char mode_ldap_server;
00079 extern char mode_ldap_profile;
00080 extern char mode_ldap_devel;
00081 extern int mode_ldap_debug;
00082 extern char mode_ldap_directory;
00083 extern char mode_ldap_userinfo;
00084 extern char mode_ldap_pwsync;
00085 extern char mode_ldap_useraccount;
00086 extern char mode_ldap_formclient;
00087 extern char mode_ldap_wwwclient;
00088 extern SSTRING mode_ldap_protocol;
00089 extern SSTRING mode_openldap_version;
00090 extern SSTRING mode_openldap_params;
00091 extern SSTRING mode_slapd_user;
00092 extern SSTRING mode_slapd_group;
00093 extern SSTRING mode_logfile;
00094 extern int mode_loglevel;
00095 
00096 /* Class declarations */
00097 
00098 class LDAPPROFILE: public ARRAY_OBJ {
00099 public:
00100     SSTRING host;
00101     SSTRING port;
00102     SSTRING dn;
00103     SSTRING pw;
00104     SSTRING base;
00105     SSTRING scope;
00106     SSTRING filter;
00107     SSTRING attr;
00108     SSTRING db_type;
00109     SSTRING db_dir;
00110     SSTRING db_replog;
00111 
00112     /*~PROTOBEG~ LDAPPROFILE */
00113 public:
00114     LDAPPROFILE (void);
00115     void default_dialog (void);
00116     /*~PROTOEND~ LDAPPROFILE */
00117 };
00118 
00119 class LDAPDB: public ARRAY_OBJ {
00120 public:
00121     LDAPPROFILE bind;
00122     SSTRING name;       /* DB nickname */
00123     SSTRING database;   /* Database type */
00124     SSTRING directory;  /* Data directory */
00125     SSTRING replogfile; /* Replication log */
00126     SSTRING updatedn;
00127     SSTRING replica;    
00128     SSTRING lastmod;
00129     SSTRING readonly;
00130     SSTRINGS access_list;
00131     SSTRINGS attribute_list;
00132     SSTRINGS objectclass_list;
00133     SSTRINGS index_list;
00134     SSTRING defaultaccess;
00135     SSTRING loglevel;
00136     SSTRING schemacheck;
00137     SSTRING referral;
00138     
00139     /*~PROTOBEG~ LDAPDB */
00140 public:
00141     LDAPDB (const char *dbname);
00142     LDAPDB (void);
00143     void config (const char *dbname);
00144     int create (void);
00145     int export_ldif (const char *profile_name);
00146     int export_ldif (void);
00147     int import_ldif (void);
00148     int init (const char *dbname);
00149     void menu (void);
00150     int read (const char *dbname);
00151     /*~PROTOEND~ LDAPDB */
00152 };
00153 
00154 class LDAPOBJECT: public ARRAY_OBJ {
00155 public:
00156     LDAPPROFILE bind;
00157     CONFDB *form;
00158     CONFDB *c_profile;
00159     SSTRING profile;
00160     SSTRING bindname;
00161     SSTRING formname;
00162     SSTRING dn_prefix;
00163     SSTRING group_prefix;
00164     SSTRING primary_key;
00165     SSTRING crypt_hash;
00166     SSTRING dn;
00167     SSTRING host;
00168     SSTRING port;
00169     SSTRING binddn;
00170     SSTRING bindpw;
00171     SSTRING base;
00172     SSTRING scope;
00173     SSTRING filter;
00174     SSTRING attr;
00175     SSTRING command_line;
00176     SSTRINGS atlist;
00177     SSTRINGS oclist;
00178     char ldif_format;
00179     char *ldapconf_entry;   // Temp file to create ldif transactions
00180     int last_uid;           // Record the last free uid number in use, so get_free_gid may copy it, may also be a hint for finding the next.
00181 
00182     /*~PROTOBEG~ LDAPOBJECT */
00183 public:
00184     LDAPOBJECT (const char *profile_name);
00185     LDAPOBJECT (void);
00186     int add (void);
00187     int at_add (const char *name, const char *val);
00188     int at_add (const char *name, int val);
00189     int at_del (const char *name);
00190     const char *at_get (const char *name);
00191     const char *at_get (const char *name, int k);
00192     int at_getall (const char *name, SSTRINGS&lst);
00193     const char *at_getname (int num);
00194     const char *at_getval (int num);
00195     int at_list (SSTRINGS&lst);
00196     int at_set (const char *name, const char *val);
00197     int at_set (const char *name, int val);
00198     int command (const char *command, SSTRINGS&resmsg);
00199     int del (void);
00200     int dn_set (const char *val);
00201     int export_confdb (CONFDB *c_data);
00202     int export_ldif (const char *path);
00203     int get_free_gid (void);
00204     int get_free_uid (void);
00205     int import_confdb (CONFDB *c_data);
00206     void init (void);
00207     int ldif_splitline (const char *ldif,
00208          char *name,
00209          char *val);
00210     int load_profile (const char *profile_name);
00211     int locate (const char *key, SSTRINGS&lst);
00212     SSTRING *locateassign (const char *key);
00213     SSTRING *locateassign (const char *key, int k);
00214     int modify (void);
00215     int oc_add (const char *val);
00216     int oc_del (const char *name);
00217     const char *oc_getval (int num);
00218     int oc_list (SSTRINGS&lst);
00219     int reset (void);
00220     int reset_data (void);
00221     int search (void);
00222     int search_list (SSTRINGS&lst);
00223     int search_list_val (SSTRINGS&lst,
00224          const char *key);
00225     int search_list_vals (SSTRINGS&lst,
00226          const char *key,
00227          const char *at_name[]);
00228     int set_password (const char *username,
00229          const char *password);
00230     ~LDAPOBJECT (void);
00231     /*~PROTOEND~ LDAPOBJECT */
00232 };

Generated at Mon Jan 22 08:35:12 2001 for ldapconf by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000