|
NAMEparse_lt , in_lt ,
in_ltm , in_ltms ,
in_lts —
functions for parsing and checking login time periods
LIBRARYSystem Utilities Library (libutil, -lutil)SYNOPSIS#include <sys/types.h>
#include <time.h>
#include <login_cap.h>
login_time_t
int
int
int
int
DESCRIPTIONThis set of functions may be used for parsing and checking login and session times against a predefined list of allowed login times as used in login.conf(5).The format of allowed and disallowed session times specified in the times.allow and times.deny capability fields in a login class are comprised of a prefix which specifies one or more 2- or 3-character day codes, followed by a start and end time in 24 hour format separated by a hyphen. Day codes may be concatenated together to select specific days, or the special mnemonics "Any" and "All" (for any/all days of the week), "Wk" for any day of the week (excluding Saturdays and Sundays) and "Wd" for any weekend day may be used. For example, the following time period: MoThFrSa1400-2200 Wd0600-1800 Any0400-1600 Note that all time periods reference system local time. The typedef struct login_time { u_short lt_start; /* Start time */ u_short lt_end; /* End time */ u_char lt_dow; /* Days of week */ } login_time_t; The lt_start and
lt_end fields contain the number of minutes past
midnight at which the described period begins and ends. The
lt_dow field is a bit field, containing one bit for
each day of the week and one bit unused. A series LTM_*
macros may be used for testing bits individually and in combination. If no
bits are set in this field - i.e., it contains the value
LTM_NONE - then the entire period is assumed invalid. This
is used as a convention to mark the termination of an array of login_time_t
values. If The remaining functions provide the ability to test a given time_t
or struct tm value against a specific time period or array of time periods.
The The The RETURN VALUESTheparse_lt () function returns a filled in structure of
type login_time_t containing the parsed time period. If a parsing error
occurs, the lt_dow field is set to LTM_NONE (i.e., 0).
The The SEE ALSOgetcap(3), login_cap(3), login_class(3), login.conf(5), termcap(5)HISTORYThe functionsparse_lt (),
in_lt (), in_ltm (),
in_ltms () and in_lts () first
appeared in FreeBSD 2.1.5.
Visit the GSP FreeBSD Man Page Interface. |