/*
* 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.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <ctype.h>
#include <netdb.h>
#include <stdlib.h>
#include <string.h>
#include <nss_dbdefs.h>
int str2netent(const char *, int, void *, char *, int);
static int net_stayopen;
/*
* Unsynchronized, but it affects only
* efficiency, not correctness
*/
static DEFINE_NSS_DB_ROOT(db_root);
static DEFINE_NSS_GETENT(context);
void
{
p->name = NSS_DBNAM_NETWORKS;
}
struct netent *
{
return (NULL);
}
(void) NSS_XbyY_FINI(&arg);
}
struct netent *
{
(void) NSS_XbyY_FINI(&arg);
}
int
{
return (0);
}
int
{
net_stayopen = 0;
return (0);
}
struct netent *
{
/* No stayopen flag; of course you stay open for iteration */
(void) NSS_XbyY_FINI(&arg);
}
/*
* Return values: 0 = success, 1 = parse error, 2 = erange ...
* The structure pointer passed in is a structure in the caller's space
* wherein the field pointers would be set to areas in the buffer if
* need be. instring and buffer should be separate areas.
*/
int
{
int namelen = 0;
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 net number */
return (NSS_STR_PARSE_PARSE);
}
numstart = p;
do {
p++; /* Find the end of the net number */
/* Syntax error -- supposed number is too long */
return (NSS_STR_PARSE_PARSE);
}
/* inet_network failed to parse the string */
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);
} else {
*ptr = 0;
return (NSS_STR_PARSE_SUCCESS);
}
}
return (NSS_STR_PARSE_SUCCESS);
}