xref: /illumos-gate/usr/src/cmd/svr4pkg/pkgadm/pkgadm.h (revision 581cede61ac9c14d8d4ea452562a567189eead78)
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 /*
32  * Module:	patchutil.h
33  * Description:	This module contains the interfaces for patchadd
34  */
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 #include <pkgerr.h>
41 #include <keystore.h>
42 #include "pkglib.h"
43 #include "libinst.h"
44 
45 /* version of packaging interface */
46 #define	SUNW_PKGVERS	"1.0"
47 
48 /* string comparitor abbreviators */
49 
50 #define	ci_streq(a, b)		(strcasecmp((a), (b)) == 0)
51 #define	ci_strneq(a, b, c)	(strncasecmp((a), (b), (c)) == 0)
52 #define	streq(a, b)		(strcmp((a), (b)) == 0)
53 #define	strneq(a, b, c)		(strncmp((a), (b), (c)) == 0)
54 
55 /* max l10n message length we will display */
56 #define	MSG_MAX			1024
57 
58 /* main.c */
59 extern	void		log_msg(LogMsgType, const char *, ...);
60 extern	void		log_pkgerr(LogMsgType, PKG_ERR *);
61 extern	void		set_verbose(boolean_t);
62 extern	boolean_t	get_verbose(void);
63 /* lock.c */
64 extern int		admin_lock(int, char **);
65 /* listcert.c */
66 extern int		listcert(int, char **);
67 /* importcert.c */
68 extern int		addcert(int, char **);
69 /* removecert.c */
70 extern int		removecert(int, char **);
71 
72 /* certs.c */
73 extern int		load_cert_and_key(PKG_ERR *, FILE *,
74     keystore_encoding_format_t, char *, EVP_PKEY **, X509 **);
75 extern int		load_all_certs(PKG_ERR *, FILE *,
76     keystore_encoding_format_t, char *, STACK_OF(X509) **);
77 
78 #define	PKGADM_DBSTATUS_TEXT	"text"
79 
80 #ifdef __cplusplus
81 }
82 #endif
83 
84 #endif /* _PKGADM_H */
85