diff options
Diffstat (limited to 'usr/src/uts/common/sys/mdesc.h')
-rw-r--r-- | usr/src/uts/common/sys/mdesc.h | 60 |
1 files changed, 49 insertions, 11 deletions
diff --git a/usr/src/uts/common/sys/mdesc.h b/usr/src/uts/common/sys/mdesc.h index e05374f60e..4bd335c38f 100644 --- a/usr/src/uts/common/sys/mdesc.h +++ b/usr/src/uts/common/sys/mdesc.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * 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 * or http://www.opensolaris.org/os/licensing. @@ -19,8 +18,9 @@ * * CDDL HEADER END */ + /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -87,22 +87,39 @@ extern "C" { #ifndef _ASM /* { */ -typedef uint64_t mde_cookie_t; +/* + * Opaque handles for use in external interfaces + */ + +typedef void *md_t; + +typedef uint64_t mde_cookie_t; #define MDE_INVAL_ELEM_COOKIE ((mde_cookie_t)-1) typedef uint32_t mde_str_cookie_t; #define MDE_INVAL_STR_COOKIE ((mde_str_cookie_t)-1) +typedef uint64_t md_diff_cookie_t; +#define MD_INVAL_DIFF_COOKIE ((md_diff_cookie_t)-1) - /* Opaque structure for handling in functions */ -typedef void * md_t; +#define MDESC_INVAL_GEN (0) +/* + * External structure for MD diff interface + */ +typedef struct { + uint8_t type; /* property type */ + char *namep; /* property name */ +} md_prop_match_t; +/* + * External Interface + */ -extern md_t *md_init(void *); -extern md_t *md_init_intern(uint64_t *, void*(*)(size_t), - void (*)(void*, size_t)); +extern md_t *md_init_intern(uint64_t *, + void *(*allocp)(size_t), + void (*freep)(void *, size_t)); extern int md_fini(md_t *); @@ -112,6 +129,10 @@ extern mde_str_cookie_t md_find_name(md_t *, char *namep); extern mde_cookie_t md_root_node(md_t *); +extern uint64_t md_get_gen(md_t *); + +extern size_t md_get_bin_size(md_t *); + extern int md_scan_dag(md_t *, mde_cookie_t, mde_str_cookie_t, @@ -134,6 +155,24 @@ extern int md_get_prop_data(md_t *, uint8_t **, int *); +extern md_diff_cookie_t md_diff_init(md_t *, + mde_cookie_t, + md_t *, + mde_cookie_t, + char *, + md_prop_match_t *); + +extern int md_diff_added(md_diff_cookie_t, + mde_cookie_t **); + +extern int md_diff_removed(md_diff_cookie_t, + mde_cookie_t **); + +extern int md_diff_matched(md_diff_cookie_t, + mde_cookie_t **, + mde_cookie_t **); + +extern int md_diff_fini(md_diff_cookie_t); #endif /* } _ASM */ @@ -150,7 +189,6 @@ extern int md_get_prop_data(md_t *, #define MDESCIOCSSZ (MDESCIOC | 2) /* Set new quote buffer size */ #define MDESCIOCDISCARD (MDESCIOC | 3) /* Discard quotes and reset */ - #ifdef __cplusplus } #endif |