/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 (c) 1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <errno.h>
#include <syslog.h>
#include <libintl.h>
#include <unistd.h>
#include <strings.h>
#include <string.h>
#include <assert.h>
#include <stdlib.h>
#include "nfslogd.h"
#include "../lib/nfslogtab.h"
#include "buffer_list.h"
static void free_buffer_ent(struct buffer_ent *);
static void free_sharepnt_list(struct sharepnt_ent *);
static void free_sharepnt_ent(struct sharepnt_ent *);
#ifdef DEBUG
static void print_sharepnt_list(struct sharepnt_ent *);
#endif
struct sharepnt_ent **);
/*
* Builds the buffer list from NFSLOGTAB and returns it in *listpp.
* Returns 0 on success, non-zero error code otherwise.
*/
int
{
}
/*
* If NFSLOGTAB has not been modified since the last time we read it,
* it simply returns the same buffer list, otherwise it re-reads NFSLOGTAB
* and rebuilds the list.
* No NFSLOGTAB is not treated as an error.
* Returns 0 on success, non-zero error code otherwise
*/
int
{
int error = 0;
error = 0;
}
return (error);
}
return (0);
}
/*
* Does the actual work of reading NFSLOGTAB, and building the
* buffer list. If *be_head already contains entries, it will
* update the list with new information.
* Returns 0 on success, non-zero error code otherwise.
*/
static int
{
error = 0;
}
return (error);
}
return (error);
}
/*
* Add sharepnt to buffer list
*/
/*
* Sharepoint already in list,
* update its state.
*/
} else {
/*
* Need to add to sharepoint list
*/
sep = (struct sharepnt_ent *)
goto errout;
}
goto errout;
}
}
} else {
/*
* Add new buffer to list
*/
goto errout;
}
goto errout;
}
else
sizeof (*(bep->be_sharepnt)));
goto errout;
}
goto errout;
}
}
}
if (res < 0) {
goto errout;
}
/*
* Get modification time while we have the file locked.
*/
if (lu) {
goto errout;
}
}
return (error);
if (lep)
return (error);
}
/*
* Removes the entry from the buffer list and frees it.
*/
void
{
if (p == bep) {
if (p == *be_listpp)
else
break;
}
prev = p;
}
}
/*
* Frees the buffer list.
*/
void
{
}
}
static void
{
if (debug)
}
static void
{
}
}
/*
* Removes the entry from the sharepnt list and frees it.
*/
void
{
if (p == sep) {
if (p == *se_listpp)
else
break;
}
prev = p;
}
}
static void
{
if (debug)
}
#ifdef DEBUG
void
{
}
}
static void
{
}
#endif
/*
* Returns a pointer to the buffer matching 'name', NULL otherwise.
*/
static struct buffer_ent *
{
return (bep);
}
return (NULL);
}
/*
* Returns a pointer the sharepoint entry matching 'name'.
* Otherwise, it sets '*se_tail' to the last element of the list
* to make insertion of new element easier, and returns NULL.
*/
static struct sharepnt_ent *
struct sharepnt_ent *sep,
char *name,
struct sharepnt_ent **se_tail)
{
return (sep);
}
return (NULL);
}