File: utmp.h

package info (click to toggle)
sac 1.9b5-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 300 kB
  • ctags: 450
  • sloc: ansic: 3,696; sh: 203; makefile: 120
file content (112 lines) | stat: -rw-r--r-- 2,829 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112


#ifdef SOLARIS
#  include <utmpx.h>
#else
#  include <utmp.h>
#  include <paths.h>
#endif

#ifdef BSD
#  define ut_user ut_name
#endif

/* Weee... */
#ifdef WTMPX_FILE
#  define _PATH_WTMP WTMPX_FILE
#else
#  ifndef WTMP_FILE
     /* FSSTND (now FHS) compliance courtesy of Edward S. Marshall */
#    ifndef _PATH_WTMP
#      define _PATH_WTMP "/var/log/wtmp" /* FSSTND compliant */
#    endif
#  else
#    ifndef _PATH_WTMP
#      define _PATH_WTMP WTMP_FILE
#    endif
#  endif
#endif

#ifndef RADIUS_DIR
#  define RADIUS_DIR	"/usr/adm/radacct"
#endif

/* This is _NOT_ a good way to do this. */
#ifdef SOLARIS
#  define UT_NAMESIZE	32
#  define UT_LINESIZE	32
#  define UT_HOSTSIZE	257
#  define utmp utmpx
#  define ut_time ut_tv.tv_sec
#endif

struct tacacs3_utmp {
  char ut_line[8];
  char ut_user[8];
  char ut_host[16];
  time_t ut_tactime;
};

struct tacacs4_utmp {
  char ut_line[8];
  char ut_user[8];
  char ut_host[16];
  time_t ut_tactime;
  char ut_comment[16];
};

#define LIBC6_LINESIZE	32
#define LIBC6_NAMESIZE	32
#define LIBC6_HOSTSIZE	256

struct libc6_utmp {
  short int ut_type;            /* Type of login.  */
  pid_t ut_pid;                 /* Process ID of login process.  */
  char ut_line[LIBC6_LINESIZE]; /* Devicename.  */
  char ut_id[4];                /* Inittab ID.  */
  char ut_user[LIBC6_NAMESIZE]; /* Username.  */
  char ut_host[LIBC6_HOSTSIZE]; /* Hostname for remote login.  */
  struct libc6_exit_status {
    short int e_termination;    /* Process termination status.  */
    short int e_exit;           /* Process exit status.  */
  } ut_exit;			/* Exit status of a process marked as DEAD_PROCESS. */
  long int ut_session;          /* Session ID, used for windowing.  */
  struct timeval ut_tv;         /* Time entry was made.  */
  int32_t ut_addr_v6[4];        /* Internet address of remote host.  */
  char __unused[20];            /* Reserved for future use.  */
};

#define LIBC5_LINESIZE	12
#define LIBC5_NAMESIZE	8
#define LIBC5_HOSTSIZE	16

struct libc5_utmp {
  short ut_type;		/* type of login */
  pid_t ut_pid;			/* pid of login-process */
  char ut_line[LIBC5_LINESIZE];	/* devicename of tty -"/dev/", null-term */
  char ut_id[4];		/* abbrev. ttyname, as 01, s1 etc. */
  time_t ut_5time;		/* logintime */
  char ut_user[LIBC5_NAMESIZE];	/* username, not null-term */
  char ut_host[LIBC5_HOSTSIZE];	/* hostname for remote login... */
  long ut_5addr;		/* IP addr of remote host */
};

#define BSD_LINESIZE  8
#define BSD_NAMESIZE  16
#define BSD_HOSTSIZE  16

struct bsd_utmp {
  char ut_line[BSD_LINESIZE];
  char ut_name[BSD_NAMESIZE];
  char ut_host[BSD_HOSTSIZE];
  time_t ut_bsdtime;
};

struct sactmp {
  struct utmp u;
  /* detail files have lots of extra fun stuff */
  double inoct, outoct;
  double inpkt, outpkt;
  u_long datarate;
  char callid[32];
};