'\" te .\" Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. .TH libreparse 3LIB "23 Aug 2011" "SunOS 5.11" "Interface Libraries" .SH NAME libreparse \- reparse point library .SH SYNOPSIS .LP .nf cc [ \fIflag\fR... ] \fIfile\fR... \fB-lreparse\fR [ \fIlibrary\fR... ] #include #include .fi .SH DESCRIPTION .sp .LP The functions in this library perform operations related to "reparse points", which are the basis of Microsoft DFS referrals and NFS referrals support on Solaris SMB and NFS file servers. A service which offers namespace redirection can provide "plugins", libraries which provide creation and interpretation services for reparse points. .SH INTERFACES .sp .LP The shared object \fBlibdl.so.1\fR provides the following public interfaces. See \fBIntro\fR(3) for additional information on shared object interfaces. .sp .sp .TS tab(); lw(2.75i) lw(2.75i) lw(2.75i) lw(2.75i) . \fBreparse_add\fR\fBreparse_create\fR \fBreparse_delete\fR\fBreparse_deref\fR \fBreparse_free\fR\fBreparse_init\fR \fBreparse_parse\fR\fBreparse_remove\fR \fBreparse_unparse\fR\fBreparse_validate\fR \fBrp_plugin_init\fR .TE .sp .LP The shared object "plugins" must each provide a versioned ops table of the form: .sp .in +2 .nf typedef struct reparse_plugin_ops { int rpo_version; /* version number */ int (*rpo_init)(void); void (*rpo_fini)(void); char *(*rpo_svc_types)(void); boolean_t (*rpo_supports_svc)(const char *); char *(*rpo_form)(const char *, const char *, char *, size_t *); int (*rpo_deref)(const char *, const char *, char *, size_t *); } reparse_plugin_ops_t .fi .in -2 .sp .LP For example, .sp .in +2 .nf reparse_plugin_ops_t reparse_plugin_ops = { REPARSE_PLUGIN_V1, nfs_init, nfs_fini, nfs_svc_types, nfs_supports_svc, nfs_form, nfs_deref }; .fi .in -2 .sp .LP The version 1 ops table supports the following operations: .sp .ne 2 .mk .na \fB\fBint\fR (*\fBrpo_init\fR)(\fBvoid\fR);\fR .ad .sp .6 .RS 4n This is a one-time initialization function that will be called by \fBlibreparse.s\fRo upon loading the plugin prior to any other operations. This provides the plugin with an opportunity to perform service specific initialization. This function must return zero on success or non-zero \fBerrno\fR values to indicate an error. .RE .sp .ne 2 .mk .na \fB\fBvoid\fR (*\fBrpo_fini\fR)(\fBvoid\fR);\fR .ad .sp .6 .RS 4n This is a one-time termination function that will be called by \fBlibreparse.so\fR prior closing the plugin. Once called, \fBlibreparse.so\fR will not call any other operations on the plugin. .RE .sp .ne 2 .mk .na \fB\fBchar *\fR(*\fBrpo_svc_types\fR)(\fBvoid\fR);\fR .ad .sp .6 .RS 4n Returns a pointer to a string containing a list of comma separated \fIsvc_type\fRs. \fIsvc_type\fR names are case-insensitive and white space in the returned string is irrelevant and must be ignored by parsers. .RE .sp .ne 2 .mk .na \fB\fBboolean_t\fR (*\fBrpo_supports_svc\fR)(\fBconst char *\fR\fIsvc_type\fR);\fR .ad .sp .6 .RS 4n This function will return true if the plugin supports the specified service type, otherwise it must return false. .RE .sp .ne 2 .mk .na \fB\fBint *\fR(*\fBrpo_form\fR)(\fBconst char *\fR\fIsvc_type\fR, \fBconst char *\fR\fIstring\fR, \fBchar *\fR\fIbuf\fR, \fBsize_t *\fR\fIbufsize\fR);\fR .ad .sp .6 .RS 4n Formats a string with the appropriate service-specific syntax to create a reparse point of the given \fIsvc_type\fR, using the string from the \fBreparse_add\fR(3REPARSE) call as part of the string. The caller specifies the size of the buffer provided via *\fIbufsize\fR; the routine will fail with \fBEOVERFLOW\fR if the results will not fit in the buffer, in which case, *\fIbufsize\fR will contain the number of bytes needed to hold the results. .RE .sp .ne 2 .mk .na \fB\fBint\fR (*\fBrpo_deref\fR)(\fBconst char *\fR\fIsvc_type\fR, \fBconst char *\fR\fIsvc_data\fR, \fBchar *\fR\fIbuf\fR, \fBsize_t *\fR\fIbufsize\fR);\fR .ad .sp .6 .RS 4n Accepts the service-specific item from the reparse point and returns the service-specific data requested. The caller specifies the size of the buffer provided via *\fIbufsize\fR; the routine will fail with \fBEOVERFLOW\fR if the results will not fit in the buffer, in which case, *\fIbufsize\fR will contain the number of bytes needed to hold the results. .RE .SH FILES .sp .ne 2 .mk .na \fB\fB/usr/lib/libreparse.so.1\fR\fR .ad .sp .6 .RS 4n shared object .RE .sp .ne 2 .mk .na \fB\fB/usr/lib/64/libreparse.so.1\fR\fR .ad .sp .6 .RS 4n 64-bit shared object .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Availabilitysystem/library _ Interface StabilityCommitted _ MT-LevelSafe .TE .SH SEE ALSO .sp .LP \fBIntro\fR(3), \fBreparse_add\fR(3REPARSE), \fBattributes\fR(5)