/*
* 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
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <ctype.h>
#include <errno.h>
#include <stdarg.h>
#include <fmd_alloc.h>
#include <fmd_subr.h>
#include <fmd_error.h>
#include <fmd_string.h>
#include <fmd_scheme.h>
#include <fmd_fmri.h>
#include <fmd_topo.h>
#include <fmd.h>
/*
* Interfaces to be used by the plugins
*/
void *
{
}
void *
{
}
void
{
}
int
{
return (-1);
}
void
{
}
/*
* Convert an input string to a URI escaped string and return the new string.
* RFC2396 Section 2.4 says that data must be escaped if it does not have a
* representation using an unreserved character, where an unreserved character
* is one that is either alphanumeric or one of the marks defined in S2.3.
*/
static size_t
{
const char *p;
char c, *q;
size_t n = 0;
if (s == NULL)
s = empty_str;
for (p = s; (c = *p) != '\0'; p++) {
n++; /* represent c as itself */
else
n += 3; /* represent c as escape */
}
return (n);
*q++ = c;
} else {
*q++ = '%';
}
}
q--; /* len is too small: truncate output string */
*q = '\0';
return (n);
}
/*
* Convert a name-value pair list representing an FMRI authority into the
* corresponding RFC2396 string representation and return the new string.
*/
char *
{
char *s, *p, *v;
size_t n = 0;
continue; /* do not format non-string elements */
(void) nvpair_value_string(nvp, &v);
}
continue; /* do not format non-string elements */
if (p != s)
*p++ = ',';
*p++ = '=';
(void) nvpair_value_string(nvp, &v);
p += fmd_fmri_uriescape(v, ":", p, n);
}
return (s);
}
/*
* Convert an input string to a URI escaped string and return the new string.
* We amend the unreserved character list to include commas and colons,
* as both are needed to make FMRIs readable without escaping. We also permit
* "/" to pass through unescaped as any path delimiters used by the event
* creator are presumably intended to appear in the final path.
*/
char *
fmd_fmri_strescape(const char *s)
{
char *s2;
size_t n;
if (s == NULL)
return (NULL);
return (s2);
}
char *
fmd_fmri_strdup(const char *s)
{
return (fmd_strdup(s, FMD_SLEEP));
}
void
fmd_fmri_strfree(char *s)
{
fmd_strfree(s);
}
const char *
fmd_fmri_get_rootdir(void)
{
}
const char *
fmd_fmri_get_platform(void)
{
return (fmd.d_platform);
}
fmd_fmri_get_drgen(void)
{
return (gen);
}
struct topo_hdl *
{
if (version != TOPO_VERSION)
return (NULL);
ftp = fmd_topo_hold();
}
void
{
}
/*
* Interfaces for users of the plugins
*/
static fmd_scheme_t *
{
char *name;
(void) fmd_set_errno(EFMD_FMRI_INVAL);
return (NULL);
}
}
{
char c;
buf = &c;
buflen = sizeof (c);
}
return (-1); /* errno is set for us */
return (rv);
}
int
{
int rv;
return (-1); /* errno is set for us */
return (rv);
}
int
{
int rv;
return (-1); /* errno is set for us */
return (rv);
}
int
{
int rv;
return (-1); /* errno is set for us */
return (rv);
}
int
{
int rv;
return (-1); /* errno is set for us */
return (rv);
}
int
{
int rv;
return (-1); /* errno is set for us */
return (rv);
}
/*
* Someday we'll retire the scheme plugins. For the
* are called directly.
*/
int
{
return (-1);
return (rv);
}
int
{
return (-1);
return (rv);
}
int
{
int rv;
return (fmd_set_errno(EFMD_FMRI_INVAL));
return (-1); /* errno is set for us */
return (rv);
}
nvlist_t *
{
return (NULL); /* errno is set for us */
return (nvl);
}