2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
2N/A * Use is subject to license terms.
2N/A */
2N/A
2N/A#ifndef _UUID_MISC_H
2N/A#define _UUID_MISC_H
2N/A
2N/A/*
2N/A * The copyright in this file is taken from the original Leach
2N/A * & Salz UUID specification, from which this implementation
2N/A * is derived.
2N/A */
2N/A
2N/A/*
2N/A * Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc.
2N/A * Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. &
2N/A * Digital Equipment Corporation, Maynard, Mass. Copyright (c) 1998
2N/A * Microsoft. To anyone who acknowledges that this file is provided
2N/A * "AS IS" without any express or implied warranty: permission to use,
2N/A * copy, modify, and distribute this file for any purpose is hereby
2N/A * granted without fee, provided that the above copyright notices and
2N/A * this notice appears in all source code copies, and that none of the
2N/A * names of Open Software Foundation, Inc., Hewlett-Packard Company,
2N/A * or Digital Equipment Corporation be used in advertising or
2N/A * publicity pertaining to distribution of the software without
2N/A * specific, written prior permission. Neither Open Software
2N/A * Foundation, Inc., Hewlett-Packard Company, Microsoft, nor Digital
2N/A * Equipment Corporation makes any representations about the
2N/A * suitability of this software for any purpose.
2N/A */
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A#include <uuid/uuid.h>
2N/A#include <sys/types.h>
2N/A#include <thread.h>
2N/A
2N/Atypedef uint64_t uuid_time_t;
2N/A
2N/A/*
2N/A * data type for UUID generator persistent state
2N/A */
2N/Atypedef struct {
2N/A uuid_time_t ts; /* saved timestamp */
2N/A uuid_node_t node; /* saved node ID */
2N/A uint16_t clock; /* saved clock sequence */
2N/A} uuid_state_t;
2N/A
2N/Atypedef struct {
2N/A mutex_t lock;
2N/A uuid_state_t state;
2N/A} shared_buffer_t;
2N/A
2N/A#define STATE_LOCATION "/var/sadm/system/uuid_state"
2N/A#define URANDOM_PATH "/dev/urandom"
2N/A#define MAX_RETRY 8
2N/A#define VER1_MASK 0xefff
2N/A
2N/A#define STATE_FILE 1
2N/A#define TEMP_FILE 2
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _UUID_MISC_H */