1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * CDDL HEADER START 3*0Sstevel@tonic-gate * 4*0Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*0Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*0Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*0Sstevel@tonic-gate * with the License. 8*0Sstevel@tonic-gate * 9*0Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*0Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*0Sstevel@tonic-gate * See the License for the specific language governing permissions 12*0Sstevel@tonic-gate * and limitations under the License. 13*0Sstevel@tonic-gate * 14*0Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*0Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*0Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*0Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*0Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*0Sstevel@tonic-gate * 20*0Sstevel@tonic-gate * CDDL HEADER END 21*0Sstevel@tonic-gate */ 22*0Sstevel@tonic-gate /* 23*0Sstevel@tonic-gate * Copyright 1991 Sun Microsystems, Inc. 24*0Sstevel@tonic-gate * #ident "%Z%%M% %I% %E% SMI" 25*0Sstevel@tonic-gate */ 26*0Sstevel@tonic-gate 27*0Sstevel@tonic-gate %/* 28*0Sstevel@tonic-gate % * Find out about remote users 29*0Sstevel@tonic-gate % */ 30*0Sstevel@tonic-gate 31*0Sstevel@tonic-gate const RUSERS_MAXUSERLEN = 32; 32*0Sstevel@tonic-gate const RUSERS_MAXLINELEN = 32; 33*0Sstevel@tonic-gate const RUSERS_MAXHOSTLEN = 257; 34*0Sstevel@tonic-gate 35*0Sstevel@tonic-gate struct rusers_utmp { 36*0Sstevel@tonic-gate string ut_user<RUSERS_MAXUSERLEN>; /* aka ut_name */ 37*0Sstevel@tonic-gate string ut_line<RUSERS_MAXLINELEN>; /* device */ 38*0Sstevel@tonic-gate string ut_host<RUSERS_MAXHOSTLEN>; /* host user logged on from */ 39*0Sstevel@tonic-gate int ut_type; /* type of entry */ 40*0Sstevel@tonic-gate int ut_time; /* time entry was made */ 41*0Sstevel@tonic-gate unsigned int ut_idle; /* minutes idle */ 42*0Sstevel@tonic-gate }; 43*0Sstevel@tonic-gate 44*0Sstevel@tonic-gate typedef rusers_utmp utmp_array<>; 45*0Sstevel@tonic-gate 46*0Sstevel@tonic-gate #ifdef RPC_HDR 47*0Sstevel@tonic-gate % 48*0Sstevel@tonic-gate %/* 49*0Sstevel@tonic-gate % * Values for ut_type field above. 50*0Sstevel@tonic-gate % */ 51*0Sstevel@tonic-gate #endif 52*0Sstevel@tonic-gate const RUSERS_EMPTY = 0; 53*0Sstevel@tonic-gate const RUSERS_RUN_LVL = 1; 54*0Sstevel@tonic-gate const RUSERS_BOOT_TIME = 2; 55*0Sstevel@tonic-gate const RUSERS_OLD_TIME = 3; 56*0Sstevel@tonic-gate const RUSERS_NEW_TIME = 4; 57*0Sstevel@tonic-gate const RUSERS_INIT_PROCESS = 5; 58*0Sstevel@tonic-gate const RUSERS_LOGIN_PROCESS = 6; 59*0Sstevel@tonic-gate const RUSERS_USER_PROCESS = 7; 60*0Sstevel@tonic-gate const RUSERS_DEAD_PROCESS = 8; 61*0Sstevel@tonic-gate const RUSERS_ACCOUNTING = 9; 62*0Sstevel@tonic-gate 63*0Sstevel@tonic-gate program RUSERSPROG { 64*0Sstevel@tonic-gate 65*0Sstevel@tonic-gate version RUSERSVERS_3 { 66*0Sstevel@tonic-gate int 67*0Sstevel@tonic-gate RUSERSPROC_NUM(void) = 1; 68*0Sstevel@tonic-gate 69*0Sstevel@tonic-gate utmp_array 70*0Sstevel@tonic-gate RUSERSPROC_NAMES(void) = 2; 71*0Sstevel@tonic-gate 72*0Sstevel@tonic-gate utmp_array 73*0Sstevel@tonic-gate RUSERSPROC_ALLNAMES(void) = 3; 74*0Sstevel@tonic-gate } = 3; 75*0Sstevel@tonic-gate 76*0Sstevel@tonic-gate } = 100002; 77*0Sstevel@tonic-gate 78*0Sstevel@tonic-gate #ifdef RPC_HDR 79*0Sstevel@tonic-gate % 80*0Sstevel@tonic-gate % 81*0Sstevel@tonic-gate % 82*0Sstevel@tonic-gate %/* 83*0Sstevel@tonic-gate % * The following structures are used by version 2 of the rusersd protocol. 84*0Sstevel@tonic-gate % * They were not developed with rpcgen, so they do not appear as RPCL. 85*0Sstevel@tonic-gate % */ 86*0Sstevel@tonic-gate % 87*0Sstevel@tonic-gate %#define RUSERSVERS_IDLE 2 88*0Sstevel@tonic-gate %#define RUSERSVERS 3 /* current version */ 89*0Sstevel@tonic-gate %#define MAXUSERS 100 90*0Sstevel@tonic-gate % 91*0Sstevel@tonic-gate %/* 92*0Sstevel@tonic-gate % * This is the structure used in version 2 of the rusersd RPC service. 93*0Sstevel@tonic-gate % * It corresponds to the utmp structure for BSD sytems. 94*0Sstevel@tonic-gate % */ 95*0Sstevel@tonic-gate %struct ru_utmp { 96*0Sstevel@tonic-gate % char ut_line[8]; /* tty name */ 97*0Sstevel@tonic-gate % char ut_name[8]; /* user id */ 98*0Sstevel@tonic-gate % char ut_host[16]; /* host name, if remote */ 99*0Sstevel@tonic-gate % time_t ut_time; /* time on */ 100*0Sstevel@tonic-gate %}; 101*0Sstevel@tonic-gate % 102*0Sstevel@tonic-gate %struct utmpidle { 103*0Sstevel@tonic-gate % struct ru_utmp ui_utmp; 104*0Sstevel@tonic-gate % unsigned ui_idle; 105*0Sstevel@tonic-gate %}; 106*0Sstevel@tonic-gate % 107*0Sstevel@tonic-gate %struct utmpidlearr { 108*0Sstevel@tonic-gate % struct utmpidle **uia_arr; 109*0Sstevel@tonic-gate % int uia_cnt; 110*0Sstevel@tonic-gate %}; 111*0Sstevel@tonic-gate % 112*0Sstevel@tonic-gate %int xdr_utmpidlearr(); 113*0Sstevel@tonic-gate % 114*0Sstevel@tonic-gate %#if defined(__STDC__) || defined(__cplusplus) 115*0Sstevel@tonic-gate %enum clnt_stat rusers(char *host, struct utmpidlearr *up); 116*0Sstevel@tonic-gate %int rnusers(char *host); 117*0Sstevel@tonic-gate %#else 118*0Sstevel@tonic-gate %enum clnt_stat rusers(); 119*0Sstevel@tonic-gate %int rnusers(); 120*0Sstevel@tonic-gate %#endif 121*0Sstevel@tonic-gate % 122*0Sstevel@tonic-gate #endif 123