xref: /onnv-gate/usr/src/lib/libfru/include/libfrup.h (revision 4271:dda1ded496b7)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*4271Srie  * Common Development and Distribution License (the "License").
6*4271Srie  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*4271Srie  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #ifndef	_LIBFRUP_H
270Sstevel@tonic-gate #define	_LIBFRUP_H
280Sstevel@tonic-gate 
290Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
300Sstevel@tonic-gate 
310Sstevel@tonic-gate #ifdef __cplusplus
320Sstevel@tonic-gate extern "C" {
330Sstevel@tonic-gate #endif
340Sstevel@tonic-gate 
350Sstevel@tonic-gate #include <stdarg.h>
360Sstevel@tonic-gate 
370Sstevel@tonic-gate #include "libfru.h"
380Sstevel@tonic-gate #include "../../libfruutils/fru_tag.h"
390Sstevel@tonic-gate 
400Sstevel@tonic-gate typedef uint64_t fru_seghdl_t;
410Sstevel@tonic-gate typedef enum {FRU_ENCRYPT, FRU_DECRYPT} fru_encrypt_t;
420Sstevel@tonic-gate typedef fru_errno_t
430Sstevel@tonic-gate (*fru_encrypt_func_t)(fru_encrypt_t en_dec, unsigned char *buf, size_t buf_len);
440Sstevel@tonic-gate 
450Sstevel@tonic-gate /*
460Sstevel@tonic-gate  * Type for pointers to functions for terminating the processing of a node
470Sstevel@tonic-gate  * (after its children have been processed)
480Sstevel@tonic-gate  */
490Sstevel@tonic-gate typedef void	(*end_node_fp_t)(fru_nodehdl_t node, const char *path,
500Sstevel@tonic-gate 					const char *name, void *args);
510Sstevel@tonic-gate 
520Sstevel@tonic-gate /*
530Sstevel@tonic-gate  * Project-private exported symbols
540Sstevel@tonic-gate  */
55*4271Srie extern	fru_encrypt_func_t encrypt_func;
560Sstevel@tonic-gate 
57*4271Srie extern	fru_errno_t fru_encryption_supported(void);
580Sstevel@tonic-gate 
59*4271Srie extern	fru_errno_t fru_walk_tree(fru_nodehdl_t node, const char *prior_path,
600Sstevel@tonic-gate 		fru_errno_t (*process_node)(fru_nodehdl_t node,
610Sstevel@tonic-gate 						const char *path,
620Sstevel@tonic-gate 						const char *name, void *args,
630Sstevel@tonic-gate 						end_node_fp_t *end_node,
640Sstevel@tonic-gate 						void **end_args),
650Sstevel@tonic-gate 		void *args);
660Sstevel@tonic-gate 
67*4271Srie extern	int fru_pathmatch(const char *path, const char *searchpath);
680Sstevel@tonic-gate 
69*4271Srie extern	fru_errno_t fru_for_each_segment(fru_nodehdl_t node,
700Sstevel@tonic-gate 					int (*function)(fru_seghdl_t segment,
710Sstevel@tonic-gate 						void *args),
720Sstevel@tonic-gate 					void *args);
73*4271Srie extern	fru_errno_t fru_get_segment_name(fru_seghdl_t segment, char **name);
74*4271Srie extern	fru_errno_t fru_for_each_packet(fru_seghdl_t segment,
750Sstevel@tonic-gate 				int (*function)(fru_tag_t *tag,
760Sstevel@tonic-gate 						uint8_t *payload,
770Sstevel@tonic-gate 						size_t length, void *args),
780Sstevel@tonic-gate 				void *args);
790Sstevel@tonic-gate 
800Sstevel@tonic-gate #ifdef __cplusplus
810Sstevel@tonic-gate }
820Sstevel@tonic-gate #endif
830Sstevel@tonic-gate 
840Sstevel@tonic-gate #endif /* _LIBFRUP_H */
85