blob: f0d500ee37b1da2f1552dea0328025e63e066d65 [file] [log] [blame]
Ben Lindstrom5428bea2001-05-06 02:53:25 +00001/* $OpenBSD: sshlogin.h,v 1.1 2001/03/04 01:46:30 djm Exp $ */
Ben Lindstrom36579d32001-01-29 07:39:26 +00002
Ben Lindstrom226cfa02001-01-22 05:34:40 +00003/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
5 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
6 * All rights reserved
7 *
8 * As far as I am concerned, the code I have written for this software
9 * can be used freely for any purpose. Any derived versions of this
10 * software must be clearly marked as such, and if the derived work is
11 * incompatible with the protocol description in the RFC file, it must be
12 * called by a name other than "ssh" or "Secure Shell".
13 */
Ben Lindstrom5428bea2001-05-06 02:53:25 +000014#ifndef SSHLOGIN_H
15#define SSHLOGIN_H
Ben Lindstrom226cfa02001-01-22 05:34:40 +000016
17/*
18 * Returns the time when the user last logged in. Returns 0 if the
19 * information is not available. This must be called before record_login.
20 * The host from which the user logged in is stored in buf.
21 */
22u_long
23get_last_login_time(uid_t uid, const char *logname,
24 char *buf, u_int bufsize);
25
26/*
27 * Records that the user has logged in. This does many things normally done
28 * by login(1).
29 */
30void
31record_login(pid_t pid, const char *ttyname, const char *user, uid_t uid,
32 const char *host, struct sockaddr *addr);
33
Ben Lindstrom97c677d2001-05-08 20:33:05 +000034#ifdef LOGIN_NEEDS_UTMPX
35/*
36 * Record just the utmp info for /bin/login.
37 */
38void
39record_utmp_only(pid_t pid, const char *ttyname, const char *user,
40 const char *host, struct sockaddr * addr);
41#endif
42
Ben Lindstrom226cfa02001-01-22 05:34:40 +000043/*
44 * Records that the user has logged out. This does many thigs normally done
45 * by login(1) or init.
46 */
47void record_logout(pid_t pid, const char *ttyname);
48
49#endif