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