home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume38 / shadow / part13 / port.h < prev    next >
C/C++ Source or Header  |  1993-08-14  |  2KB  |  64 lines

  1. /*
  2.  * Copyright 1989, 1990, 1991, John F. Haugh II
  3.  * All rights reserved.
  4.  *
  5.  * Permission is granted to copy and create derivative works for any
  6.  * non-commercial purpose, provided this copyright notice is preserved
  7.  * in all copies of source code, or included in human readable form
  8.  * and conspicuously displayed on all copies of object code or
  9.  * distribution media.
  10.  */
  11.  
  12. /*
  13.  * port.h - structure of /etc/porttime
  14.  *
  15.  *    @(#)port.h    3.1    08:59:36    08 Feb 1991
  16.  *
  17.  *    Each entry in /etc/porttime consists of a TTY device
  18.  *    name or "*" to indicate all TTY devices, followed by
  19.  *    a list of 1 or more user IDs or "*" to indicate all
  20.  *    user names, followed by a list of zero or more valid
  21.  *    login times.  Login time entries consist of zero or
  22.  *    more day names (Su, Mo, Tu, We, Th, Fr, Sa, Wk, Al)
  23.  *    followed by a pair of time values in HHMM format
  24.  *    separated by a "-".
  25.  */
  26.  
  27. /*
  28.  * PORTS - Name of system port access time file.
  29.  * PORT_IDS - Allowable number of IDs per entry.
  30.  * PORT_TTY - Allowable number of TTYs per entry.
  31.  * PORT_TIMES - Allowable number of time entries per entry.
  32.  * PORT_DAY - Day of the week to a bit value (0 = Sunday).
  33.  */
  34.  
  35. #define    PORTS    "/etc/porttime"
  36. #define    PORT_IDS    64
  37. #define    PORT_TTY    64
  38. #define    PORT_TIMES    24
  39. #define    PORT_DAY(day)    (1<<(day))
  40.  
  41. /*
  42.  *    pt_names - pointer to array of device names in /dev/
  43.  *    pt_users - pointer to array of applicable user IDs.
  44.  *    pt_times - pointer to list of allowable time periods.
  45.  */
  46.  
  47. struct    port    {
  48.     char    **pt_names;
  49.     char    **pt_users;
  50.     struct    pt_time    *pt_times;
  51. };
  52.  
  53. /*
  54.  *    t_days - bit array for each day of the week (0 = Sunday)
  55.  *    t_start - starting time for this entry
  56.  *    t_end - ending time for this entry
  57.  */
  58.  
  59. struct    pt_time    {
  60.     short    t_days;
  61.     short    t_start;
  62.     short    t_end;
  63. };
  64.