/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Rentrant (MT-safe) getrpcYY interfaces.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "mt.h"
#include <ctype.h>
#include <nss_dbdefs.h>
#include <stdlib.h>
#include <string.h>
extern int str2rpcent(const char *, int, void *, char *, int);
/* efficiency, not correctness */
static DEFINE_NSS_DB_ROOT(db_root);
static DEFINE_NSS_GETENT(context);
void
{
p->name = NSS_DBNAM_RPC;
}
struct rpcent *
int buflen)
{
return (NULL);
}
}
struct rpcent *
int buflen)
{
}
void
{
rpc_stayopen |= stay;
}
void
endrpcent(void)
{
rpc_stayopen = 0;
}
struct rpcent *
{
/* No key, no stayopen */
}
int
{
char *numend;
return (NSS_STR_PARSE_PARSE);
p = instr;
p++;
}
namestart = p;
p++; /* Skip over the canonical name */
}
return (NSS_STR_PARSE_ERANGE);
p++;
}
if (p >= limit) /* Syntax error -- no RPC number */
return (NSS_STR_PARSE_PARSE);
numstart = p;
do {
p++; /* Find the end of the RPC number */
/* Syntax error -- supposed number is too long */
return (NSS_STR_PARSE_PARSE);
}
if (*numend != '\0')
return (NSS_STR_PARSE_PARSE);
p++;
}
/*
* Although nss_files_XY_all calls us with # stripped,
* we should be able to deal with it here in order to
* be more useful.
*/
char **ptr;
sizeof (char *));
return (NSS_STR_PARSE_ERANGE);
}
*ptr = 0;
return (NSS_STR_PARSE_SUCCESS);
}
return (NSS_STR_PARSE_SUCCESS);
}