/*
* 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 (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#include "uucp.h"
#include <unistd.h>
#include "sysfiles.h"
/*
* manage systems files (Systems, Devices, and Dialcodes families).
*
* also manage new file Devconfig, allows per-device setup.
*
* TODO:
* call bsfix()?
* combine the 3 versions of everything (sys, dev, and dial) into one.
* allow arbitrary classes of service.
* need verifysys() for uucheck.
* nameserver interface?
* pass sysname (or 0) to getsysline(). (might want reg. exp. or NS processing
*/
/* private variables */
/* pointer arrays might be dynamically allocated */
/*to be popped */
/*to be pushed */
/* this might be dynamically allocated */
/* export these */
/* import these */
/*
* setservice init's Systems, Devices, Dialers lists from Sysfiles
*/
GLOBAL void
char *service;
{
setconfig();
return;
}
/*
* setdevcfg init's Pops, Pushes lists from Devconfig
*/
GLOBAL void
{
return;
}
/* administrative files access */
GLOBAL int
int type;
{
switch (type) {
case ACCESS_SYSTEMS:
case ACCESS_DEVICES:
case ACCESS_DIALERS:
case EACCESS_SYSTEMS:
case EACCESS_DEVICES:
case EACCESS_DIALERS:
default:
return(FAIL);
}
}
/*
* allow multiple entries for a given service, allow a service
* type to describe resources more than once, e.g., systems=foo:baz systems=bar.
*/
static void
char *service;
{ FILE *f;
/* got a (logical) line from Sysfiles */
/* strtok's of this buf continue in tokenize() */
tokenize();
nameparse();
}
}
(void) fclose(f);
}
/* if didn't find entries in Sysfiles, use defaults */
}
}
}
return;
}
/*
* read Devconfig. allow multiple entries for a given service, allow a service
* type to describe resources more than once, e.g., push=foo:baz push=bar.
*/
static void
{ FILE *f;
/* (re)initialize device-specific information */
/* got a (logical) line from Devconfig */
/* strtok's of this buf continue in tokenize() */
tokenize();
nameparse();
}
}
}
(void) fclose(f);
}
return;
}
/*
* given a file pointer and buffer, construct logical line in buffer
* (i.e., concatenate lines ending in '\'). return length of line
* ASSUMES that buffer is BUFSIZ long!
*/
static int
FILE *f;
char *line;
/* empty buf or line too long! */
break;
continue;
break;
/* continuation */
}
}
/*
* given a label (e.g., "service=", "device="), a name ("cu", "uucico"),
* and a line: if line begins with the label and if the name appears
* in a colon-separated list of names following the label, return true;
* else return false
*/
static int
{ char *lend;
return(FALSE); /* probably a comment line */
}
if (*line == '\0')
return(FALSE);
/*
* can't use strtok() in the following because scansys(),
* scancfg() do an initializing call to strtok() before
* coming here and then CONTINUE calling strtok() in tokenize(),
* after returning from namematch().
*/
*lend = '\0';
return(TRUE);
}
}
/*
* tokenize() continues pulling tokens out of a buffer -- the
* initializing call to strtok must have been made before calling
* tokenize() -- and starts stuffing 'em into tokptr.
*/
static void
tokenize()
{ char *tok;
break;
}
return;
}
/*
* look at top token in array: should be line of the form
* name=item1:item2:item3...
* if name is one we recognize, then call set[file|ioctl] to set up
* corresponding list. otherwise, log bad name.
*/
static void
int temp;
continue; /* may be meaningful someday? */
*equals = '\0';
/* ignore entry with empty rhs */
if (*++equals == '\0')
continue;
else {
}
}
return;
}
/*
* given the list for a particular type (systems, devices,...)
* and a line of colon-separated files, add 'em to list
*/
static void
if (*line == 0)
return;
while (*tptr) /* skip over existing entries to*/
tptr++; /* concatenate multiple entries */
expandpath[0] = '\0';
if ( *tok != '/' )
/* by default, file names are relative to SYSDIR */
/* if we can't read it, no point in adding to list */
continue;
tptr++;
}
return;
}
/*
* given the list for a particular ioctl (push, pop)
* and a line of colon-separated modules, add 'em to list
*/
static void
if (*line == 0)
return;
while (*tptr) /* skip over existing entries to*/
tptr++; /* concatenate multiple entries */
tptr++;
}
return;
}
/*
* reset Systems files
*/
GLOBAL void
sysreset()
{
if (fsystems)
nsystems = 0;
devreset();
return;
}
/*
* reset Devices files
*/
GLOBAL void
devreset()
{
if (fdevices)
ndevices = 0;
dialreset();
return;
}
/*
* reset Dialers files
*/
GLOBAL void
{
if (fdialers)
ndialers = 0;
return;
}
/*
* get next line from Systems file
* return TRUE if successful, FALSE if not
*/
GLOBAL int
char *buf;
{
/* not initialized via setservice() - use default */
setservice("uucico");
/* initialize devices and dialers whenever a new line is read */
/* from systems */
devreset();
if (nextsystems() == FALSE) {
return(FALSE);
}
for(;;) {
return(TRUE);
}
if (nextsystems() == FALSE) {
return(FALSE);
}
}
}
/*
* move to next systems file. return TRUE if successful, FALSE if not
*/
static int
{
devreset();
nsystems++;
} else {
nsystems = 0;
}
return(TRUE);
return(FALSE);
}
/*
* get next line from Devices file
* return TRUE if successful, FALSE if not
*/
GLOBAL int
char *buf;
{
/* not initialized via setservice() - use default */
setservice("uucico");
if (nextdevices() == FALSE) {
return(FALSE);
}
for(;;) {
return(TRUE);
}
if (nextdevices() == FALSE) {
return(FALSE);
}
}
}
/*
* move to next devices file. return TRUE if successful, FALSE if not
*/
static int
{
ndevices++;
} else {
ndevices = 0;
}
return(TRUE);
return(FALSE);
}
/*
* get next line from Dialers file
* return TRUE if successful, FALSE if not
*/
GLOBAL int
char *buf;
{
/* not initialized via setservice() - use default */
setservice("uucico");
if (nextdialers() == FALSE) {
return(FALSE);
}
for(;;) {
return(TRUE);
}
if (nextdialers() == FALSE) {
return(FALSE);
}
}
}
/*
* move to next dialers file. return TRUE if successful, FALSE if not
*/
static int
{
if (fdialers) {
ndialers++;
} else {
ndialers = 0;
}
return(TRUE);
return(FALSE);
}
/*
* get next module to be popped
* return TRUE if successful, FALSE if not
*/
static int
char *buf;
{
int slen;
return(FALSE);
/* if the module name is enclosed in parentheses, */
/* is optional. set flag & strip parens */
*optional = 1;
} else {
*optional = 0;
}
return(TRUE);
}
/*
* get next module to be pushed
* return TRUE if successful, FALSE if not
*/
static int
char *buf;
int len;
{
return(FALSE);
return(TRUE);
}
/*
* return TRUE if successful, FALSE if not
*/
GLOBAL int
int fd;
{
int optional;
/* check for streams modules to pop */
: "pop_push: POPing %s\n" ), strmod);
return(FALSE);
}
if ( optional )
continue;
return(FALSE);
}
return(FALSE);
}
}
/* check for streams modules to push */
return(FALSE);
}
}
return(TRUE);
}
/*
* return name of currently open Systems file
*/
GLOBAL char *
currsys()
{
}
/*
* return name of currently open Devices file
*/
GLOBAL char *
currdev()
{
}
/*
* return name of currently open Dialers file
*/
GLOBAL char *
currdial()
{
}
/*
* set configuration parameters provided in Config file
*/
static void
{
FILE *f;
char *tok;
extern char _ProtoCfg[];
/* got a (logical) line from Config file */
/* got a token */
/* this probably should be table driven when
* the list of configurable parameters grows.
*/
if ( *tok != '\0' ) {
if ( _ProtoCfg[0] != '\0' ) {
}
}
} else {
}
}
}
}
}