#ifndef lint
static char sccsid[] = "@(#) try-from.c 1.2 94/12/28 17:42:55";
#endif
#include <sys/types.h>
#include <stdio.h>
#include <syslog.h>
#include <string.h>
#ifdef TLI
#include <sys/tiuser.h>
#include <stropts.h>
#endif
#ifndef STDIN_FILENO
#define STDIN_FILENO 0
#endif
#include "tcpd.h"
int allow_severity = SEVERITY;
int deny_severity = LOG_WARNING;
int
main(argc, argv)
int argc;
char **argv;
{
struct request_info request;
char buf[BUFSIZ];
char *cp;
if ((cp = strrchr(argv[0], '/')) != 0)
argv[0] = cp + 1;
#ifdef TLI
if (ioctl(0, I_FIND, "timod") == 0)
ioctl(0, I_PUSH, "timod");
#endif
request_init(&request, RQ_DAEMON, argv[0], RQ_FILE, STDIN_FILENO, 0);
(void) fromhost(&request);
#define EXPAND(str) percent_x(buf, sizeof(buf), str, &request)
puts(EXPAND("client address (%%a): %a"));
puts(EXPAND("client hostname (%%n): %n"));
puts(EXPAND("client username (%%u): %u"));
puts(EXPAND("client info (%%c): %c"));
puts(EXPAND("server address (%%A): %A"));
puts(EXPAND("server hostname (%%N): %N"));
puts(EXPAND("server process (%%d): %d"));
puts(EXPAND("server info (%%s): %s"));
return (0);
}