libhotplug_impl.h revision 2
0N/A/*
0N/A * CDDL HEADER START
1472N/A *
0N/A * The contents of this file are subject to the terms of the
0N/A * Common Development and Distribution License (the "License").
0N/A * You may not use this file except in compliance with the License.
0N/A *
0N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0N/A * or http://www.opensolaris.org/os/licensing.
0N/A * See the License for the specific language governing permissions
0N/A * and limitations under the License.
0N/A *
0N/A * When distributing Covered Code, include this CDDL HEADER in each
0N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
0N/A * If applicable, add the following below this CDDL HEADER, with the
0N/A * fields enclosed by brackets "[]" replaced with your own identifying
0N/A * information: Portions Copyright [yyyy] [name of copyright owner]
0N/A *
0N/A * CDDL HEADER END
1472N/A */
1472N/A
1472N/A/*
0N/A * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
0N/A */
0N/A
0N/A#ifndef _LIBHOTPLUG_IMPL_H
0N/A#define _LIBHOTPLUG_IMPL_H
0N/A
0N/A#ifdef __cplusplus
0N/Aextern "C" {
0N/A#endif
0N/A
0N/A#include <sys/param.h>
0N/A#include <paths.h>
0N/A#include <libhotplug.h>
0N/A
0N/A/*
0N/A * Definition of a node in a hotplug information snapshot.
1328N/A */
1328N/Astruct hp_node {
1328N/A int hp_type;
0N/A char *hp_name;
0N/A char *hp_usage;
0N/A char *hp_description;
0N/A char *hp_basepath;
0N/A char *hp_driver;
0N/A int hp_instance;
0N/A int hp_state;
0N/A char *hp_state_priv;
0N/A int hp_state_ceiling;
0N/A time_t hp_last_change;
0N/A hp_node_t hp_parent;
0N/A hp_node_t hp_child;
0N/A hp_node_t hp_sibling;
0N/A};
0N/A
0N/A/*
0N/A * Definitions used for packing/unpacking snapshots.
0N/A */
0N/A#define HP_INFO_BASE "hp_info.basepath"
0N/A#define HP_INFO_NODE "hp_info.node"
0N/A#define HP_INFO_BRANCH "hp_info.branch"
0N/A#define HP_INFO_TYPE "hp_info.type"
0N/A#define HP_INFO_NAME "hp_info.name"
0N/A#define HP_INFO_USAGE "hp_info.usage"
0N/A#define HP_INFO_STATE "hp_info.state"
0N/A#define HP_INFO_STATE_PRIV "hp_info.state_priv"
0N/A#define HP_INFO_STATE_CEILING "hp_info.state_ceiling"
0N/A#define HP_INFO_DESC "hp_info.description"
0N/A#define HP_INFO_TIME "hp_info.last_change"
0N/A#define HP_INFO_DRIVER "hp_info.driver"
0N/A#define HP_INFO_INSTANCE "hp_info.instance"
0N/A
0N/A
91N/A/*
0N/A * Definitions for the door interface to hotplugd(1m).
0N/A */
659N/A#define HOTPLUGD_PID _PATH_SYSVOL "/hotplugd.pid"
0N/A#define HOTPLUGD_DOOR _PATH_SYSVOL "/hotplugd_door"
0N/A
0N/Atypedef enum {
0N/A HP_CMD_NONE = 0,
659N/A HP_CMD_GETINFO,
659N/A HP_CMD_CHANGESTATE,
659N/A HP_CMD_SETPRIVATE,
659N/A HP_CMD_GETPRIVATE,
659N/A HP_CMD_INSTALL,
659N/A HP_CMD_UNINSTALL,
659N/A HP_CMD_CREATE_PORT,
659N/A HP_CMD_REMOVE_PORT,
659N/A HP_CMD_SET_CEILING,
0N/A HP_CMD_CLEAR_CEILING
0N/A} hp_cmd_t;
0N/A
0N/A#define HPD_CMD "hp_door.cmd"
0N/A#define HPD_PATH "hp_door.path"
0N/A#define HPD_CONNECTION "hp_door.connection"
0N/A#define HPD_FLAGS "hp_door.flags"
0N/A#define HPD_STATE "hp_door.state"
0N/A#define HPD_OPTIONS "hp_door.options"
0N/A#define HPD_INFO "hp_door.info"
0N/A#define HPD_STATUS "hp_door.status"
0N/A#define HPD_SEQNUM "hp_door.seqnum"
0N/A#define HPD_HANDLE "hp_door.handle"
0N/A
0N/A/*
0N/A * Definition of macros to validate flags.
0N/A */
0N/A#define HP_INIT_FLAGS_VALID(f) ((f & ~(HPINFOUSAGE)) == 0)
0N/A#define HP_SET_STATE_FLAGS_VALID(f) \
0N/A ((f & ~(HPFORCE | HPQUERY | HPPROBEONE)) == 0)
0N/A#define HP_CLEAR_STATE_CEILING_VALID_FLAGS(f) \
0N/A ((f & ~(HPFORCE)) == 0)
0N/A
0N/A/*
0N/A * Definition of global flag to enable debug.
0N/A */
0N/Aextern int libhotplug_debug;
0N/A
0N/A#ifdef __cplusplus
0N/A}
0N/A#endif
0N/A
0N/A#endif /* _LIBHOTPLUG_IMPL_H */
0N/A