Go to main content

man pages section 3: Library Interfaces and Headers

Exit Print View

Updated: Thursday, June 13, 2019
 
 

libreparse(3LIB)

Name

libreparse - reparse point library

Synopsis

cc [ flag... ] file... –lreparse [ library... ]
#include <sys/fs_reparse.h>
#include <rp_plugin.h>

Description

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.

INTERFACES

The shared object libdl.so.1 provides the following public interfaces. See intro(3) for additional information on shared object interfaces.

reparse_add
reparse_create
reparse_delete
reparse_deref
reparse_free
reparse_init
reparse_parse
reparse_remove
reparse_unparse
reparse_validate
rp_plugin_init

The shared object “plugins” must each provide a versioned ops table of the form:

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

For example,

reparse_plugin_ops_t reparse_plugin_ops = {
     REPARSE_PLUGIN_V1,
     nfs_init,
     nfs_fini,
     nfs_svc_types,
     nfs_supports_svc,
     nfs_form,
     nfs_deref
};

The version 1 ops table supports the following operations:

int (*rpo_init)(void);

This is a one-time initialization function that will be called by libreparse.so 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 errno values to indicate an error.

void (*rpo_fini)(void);

This is a one-time termination function that will be called by libreparse.so prior closing the plugin. Once called, libreparse.so will not call any other operations on the plugin.

char *(*rpo_svc_types)(void);

Returns a pointer to a string containing a list of comma separated svc_types. svc_type names are case-insensitive and white space in the returned string is irrelevant and must be ignored by parsers.

boolean_t (*rpo_supports_svc)(const char *svc_type);

This function will return true if the plugin supports the specified service type, otherwise it must return false.

int *(*rpo_form)(const char *svc_type, const char *string, char *buf, size_t *bufsize);

Formats a string with the appropriate service-specific syntax to create a reparse point of the given svc_type, using the string from the reparse_add(3REPARSE) call as part of the string. The caller specifies the size of the buffer provided via *bufsize; the routine will fail with EOVERFLOW if the results will not fit in the buffer, in which case, * bufsize will contain the number of bytes needed to hold the results.

int (*rpo_deref)(const char *svc_type, const char *svc_data, char *buf, size_t *bufsize );

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 *bufsize; the routine will fail with EOVERFLOW if the results will not fit in the buffer, in which case, *bufsize will contain the number of bytes needed to hold the results.

Files

/usr/lib/libreparse.so.1

shared object

/usr/lib/64/libreparse.so.1

64-bit shared object

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/library
Interface Stability
Committed
MT-Level
Safe

See Also

reparse_add(3REPARSE), intro(3), attributes(7)