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