summaryrefslogtreecommitdiff
path: root/usr/src/man/man3picltree/libpicltree.3picltree
blob: 2651d0d63d1461839d72ed02daab762441688245 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
'\" te
.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the 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.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH LIBPICLTREE 3PICLTREE "Mar 1, 2004"
.SH NAME
libpicltree \- PTree and Plug-in Registration interface library
.SH SYNOPSIS
.LP
.nf
\fBcc\fR [\fIflag \&.\|.\|.\fR] \fIfile \fR\&.\|.\|. \fB-lpicltree\fR [\fIlibrary \&.\|.\|.\fR]
#include <picltree.h>
.fi

.SH DESCRIPTION
.sp
.LP
The PTree interface is the set of functions and data structures to access and
manipulate the PICL tree. The daemon and the plug-in modules use the PTree
interface.
.sp
.LP
The Plug-in Registration interface is used by the plug-in modules to register
themselves with the daemon.
.sp
.LP
The plug-in modules create the nodes and properties of the tree. At the time of
creating a property, the plug-ins specify the property information in the
\fBptree_propinfo_t\fR structure defined as:
.sp
.in +2
.nf
typedef struct {
    int             version;    /* version */
    picl_propinfo_t piclinfo;   /* info to clients */
    int             (*read)(ptree_rarg_t *arg, void *buf);
                                /* read access function for */
                                /* volatile prop */
    int             (*write)(ptree_warg_t *arg, const void *buf);
                                /* write access function for */
                                /* volatile prop */
} ptree_propinfo_t;
.fi
.in -2

.sp
.LP
See \fBlibpicl\fR(3PICL) for more information on PICL tree nodes and
properties.
.sp
.LP
The maximum size of a property value cannot exceed \fBPICL_PROPSIZE_MAX\fR.  It
is currently set to 512KB.
.SS "Volatile Properties"
.sp
.LP
In addition to \fBPICL_READ\fR and \fBPICL_WRITE\fR property access modes, the
plug-in modules specify whether a property is volatile or not by setting the
bit \fBPICL_VOLATILE\fR.
.sp
.in +2
.nf
#define   PICL_VOLATILE   0x4
.fi
.in -2

.sp
.LP
For a volatile property, the plug-in module provides the access functions to
read and/or write the property in the \fBptree_propinfo_t\fR argument passed
when creating the property.
.sp
.LP
The daemon invokes the access functions of volatile properties when clients
access their values. Two arguments are passed to the read access functions. The
first argument is a pointer to \fBptree_rarg_t\fR, which contains the handle of
the node, the handle of the accessed property and the credentials of the
caller. The second argument is a pointer to the  buffer where the value is to
be copied.
.sp
.in +2
.nf
typedef struct {
         picl_nodehdl_t nodeh;
         picl_prophdl_t proph;
         door_cred_t    cred;
} ptree_rarg_t;
.fi
.in -2

.sp
.LP
The prototype of the read access function for volatile property is:
.sp
.in +2
.nf
int read(ptree_rarg_t *rarg, void *buf);
.fi
.in -2

.sp
.LP
The read function returns \fBPICL_SUCCESS\fR to indicate successful completion.
.sp
.LP
Similarly, when a write access is performed on a volatile property, the daemon
invokes the write access function provided by the plug-in for that property and
passes it two arguments. The first argument is a pointer to \fBptree_warg_t\fR,
which contains the handle to the node, the handle of the accessed property and
the credentials of the caller. The second argument is a pointer to the buffer
containing the value to be written.
.sp
.in +2
.nf
typedef struct {
        picl_nodehdl_t  nodeh;
        picl_prophdl_t  proph;
        door_cred_t     cred;
} ptree_warg_t;
.fi
.in -2

.sp
.LP
The prototype of the write access function for volatile property is:
.sp
.in +2
.nf
int write(ptree_warg_t *warg, const void *buf);
.fi
.in -2

.sp
.LP
The write function returns \fBPICL_SUCCESS\fR to indicate successful
completion.
.sp
.LP
For all volatile properties, the 'size' of the property must be specified to be
the maximum possible size of the value. The maximum size of the value cannot
exceed \fBPICL_PROPSIZE_MAX\fR. This allows a client to allocate a sufficiently
large buffer before retrieving a volatile property's value
.SS "Plug-in Modules"
.sp
.LP
Plug-in modules are shared objects that are located in well-known directories
for the daemon to locate and load them. Plug-in module's are located in the one
of the following plug-in directories depending on the plaform-specific nature
of the data they collect and publish.
.sp
.in +2
.nf
/usr/platform/picl/plugins/`uname -i`/
/usr/platform/picl/plugins/`uname -m`/
/usr/lib/picl/plugins/
.fi
.in -2

.sp
.LP
A plug-in module may specify its dependency on another plug-in module using the
\fB-l\fR linker option. The plug-ins are loaded by the PICL daemon using
\fBdlopen\fR(3C) according to the specified dependencies. Each plug-in module
must define a \fB\&.init\fR section, which is executed when the plug-in module
is loaded, to register themselves with the daemon. See
\fBpicld_plugin_register\fR(3PICLTREE) for more information on plug-in
registration.
.sp
.LP
The plug-in modules may use the \fBpicld_log\fR(3PICLTREE) function to log
their messages to the system log file.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
MT-Level	MT-Safe
.TE

.SH SEE ALSO
.sp
.LP
\fBlibpicl\fR(3PICL), \fBlibpicltree\fR(3LIB), \fBpicld_log\fR(3PICLTREE),
\fBpicld_plugin_register\fR(3PICLTREE), \fBattributes\fR(5)