* Copyright (c) 1983 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
"@(#) Copyright (c) 1983 Regents of the University of California.\n\
static char sccsid
[] = "@(#)implogd.c 5.2 (Berkeley) %G%";
#include <netimp/if_imp.h>
#define LOGFILE "/usr/adm/implog"
* Socket address, internet style, with
* unused space taken by timestamp and packet
if (argc
> 0 && !strcmp(argv
[0], "-d"))
log
= open(LOGFILE
, O_CREAT
|O_WRONLY
|O_APPEND
, 0644);
from
.sin_len
= sizeof (time_t);
write(log
, (char *)&from
, sizeof (from
));
if ((s
= socket(AF_IMPLINK
, SOCK_RAW
, 0)) < 0) {
perror("implogd: socket");
{ int tt
= open("/dev/tty", 2);
int fromlen
= sizeof (from
), len
;
len
= recvfrom(s
, request
, sizeof (request
), 0,
perror("implogd: recvfrom");
if (len
== 0 || len
> IMPMTU
) /* sanity */
write(log
, (char *)&from
, sizeof (from
));
write(log
, request
, len
);