/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#ifndef __LIBVS_H__
#define __LIBVS_H__
#include <netdb.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Property IDs - general property group */
/* Property IDs - scan engine property groups */
/* Check for whether a property id is a scan engine id */
/* The maximum property id value - across all property groups */
/* The number of properties in the largest property group */
/* Range of scan engine IDs and max number of scan engines supported */
/* Min & Max scan engine connections per engine */
/* Can accommodate a string-ified ULONG_MAX plus unit specifier */
/* libvscan error codes */
#define VS_ERR_NONE 0
/* RBAC authorizations */
/* statistics door interface */
/* scan statistics door request type */
typedef enum {
typedef struct vs_stats_req {
typedef struct vs_stats {
struct {
} vs_stats_t;
typedef struct vs_stats_rsp {
/*
* General service configuration properties
*/
typedef struct vs_props {
} vs_props_t;
/*
* Scan engine configuration properties. These are defined
* per-engine.
*/
typedef struct vs_props_se {
typedef struct vs_props_all {
/*
* General service configuration properties API
* These functions return VS_ERR_XXX error codes.
*/
int vs_props_get_all(vs_props_all_t *);
/*
* Scan engine configuration properties API
* These functions return VS_ERR_XXX error codes.
*/
int vs_props_se_delete(const char *);
/* Get error string for error code */
const char *vs_strerror(int);
int vs_statistics(vs_stats_t *);
int vs_statistics_reset(void);
/* Utility functions */
/*
* Replace comma separators with '\0'.
*
* Types contains comma separated rules each beginning with +|-
* - embedded commas are escaped by backslash
* - backslash is escaped by backslash
* - a single backslash not followed by comma is illegal
*
* On entry to the function len must contain the length of
* the buffer. On sucecssful exit len will contain the length
* of the parsed data within the buffer.
*
* Returns 0 on success, -1 on failure
*/
int vs_parse_types(const char *, char *, uint32_t *);
/*
* Converts a size string in the format into an integer.
*
* A size string is a numeric value followed by an optional unit
* specifier which is used as a multiplier to calculate a raw
* number.
* The size string format is: N[.N][KMGTP][B]
*
* The numeric value can contain a decimal portion. Unit specifiers
* are either a one-character or two-character string; i.e. "K" or
* "KB" for kilobytes. Unit specifiers must follow the numeric portion
* immediately, and are not case-sensitive.
*
* If either "B" is specified, or there is no unit specifier portion
* in the string, the numeric value is calculated with no multiplier
* (assumes a basic unit of "bytes").
*
* Returns: -1: Failure; errno set to specify the error.
* 0: Success.
*/
int vs_strtonum(const char *, uint64_t *);
#ifdef __cplusplus
}
#endif
#endif /* __LIBVS_H__ */