Deleted Added
full compact
loginrec.h (215116) loginrec.h (221420)
1#ifndef _HAVE_LOGINREC_H_
2#define _HAVE_LOGINREC_H_
3
4/*
5 * Copyright (c) 2000 Andre Lucas. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 49 unchanged lines hidden (view full) ---

58#define LINFO_LINESIZE 64
59#define LINFO_NAMESIZE 512
60#define LINFO_HOSTSIZE 256
61
62struct logininfo {
63 char progname[LINFO_PROGSIZE]; /* name of program (for PAM) */
64 int progname_null;
65 short int type; /* type of login (LTYPE_*) */
1#ifndef _HAVE_LOGINREC_H_
2#define _HAVE_LOGINREC_H_
3
4/*
5 * Copyright (c) 2000 Andre Lucas. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 49 unchanged lines hidden (view full) ---

58#define LINFO_LINESIZE 64
59#define LINFO_NAMESIZE 512
60#define LINFO_HOSTSIZE 256
61
62struct logininfo {
63 char progname[LINFO_PROGSIZE]; /* name of program (for PAM) */
64 int progname_null;
65 short int type; /* type of login (LTYPE_*) */
66 int pid; /* PID of login process */
67 int uid; /* UID of this user */
66 pid_t pid; /* PID of login process */
67 uid_t uid; /* UID of this user */
68 char line[LINFO_LINESIZE]; /* tty/pty name */
69 char username[LINFO_NAMESIZE]; /* login username */
70 char hostname[LINFO_HOSTSIZE]; /* remote hostname */
71 /* 'exit_status' structure components */
72 int exit; /* process exit status */
73 int termination; /* process termination status */
74 /* struct timeval (sys/time.h) isn't always available, if it isn't we'll
75 * use time_t's value as tv_sec and set tv_usec to 0

--- 5 unchanged lines hidden (view full) ---

81
82/*
83 * login recording functions
84 */
85
86/** 'public' functions */
87
88/* construct a new login entry */
68 char line[LINFO_LINESIZE]; /* tty/pty name */
69 char username[LINFO_NAMESIZE]; /* login username */
70 char hostname[LINFO_HOSTSIZE]; /* remote hostname */
71 /* 'exit_status' structure components */
72 int exit; /* process exit status */
73 int termination; /* process termination status */
74 /* struct timeval (sys/time.h) isn't always available, if it isn't we'll
75 * use time_t's value as tv_sec and set tv_usec to 0

--- 5 unchanged lines hidden (view full) ---

81
82/*
83 * login recording functions
84 */
85
86/** 'public' functions */
87
88/* construct a new login entry */
89struct logininfo *login_alloc_entry(int pid, const char *username,
89struct logininfo *login_alloc_entry(pid_t pid, const char *username,
90 const char *hostname, const char *line);
91/* free a structure */
92void login_free_entry(struct logininfo *li);
93/* fill out a pre-allocated structure with useful information */
90 const char *hostname, const char *line);
91/* free a structure */
92void login_free_entry(struct logininfo *li);
93/* fill out a pre-allocated structure with useful information */
94int login_init_entry(struct logininfo *li, int pid, const char *username,
94int login_init_entry(struct logininfo *li, pid_t pid, const char *username,
95 const char *hostname, const char *line);
96/* place the current time in a logininfo struct */
97void login_set_current_time(struct logininfo *li);
98
99/* record the entry */
100int login_login (struct logininfo *li);
101int login_logout(struct logininfo *li);
102#ifdef LOGIN_NEEDS_UTMPX

--- 9 unchanged lines hidden (view full) ---

112/* set the network address based on network address type */
113void login_set_addr(struct logininfo *li, const struct sockaddr *sa,
114 const unsigned int sa_size);
115
116/*
117 * lastlog retrieval functions
118 */
119/* lastlog *entry* functions fill out a logininfo */
95 const char *hostname, const char *line);
96/* place the current time in a logininfo struct */
97void login_set_current_time(struct logininfo *li);
98
99/* record the entry */
100int login_login (struct logininfo *li);
101int login_logout(struct logininfo *li);
102#ifdef LOGIN_NEEDS_UTMPX

--- 9 unchanged lines hidden (view full) ---

112/* set the network address based on network address type */
113void login_set_addr(struct logininfo *li, const struct sockaddr *sa,
114 const unsigned int sa_size);
115
116/*
117 * lastlog retrieval functions
118 */
119/* lastlog *entry* functions fill out a logininfo */
120struct logininfo *login_get_lastlog(struct logininfo *li, const int uid);
120struct logininfo *login_get_lastlog(struct logininfo *li, const uid_t uid);
121/* lastlog *time* functions return time_t equivalent (uint) */
121/* lastlog *time* functions return time_t equivalent (uint) */
122unsigned int login_get_lastlog_time(const int uid);
122unsigned int login_get_lastlog_time(const uid_t uid);
123
124/* produce various forms of the line filename */
125char *line_fullname(char *dst, const char *src, u_int dstsize);
126char *line_stripname(char *dst, const char *src, int dstsize);
127char *line_abbrevname(char *dst, const char *src, int dstsize);
128
129void record_failed_login(const char *, const char *, const char *);
130
131#endif /* _HAVE_LOGINREC_H_ */
123
124/* produce various forms of the line filename */
125char *line_fullname(char *dst, const char *src, u_int dstsize);
126char *line_stripname(char *dst, const char *src, int dstsize);
127char *line_abbrevname(char *dst, const char *src, int dstsize);
128
129void record_failed_login(const char *, const char *, const char *);
130
131#endif /* _HAVE_LOGINREC_H_ */