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/*
2N/A * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A#ifndef _LIBHOTPLUG_IMPL_H
2N/A#define _LIBHOTPLUG_IMPL_H
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A#include <sys/param.h>
2N/A#include <paths.h>
2N/A#include <libhotplug.h>
2N/A
2N/A/*
2N/A * Definition of a node in a hotplug information snapshot.
2N/A */
2N/Astruct hp_node {
2N/A int hp_type;
2N/A char *hp_name;
2N/A char *hp_usage;
2N/A char *hp_description;
2N/A char *hp_basepath;
2N/A char *hp_driver;
2N/A int hp_instance;
2N/A int hp_state;
2N/A char *hp_state_priv;
2N/A int hp_state_ceiling;
2N/A time_t hp_last_change;
2N/A hp_node_t hp_parent;
2N/A hp_node_t hp_child;
2N/A hp_node_t hp_sibling;
2N/A};
2N/A
2N/A/*
2N/A * Definitions used for packing/unpacking snapshots.
2N/A */
2N/A#define HP_INFO_BASE "hp_info.basepath"
2N/A#define HP_INFO_NODE "hp_info.node"
2N/A#define HP_INFO_BRANCH "hp_info.branch"
2N/A#define HP_INFO_TYPE "hp_info.type"
2N/A#define HP_INFO_NAME "hp_info.name"
2N/A#define HP_INFO_USAGE "hp_info.usage"
2N/A#define HP_INFO_STATE "hp_info.state"
2N/A#define HP_INFO_STATE_PRIV "hp_info.state_priv"
2N/A#define HP_INFO_STATE_CEILING "hp_info.state_ceiling"
2N/A#define HP_INFO_DESC "hp_info.description"
2N/A#define HP_INFO_TIME "hp_info.last_change"
2N/A#define HP_INFO_DRIVER "hp_info.driver"
2N/A#define HP_INFO_INSTANCE "hp_info.instance"
2N/A
2N/A
2N/A/*
2N/A * Definitions for the door interface to hotplugd(1m).
2N/A */
2N/A#define HOTPLUGD_PID _PATH_SYSVOL "/hotplugd.pid"
2N/A#define HOTPLUGD_DOOR _PATH_SYSVOL "/hotplugd_door"
2N/A
2N/Atypedef enum {
2N/A HP_CMD_NONE = 0,
2N/A HP_CMD_GETINFO,
2N/A HP_CMD_CHANGESTATE,
2N/A HP_CMD_SETPRIVATE,
2N/A HP_CMD_GETPRIVATE,
2N/A HP_CMD_INSTALL,
2N/A HP_CMD_UNINSTALL,
2N/A HP_CMD_CREATE_PORT,
2N/A HP_CMD_REMOVE_PORT,
2N/A HP_CMD_SET_CEILING,
2N/A HP_CMD_CLEAR_CEILING
2N/A} hp_cmd_t;
2N/A
2N/A#define HPD_CMD "hp_door.cmd"
2N/A#define HPD_PATH "hp_door.path"
2N/A#define HPD_CONNECTION "hp_door.connection"
2N/A#define HPD_FLAGS "hp_door.flags"
2N/A#define HPD_STATE "hp_door.state"
2N/A#define HPD_OPTIONS "hp_door.options"
2N/A#define HPD_INFO "hp_door.info"
2N/A#define HPD_STATUS "hp_door.status"
2N/A#define HPD_SEQNUM "hp_door.seqnum"
2N/A#define HPD_HANDLE "hp_door.handle"
2N/A
2N/A/*
2N/A * Definition of macros to validate flags.
2N/A */
2N/A#define HP_INIT_FLAGS_VALID(f) ((f & ~(HPINFOUSAGE)) == 0)
2N/A#define HP_SET_STATE_FLAGS_VALID(f) \
2N/A ((f & ~(HPFORCE | HPQUERY | HPPROBEONE)) == 0)
2N/A#define HP_CLEAR_STATE_CEILING_VALID_FLAGS(f) \
2N/A ((f & ~(HPFORCE)) == 0)
2N/A
2N/A/*
2N/A * Definition of global flag to enable debug.
2N/A */
2N/Aextern int libhotplug_debug;
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _LIBHOTPLUG_IMPL_H */