]> granicus.if.org Git - shadow/blob - lib/port.h
* libmisc/find_new_uid.c, libmisc/find_new_gid.c: Add missing
[shadow] / lib / port.h
1 /*
2  * Copyright (c) 1989 - 1991, Julianne Frances Haugh
3  * Copyright (c) 1996 - 1997, Marek Michałkiewicz
4  * Copyright (c) 2005       , Tomasz Kłoczko
5  * 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
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  * 3. The name of the copyright holders or contributors may not be used to
16  *    endorse or promote products derived from this software without
17  *    specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22  * PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
23  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  */
31
32 /*
33  * port.h - structure of /etc/porttime
34  *
35  *      $Id$
36  *
37  *      Each entry in /etc/porttime consists of a TTY device
38  *      name or "*" to indicate all TTY devices, followed by
39  *      a list of 1 or more user IDs or "*" to indicate all
40  *      user names, followed by a list of zero or more valid
41  *      login times.  Login time entries consist of zero or
42  *      more day names (Su, Mo, Tu, We, Th, Fr, Sa, Wk, Al)
43  *      followed by a pair of time values in HHMM format
44  *      separated by a "-".
45  */
46
47 /*
48  * PORTS - Name of system port access time file.
49  * PORT_IDS - Allowable number of IDs per entry.
50  * PORT_TTY - Allowable number of TTYs per entry.
51  * PORT_TIMES - Allowable number of time entries per entry.
52  * PORT_DAY - Day of the week to a bit value (0 = Sunday).
53  */
54
55 #define PORTS   "/etc/porttime"
56 #define PORT_IDS        64
57 #define PORT_TTY        64
58 #define PORT_TIMES      24
59 #define PORT_DAY(day)   (1<<(day))
60
61 /*
62  *      pt_names - pointer to array of device names in /dev/
63  *      pt_users - pointer to array of applicable user IDs.
64  *      pt_times - pointer to list of allowable time periods.
65  */
66
67 struct port {
68         char **pt_names;
69         char **pt_users;
70         struct pt_time *pt_times;
71 };
72
73 /*
74  *      t_days - bit array for each day of the week (0 = Sunday)
75  *      t_start - starting time for this entry
76  *      t_end - ending time for this entry
77  */
78
79 struct pt_time {
80         short t_days;
81         short t_start;
82         short t_end;
83 };