/* vi: set sw=4 ts=4: */
/*
 * public domain -- Dave 'Kill a Cop' Cinege <dcinege@psychosis.com>
 * 
 * dutmp
 * Takes utmp formated file on stdin and dumps it's contents 
 * out in colon delimited fields. Easy to 'cut' for shell based 
 * versions of 'who', 'last', etc. IP Addr is output in hex, 
 * little endian on x86.
 * 
 * made against libc6
 */

#include "internal.h"
#include <stdio.h>
#include <errno.h>
#define BB_DECLARE_EXTERN
#define bb_need_io_error
#include "messages.c"

#if defined(__GLIBC__)
#include <utmp.h>
#else
#include <utmp-wrap.h>
#define utmp new_utmp
#endif

static const char dutmp_usage[] = "dutmp [FILE]\n\n"
	"Dump utmp file format (pipe delimited) from FILE\n"
	"or stdin to stdout.  (i.e. 'dutmp /var/run/utmp')\n";

extern int dutmp_main(int argc, char **argv)
{

	FILE *f;
	struct utmp ut;

	if (argc<2) {
		f = stdin;
	} else if (*argv[1] == '-' ) {
		usage(dutmp_usage);
	} else  {
		f = fopen(argv[1], "r");
		if (f == NULL) {
			fatalError(io_error, argv[1], strerror(errno));
		}
	}

	while (fread(&ut, sizeof(struct utmp), 1, f)) {
		printf("%d|%d|%s|%s|%s|%s|%d|%d|%ld|%ld|%ld|%x\n",
			   ut.ut_type, ut.ut_pid, ut.ut_line,
			   ut.ut_id, ut.ut_user, ut.ut_host,
			   ut.ut_exit.e_termination, ut.ut_exit.e_exit,
			   ut.ut_session, ut.ut_tv.tv_sec, ut.ut_tv.tv_usec, 
			   ut.ut_addr_v6[0]);
	}

	exit(TRUE);
}
