/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1990-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Research
*
* return the local attr attributes for host name
*/
#include "cslib.h"
#include <ctype.h>
#include <hash.h>
typedef struct
{
} Info_t;
/*
* load the info from the local info file
*/
static Hash_table_t*
{
register char* s;
char* h;
int c;
{
while (isspace(*s)) s++;
h = s;
while (!isspace(*s) && *s) s++;
if (*s)
{
c = *s;
*s++ = 0;
{
tp = 0;
break;
}
*--s = c;
}
}
return tp;
}
/*
* info cached on first call and return value placed in static buffer ...
* if name==0 || name=="-" then all valid records returned by successive
* csattr() calls until 0 return
* if attr==0 || attr=="-" then all attributes returned
*/
char*
{
register char* s;
register char* b;
register char* x;
register char* v;
int n;
unsigned long addr;
return 0;
attr = 0;
b = buf;
{
name = 0;
scan:
return 0;
{
pt = 0;
return 0;
if (n)
return buf;
}
else
{
return 0;
if (attr)
{
return buf;
{
return CS_HOST_UNKNOWN;
}
}
}
if (!attr)
{
b += sfsprintf(b, x - b, "%s", v);
{
}
}
b += sfsprintf(b, x - b, " %s", (addr = csaddr(state, ip->name)) ? (*attr == 'a' ? csntoa(state, addr) : state->host) : CS_HOST_UNKNOWN);
{
while (isspace(*v)) v++;
if (!*v)
{
if (!name)
{
b = buf;
goto scan;
}
return 0;
}
for (s = (char*)attr; *s && *v == *s++; v++);
if (!*s && (*v == '=' || !*v || isspace(*v)))
{
if (*v == '=') v++;
else v = "1";
if (b > buf && b < x) *b++ = ' ';
while (b < x && !isspace(*v) && (*b++ = *v++));
break;
}
while (*v && !isspace(*v)) v++;
}
*b = 0;
return buf;
}
char*
{
}