#ifndef ULONG # define ULONG unsigned long int #endif #ifndef USHORT # define USHORT unsigned short #endif typedef signed long int secs; #define NAME_LEN 9 #define TTY_LEN 65 #define HOST_LEN 129 #define TT_LEN 17 #define FLAGS_LEN 40 #define SCLASS_MAX 64 #define PATH_HUTMP "/etc/hutmp" struct hutmp { char ht_type; /* type of slot */ #define HT_EMPTY 0 #define HT_LOGIN 1 #define HT_USER 2 pid_t ht_pid; char ht_tty[TTY_LEN]; char ht_term[TT_LEN]; time_t ht_time; /* login time */ char ht_user[NAME_LEN]; /* username (null terminated) */ uid_t ht_uid; gid_t ht_gid; char ht_status; #define HT_BORROW 1 #define HT_BORROW_DIE 2 #define HT_UNTIMED 4 #define HT_CHALACED 8 char ht_host[HOST_LEN]; /* nice long host name */ char ht_uthost[HOST_LEN]; /* utmp's version of above */ ULONG ht_addr; /* IP addr */ char ht_flags[FLAGS_LEN]; /* hidleho flags active */ char ht_ruser[NAME_LEN]; /* remote username - not implimented yet */ secs ht_timeleft_l; /* timeleft altogether */ secs ht_timeleft_c; /* timeleft start of this call */ secs ht_timeleft_p; /* timeleft per call normally */ float ht_weight; /* tty weight */ ULONG ht_speed; /* tty speed */ USHORT ht_sclass[SCLASS_MAX]; /* calling class - not implimented yet */ };