1*55fea89dSDan Cross /*
254925bf6Swillf  * kadmin/ldap_util/kdb5_ldap_util.h
354925bf6Swillf  */
454925bf6Swillf 
554925bf6Swillf /* Copyright (c) 2004-2005, Novell, Inc.
654925bf6Swillf  * All rights reserved.
754925bf6Swillf  *
854925bf6Swillf  * Redistribution and use in source and binary forms, with or without
954925bf6Swillf  * modification, are permitted provided that the following conditions are met:
1054925bf6Swillf  *
1154925bf6Swillf  *   * Redistributions of source code must retain the above copyright notice,
1254925bf6Swillf  *       this list of conditions and the following disclaimer.
1354925bf6Swillf  *   * Redistributions in binary form must reproduce the above copyright
1454925bf6Swillf  *       notice, this list of conditions and the following disclaimer in the
1554925bf6Swillf  *       documentation and/or other materials provided with the distribution.
1654925bf6Swillf  *   * The copyright holder's name is not used to endorse or promote products
1754925bf6Swillf  *       derived from this software without specific prior written permission.
1854925bf6Swillf  *
1954925bf6Swillf  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2054925bf6Swillf  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2154925bf6Swillf  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2254925bf6Swillf  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
2354925bf6Swillf  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2454925bf6Swillf  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2554925bf6Swillf  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2654925bf6Swillf  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2754925bf6Swillf  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2854925bf6Swillf  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2954925bf6Swillf  * POSSIBILITY OF SUCH DAMAGE.
3054925bf6Swillf  */
3154925bf6Swillf 
32dd9ccd46S /*
33dd9ccd46S  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
34dd9ccd46S  * Use is subject to license terms.
35dd9ccd46S  */
36dd9ccd46S 
37dd9ccd46S 
3854925bf6Swillf #ifndef _KDB5_LDAP_UTIL_H_
3954925bf6Swillf #define _KDB5_LDAP_UTIL_H_
4054925bf6Swillf 
4154925bf6Swillf #include <kdb_ldap.h>
4254925bf6Swillf #include "kdb5_ldap_realm.h"
4354925bf6Swillf #include "kdb5_ldap_services.h"
4454925bf6Swillf #include "kdb5_ldap_policy.h"
4554925bf6Swillf 
4654925bf6Swillf #define MAIN_HELP            -1
4754925bf6Swillf #define CREATE_REALM          1
4854925bf6Swillf #define MODIFY_REALM          2
4954925bf6Swillf #define VIEW_REALM            3
5054925bf6Swillf #define DESTROY_REALM         4
5154925bf6Swillf #define LIST_REALM            5
5254925bf6Swillf 
5354925bf6Swillf #ifdef HAVE_EDIRECTORY
54*55fea89dSDan Cross # define CREATE_SERVICE        6
5554925bf6Swillf # define MODIFY_SERVICE        7
5654925bf6Swillf # define VIEW_SERVICE          8
5754925bf6Swillf # define DESTROY_SERVICE       9
5854925bf6Swillf # define LIST_SERVICE          10
5954925bf6Swillf # define SET_SRV_PW            16
6054925bf6Swillf #else
6154925bf6Swillf # define STASH_SRV_PW          17
6254925bf6Swillf #endif
6354925bf6Swillf 
6454925bf6Swillf #define CREATE_POLICY         11
6554925bf6Swillf #define MODIFY_POLICY         12
6654925bf6Swillf #define VIEW_POLICY           13
6754925bf6Swillf #define DESTROY_POLICY        14
6854925bf6Swillf #define LIST_POLICY           15
6954925bf6Swillf 
70dd9ccd46S /* Solaris Kerberos */
71dd9ccd46S extern char *progname;
72dd9ccd46S 
7354925bf6Swillf extern int exit_status;
7454925bf6Swillf extern krb5_context util_context;
7554925bf6Swillf 
7654925bf6Swillf extern void usage();
7754925bf6Swillf extern void db_usage(int);
7854925bf6Swillf 
7954925bf6Swillf #define ARG_VAL (--argc > 0 ? (koptarg = *(++argv)) : (char *)(usage(MAIN_HELP), NULL))
8054925bf6Swillf 
8154925bf6Swillf /* Following are the bitmaps that indicate which of the options among -D, -w, -h, -p & -t
8254925bf6Swillf  * were specified on the command line.
8354925bf6Swillf  */
8454925bf6Swillf #define CMD_LDAP_D	0x1     /* set if -D option is specified */
8554925bf6Swillf #define CMD_LDAP_W	0x2     /* set if -w option is specified */
8654925bf6Swillf #define CMD_LDAP_H	0x4     /* set if -h option is specified */
8754925bf6Swillf #define CMD_LDAP_P	0x8     /* set if -p option is specified */
8854925bf6Swillf 
8954925bf6Swillf #define MAX_PASSWD_LEN          1024
9054925bf6Swillf #define MAX_PASSWD_PROMPT_LEN   276     /* max_dn_size(=256) + strlen("Password for \" \"")=20 */
9154925bf6Swillf 
9254925bf6Swillf #endif /* _KDB5_LDAP_UTIL_H_ */
93