xref: /titanic_41/usr/src/cmd/svr4pkg/pkgadm/pkgadm.h (revision 4445fffbbb1ea25fd0e9ea68b9380dd7a6709025)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _PKGADM_H
28 #define	_PKGADM_H
29 
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #include <pkgerr.h>
36 #include <keystore.h>
37 #include "pkglib.h"
38 #include "libinst.h"
39 
40 /* version of packaging interface */
41 #define	SUNW_PKGVERS	"1.0"
42 
43 /* string comparitor abbreviators */
44 
45 #define	ci_streq(a, b)		(strcasecmp((a), (b)) == 0)
46 #define	ci_strneq(a, b, c)	(strncasecmp((a), (b), (c)) == 0)
47 #define	streq(a, b)		(strcmp((a), (b)) == 0)
48 #define	strneq(a, b, c)		(strncmp((a), (b), (c)) == 0)
49 
50 /* max l10n message length we will display */
51 #define	MSG_MAX			1024
52 
53 /* main.c */
54 extern	void		log_msg(LogMsgType, const char *, ...);
55 extern	void		log_pkgerr(LogMsgType, PKG_ERR *);
56 extern	void		set_verbose(boolean_t);
57 extern	boolean_t	get_verbose(void);
58 /* lock.c */
59 extern int		admin_lock(int, char **);
60 /* listcert.c */
61 extern int		listcert(int, char **);
62 /* importcert.c */
63 extern int		addcert(int, char **);
64 /* removecert.c */
65 extern int		removecert(int, char **);
66 
67 /* certs.c */
68 extern int		load_cert_and_key(PKG_ERR *, FILE *,
69     keystore_encoding_format_t, char *, EVP_PKEY **, X509 **);
70 extern int		load_all_certs(PKG_ERR *, FILE *,
71     keystore_encoding_format_t, char *, STACK_OF(X509) **);
72 
73 #define	PKGADM_DBSTATUS_TEXT	"text"
74 
75 #ifdef __cplusplus
76 }
77 #endif
78 
79 #endif /* _PKGADM_H */
80