/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#ifndef _PKGLIB_H
#define _PKGLIB_H
#ifdef __cplusplus
extern "C" {
#endif
#include <limits.h>
#include <stdio.h>
#include <pkgdev.h>
#include <pkgstrct.h>
#include <netdb.h>
#include <boot_http.h>
#include "pkgerr.h"
#include "keystore.h"
#include "cfext.h"
/*
* The contents database file interface.
*/
/* Some commands modify the internal database: add them here */
typedef enum {
} start_mode_t;
typedef struct pkgcmd {
int cmd;
} pkgcmd_t;
typedef struct pkgfilter {
int cmd;
int len;
} pkgfilter_t;
/*
* Virtual File Protocol definitions
*/
/*
* flags associated with virtual file protocol operations; note that these flags
* may only occupy the low order 16 bits of the 32-bit unsigned flag.
*/
typedef unsigned long VFPFLAGS_T;
/* virtual file protocol object */
/* structure behind the virtual file protocol object */
struct _vfp {
};
/*
* get highest modified byte (length) contained in vfp
*
* determine number of bytes to write - it will be the highest of:
* -- the current pointer into the file - this is updated whenever
* the location of the file is changed by a single byte
* -- the last "high water mark" - the last known location that
* was written to the file - updated only when the location
* of the file is directly changed - e.g. vfpSetCurrCharPtr,
* vfpTruncate, vfpRewind.
* this reduces the "bookkeeping" that needs to be done to know
* how many bytes to write out to the file - typically a file is
* written sequentially so the current file pointer is sufficient
* to determine how many bytes to write out.
*/
/*
* increment current pointer by specified delta
* if the delta exceeds the buffer size, set pointer to buffer end
*/
{ \
} \
} \
}
/* get the path associated with the vfp */
/* get a string from the vfp into a fixed size buffer */
{ \
if (XXlXX > 1) { \
XXlXX--; \
} \
} \
*XXpXX++ = '\0'; \
} \
}
/* get number of bytes remaining to read */
/* get number of bytes remaining to write */
/* put current character and increment to next */
{ \
}
/* put integer to current character and increment */
/* put long to current character and increment */
/* get current character and increment to next */
/* get current character - do not increment */
/* get pointer to current character */
/* increment current character pointer */
/* decrement current character pointer */
/* get pointer to first data byte in buffer */
/* get pointer to last data byte in buffer */
/* set pointer to current character */
} \
/* set pointer to last data byte in buffer */
} \
}
/* seek to end of file - one past last data byte in file */
/* get number of bytes between current char and specified char */
/* put string to current character and increment */
{ \
}
/* put fixed number of bytes to current character and increment */
{ \
} else { \
} \
}
/* put format one arg to current character and increment */
{ \
char xxTeMpXX[256]; \
}
struct dm_buf {
};
/* This structure is used to hold a dynamically growing string */
struct dstr {
char *pc;
int len;
int max;
};
/* setmapmode() defines */
/* max length for printed attributes */
/*
* These three defines indicate that the prototype file contains a '?'
* meaning do not specify this data in the pkgmap entry.
*/
/* Settings for network admin defaults */
#define AUTH_NOCHECK 0
/* package header magic tokens */
/* name of security files */
/*
* The next three mean that no mode, owner or group was specified or that the
* one specified is invalid for some reason. Sometimes this is an error in
* which case it is generally converted to CUR* with a warning. Other times
* it means "look it up" by stating the existing file system object pointred
* to in the prototype file.
*/
/* string comparitor abbreviators */
extern int is_not_valid_length(char **category);
extern char **get_categories(char *catg_arg);
extern void pkglist_cont(char *keyword);
extern char *get_prog_name(void);
extern char *set_prog_name(char *name);
int allow_checksum);
extern char *getErrbufAddr(void);
extern int getErrbufSize(void);
extern char *getErrstr(void);
extern int ds_totread; /* total number of parts read */
extern int ds_getinfo(char *string);
extern boolean_t ds_fd_open(void);
extern int ds_next(char *, char *);
extern int ds_readbuf(char *device);
char *a_inputFile, char *a_cmd, ...);
extern void setmapmode(int mode_no);
extern int isFdRemote(int a_fd);
extern int isFstypeRemote(char *a_fstype);
extern int isPathRemote(char *a_path);
...);
char *arg[]);
int getvolflg);
int options, keystore_handle_t, char *);
extern void set_memalloc_failure_func(void (*)(int));
extern void set_passphrase_prompt(char *);
extern void set_passphrase_passarg(char *);
extern int pkg_passphrase_cb(char *, int, int, void *);
extern void canonize_slashes(char *file);
extern void checksum_off(void);
extern void checksum_on(void);
extern void ds_skiptoend(char *device);
extern void ecleanup(void);
/*PRINTFLIKE1*/
/*PRINTFLIKE1*/
extern void rpterr(void);
extern void set_nonABI_symlinks(void);
extern int nonABI_symlinks(void);
extern void disable_attribute_check(void);
extern int get_disable_attribute_check(void);
/* security.c */
extern void sec_init(void);
extern char *get_subject_display_name(X509 *);
extern char *get_issuer_display_name(X509 *);
extern char *get_serial_num(X509 *);
/* pkgstr.c */
void pkgstrConvertUllToTimeString_r(unsigned long long a_time,
char *pkgstrConvertPathToBasename(char *a_path);
char *pkgstrConvertPathToDirname(char *a_path);
char *pkgstrLocatePathBasename(char *a_path);
char *a_separators);
char a_separator, char *a_separators);
char *a_separators);
char *pkgstrPrintf(char *a_format, ...);
char *a_separators, int a_index);
void pkgstrRemoveLeadingWhitespace(char **a_str);
/* vfpops.c */
char *a_path);
/* handlelocalfs.c */
boolean_t enable_local_fs(void);
boolean_t restore_local_fs(void);
/* pkgserv.c */
extern void pkgcloseserver(PKGserver);
int *);
extern void pkgclosefilter(PKGserver);
extern char *pkggetentry(PKGserver, int *, int *);
extern char *pkggetentry_named(PKGserver, const char *, int *,
int *);
extern void pkgserversetmode(start_mode_t);
extern start_mode_t pkgservergetmode(void);
extern start_mode_t pkgparsemode(const char *);
extern char *pkgmodeargument(start_mode_t);
#ifdef __cplusplus
}
#endif
#endif /* _PKGLIB_H */