/*
* 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 2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T
* All Rights Reserved.
*/
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
* The Regents of the University of California.
* All Rights Reserved.
*
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Routines to handle insertion, deletion, etc on the table
* of requests kept by the daemon. Nothing fancy here, linear
* search on a double-linked list. A time is kept with each
* entry so that overly old invitations can be eliminated.
*
* Consider this a mis-guided attempt at modularity
*/
#include <string.h>
#include <stdio.h>
#include <malloc.h>
#include "talkd_impl.h"
struct table_entry {
long time;
};
/*
* Look in the table for an invitation that matches the current
* request looking for an invitation.
*/
CTL_MSG *
{
long current_time;
if (debug) {
(void) printf("Entering Look-Up with : \n");
}
/* the entry is too old */
if (debug) {
(void) printf("Deleting expired entry : \n");
}
continue;
}
if (debug)
}
}
return (NULL);
}
/*
* Look for an identical request, as opposed to a complimentary
* one as find_match does.
*/
CTL_MSG *
{
long current_time;
/*
* See if this is a repeated message, and check for
* out of date entries in the table while we are it.
*/
if (debug) {
(void) printf("Entering find_request with : \n");
}
/* the entry is too old */
if (debug) {
(void) printf("Deleting expired entry : \n");
}
continue;
}
if (debug)
/* update the time if we 'touch' it */
}
}
return (NULL);
}
void
{
long current_time;
/*
* Insert a new entry into the top of the list.
*/
print_error("malloc in insert_table");
}
}
}
/*
* Generate a unique non-zero sequence number.
*/
int
new_id(void)
{
static int current_id = 0;
/* 0 is reserved, helps to pick up bugs */
if (current_id == 0)
current_id = 1;
return (current_id);
}
/*
* Delete the invitation with id 'id_num'.
*/
int
{
if (debug)
if (debug)
}
return (SUCCESS);
}
return (NOT_HERE);
}
/*
* Classic delete from a double-linked list.
*/
static void
{
if (debug) {
(void) printf("Deleting : ");
}
}
}
}