Update.
[glibc.git] / login / programs / utmpd.h
blobef92a1490b9162374c63f5441fd83132af616a67
1 /* Copyright (C) 1997 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 1997.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
20 #ifndef _UTMPD_H
21 #define _UTMPD_H 1
23 /* This is an *internal* header. */
25 #include <stddef.h>
26 #include <utmp.h>
29 /* Paths to daemon sockets. */
30 #define _PATH_UTMPD_RO "/var/run/utmpd.ro"
31 #define _PATH_UTMPD_RW "/var/run/utmpd.rw"
34 /* Path to PID file. */
35 #define _PATH_UTMPDPID "/var/run/utmpd.pid"
38 /* Version number of the daemon interface. */
39 #define UTMPD_VERSION 1
42 /* Services provided. */
43 typedef enum
45 UTMPD_REQ_SETUTENT,
46 UTMPD_REQ_GETUTENT,
47 UTMPD_REQ_ENDUTENT,
48 UTMPD_REQ_GETUTLINE,
49 UTMPD_REQ_GETUTID,
50 UTMPD_REQ_PUTUTLINE,
51 UTMPD_REQ_UPDWTMP
52 } request_type;
55 /* Header common to all requests. */
56 typedef struct
58 /* Version number of the daemon interface. */
59 int version;
60 /* Number of bytes in this request. */
61 size_t size;
62 /* Service requested. */
63 request_type type;
64 } request_header;
66 typedef struct
68 request_header header;
69 /* File to use. */
70 char file[0];
71 } setutent_request;
73 typedef struct
75 request_header header;
76 } getutent_request, endutent_request;
78 typedef struct
80 request_header header;
81 /* Entry to match. */
82 struct utmp line;
83 } getutline_request;
85 typedef struct
87 request_header header;
88 /* Entry to match. */
89 struct utmp id;
90 } getutid_request;
92 typedef struct
94 request_header header;
95 /* Entry to write. */
96 struct utmp utmp;
97 } pututline_request;
99 typedef struct
101 request_header header;
102 /* Entry to write. */
103 struct utmp utmp;
104 /* File to use. */
105 char file[0];
106 } updwtmp_request;
109 /* Header common to all replies. */
110 typedef struct
112 /* Version number of the daemon interface. */
113 int version;
114 /* Number of bytes in this reply. */
115 size_t size;
116 /* Answer to the request. */
117 request_type type;
118 } reply_header;
120 typedef struct
122 reply_header header;
123 /* Error code. */
124 int errnum;
125 /* Return value. */
126 int result;
127 } setutent_reply, endutent_reply, pututline_reply, updwtmp_reply;
129 typedef struct
131 reply_header header;
132 /* Found entry. */
133 struct utmp entry;
134 /* Error code. */
135 int errnum;
136 /* Return value. */
137 int result;
138 } getutent_reply, getutline_reply, getutid_reply;
140 #endif /* utmpd.h */