Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
libpicltree(3PICLTREE)	PICL Plug-In Library Functions	libpicltree(3PICLTREE)

NAME
       libpicltree - PTree and Plug-in Registration interface library

SYNOPSIS
       cc [flag	...] file ... -lpicltree [library ...]
       #include	<picltree.h>

DESCRIPTION
       The  PTree interface is the set of functions and	data structures	to ac-
       cess and	manipulate the PICL tree. The daemon and the  plug-in  modules
       use the PTree interface.

       The  Plug-in  Registration  interface is	used by	the plug-in modules to
       register	themselves with	the daemon.

       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 informa-
       tion in the ptree_propinfo_t structure defined as:

       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;

       See libpicl(3PICL) for more information on PICL tree nodes and  proper-
       ties.

       The  maximum  size of a property	value cannot exceed PICL_PROPSIZE_MAX.
       It is currently set to 512KB.

   Volatile Properties
       In addition to PICL_READ	and  PICL_WRITE	 property  access  modes,  the
       plug-in	modules	 specify whether a property is volatile	or not by set-
       ting the	bit PICL_VOLATILE.

       #define	 PICL_VOLATILE	 0x4

       For a volatile property,	the plug-in module provides the	 access	 func-
       tions  to  read and/or write the	property in the	ptree_propinfo_t argu-
       ment passed when	creating the property.

       The daemon invokes the access functions	of  volatile  properties  when
       clients	access	their values. Two arguments are	passed to the read ac-
       cess functions. The first argument is a pointer to ptree_rarg_t,	 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.

       typedef struct {
		picl_nodehdl_t nodeh;
		picl_prophdl_t proph;
		door_cred_t    cred;
       } ptree_rarg_t;

       The prototype of	the read access	function for volatile property is:

       int read(ptree_rarg_t *rarg, void *buf);

       The  read  function returns PICL_SUCCESS	to indicate successful comple-
       tion.

       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  ptree_warg_t,  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.

       typedef struct {
	       picl_nodehdl_t  nodeh;
	       picl_prophdl_t  proph;
	       door_cred_t     cred;
       } ptree_warg_t;

       The prototype of	the write access function for volatile property	is:

       int write(ptree_warg_t *warg, const void	*buf);

       The write function returns PICL_SUCCESS to indicate successful  comple-
       tion.

       For  all	volatile properties, the 'size'	of the property	must be	speci-
       fied to be the maximum possible size of the value. The maximum size  of
       the  value cannot exceed	PICL_PROPSIZE_MAX. This	allows a client	to al-
       locate a	sufficiently large buffer before retrieving a  volatile	 prop-
       erty's value

   Plug-in Modules
       Plug-in	modules	 are shared objects that are located in	well-known di-
       rectories 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.

       /usr/platform/picl/plugins/`uname -i`/
       /usr/platform/picl/plugins/`uname -m`/
       /usr/lib/picl/plugins/

       A plug-in module	may specify its	dependency on another  plug-in	module
       using  the -l linker option. The	plug-ins are loaded by the PICL	daemon
       using dlopen(3C)	according to the specified dependencies. Each  plug-in
       module  must define a .init section, which is executed when the plug-in
       module is loaded, to register  themselves  with	the  daemon.  See  pi-
       cld_plugin_register(3PICLTREE)  for  more information on	plug-in	regis-
       tration.

       The plug-in modules may use the picld_log(3PICLTREE)  function  to  log
       their messages to the system log	file.

ATTRIBUTES
       See attributes(5) for descriptions of the following attributes:

       +-----------------------------+-----------------------------+
       |      ATTRIBUTE	TYPE	     |	    ATTRIBUTE VALUE	   |
       +-----------------------------+-----------------------------+
       |MT-Level		     |MT-Safe			   |
       +-----------------------------+-----------------------------+

SEE ALSO
       libpicl(3PICL),	   libpicltree(3LIB),	  picld_log(3PICLTREE),	   pi-
       cld_plugin_register(3PICLTREE), attributes(5)

SunOS 5.10			  1 Mar	2004		libpicltree(3PICLTREE)

NAME | SYNOPSIS | DESCRIPTION | ATTRIBUTES | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=libpicltree&sektion=3picltree&manpath=SunOS+5.10>

home | help