/*
* CDDL HEADER START
*
* 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
* 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]
*
* CDDL HEADER END
*/
/*
*/
#include <errno.h>
#include <unistd.h>
#include <strings.h>
#include <syslog.h>
#include <sys/fs_reparse.h>
#include "dfs.h"
#include "smb_reparse.h"
static int smb_reparse_init(const char *, nvlist_t **);
static void smb_reparse_free(nvlist_t *);
static int smb_reparse_set(const char *, nvlist_t *);
static int smb_reparse_deref(char *, char *, dfs_info_t *);
/*
* Checks the status of the object specified by 'path'
*
* Returns 0 and fills 'stat' with the proper status on
* success, otherwise returns an error code.
*/
int
{
int rptaglen;
return (0);
}
return (errno);
}
return (0);
}
return (errno);
else
return (0);
}
/*
* If the reparse point specified by the path already exists
* it is updated by given service type and its data. Update means
* that if such service type does not already exist, it is added
* otherwise it is overwritten by given data.
*
* If the reparse point does not exist, one is created with given
* service type and its data.
*/
int
{
int rc;
return (rc);
return (rc);
}
return (rc);
}
/*
* Removes the entry for the given service type from the
* specified reparse point. If there is no service entry
* left, the reparse point object will be deleted.
*/
int
{
int rc;
return (rc);
return (rc);
}
/* list is empty remove the object */
rc = 0;
} else {
}
return (rc);
}
/*
* Obtains referral data of the given service type from the specified
* reparse point. The service data read from the reparse point is passed
* to the reparsed plugin library to convert the data to a dfs_info_t.
*
* If 'info' is NULL, successful return means that the reparse
* point contains a record for the given service type.
*
* If info is non-NULL, a successful return will require the caller to
* release allocated memory by calling dfs_info_free().
*/
int
{
int rc;
return (rc);
break;
break;
}
}
return (rc);
}
int
{
char *stype;
int rc;
return (rc);
continue;
rc = 0;
break;
}
rc = 0;
break;
}
}
return (rc);
}
/*
* Initializes the given nvpair list.
*
* This function assumes that the object specified by this path
* is a reparse point, so it does not do any verification.
*
* If specified reparse point does not exist the function
* returns successfully with an empty nvpair list.
*
* If the object exists and readlink is successful then nvpair
* list is polulated with the reparse service information, otherwise
* an error code is returned.
*/
static int
{
int rc;
return (ENOMEM);
return (0);
reparse_free(*nvl);
return (errno);
}
reparse_free(*nvl);
return (rc);
}
return (0);
}
/*
* Frees given nvlist
*/
static void
{
}
/*
* Create a reparse point with given services in the passed
* nvlist. If the reparse point already exists, it will be
* deleted and a new one with the given data is created.
*/
static int
{
char *rp_data;
int rc;
return (rc);
return (rc);
}
return (rc);
}
/*
* This routine takes reparse point data (sdata) of the specified
* type (stype) and calls the reparse library (reparse_deref()) to
* convert it to a dfs referral of type dfs_info_t.
*
* reparse_deref() will call the appropriate reparse plugin library
* to do the conversion. The data returned from reparse_deref()
* is an xdr encoded dfs_info_t.
* reparse_deref() returns EOVERFLOW if the supplied buffer is not
* large enough to contain the xdr encoded referral and sets
* bufsize to the required buffer length.
*/
static int
{
char *buf;
int rc;
return (ENOMEM);
return (ENOMEM);
}
if (rc != 0) {
return (rc);
}
(char *)&rsp);
} else {
}
XDR_DESTROY(&xdr);
return (rc);
}