rnusers.x revision 302408
1255164Sjhibbits/*- 2255164Sjhibbits * Copyright (c) 2010, Oracle America, Inc. 3255164Sjhibbits * 4255164Sjhibbits * Redistribution and use in source and binary forms, with or without 5255164Sjhibbits * modification, are permitted provided that the following conditions are 6255164Sjhibbits * met: 7255164Sjhibbits * 8255164Sjhibbits * * Redistributions of source code must retain the above copyright 9255164Sjhibbits * notice, this list of conditions and the following disclaimer. 10255164Sjhibbits * * Redistributions in binary form must reproduce the above 11255164Sjhibbits * copyright notice, this list of conditions and the following 12255164Sjhibbits * disclaimer in the documentation and/or other materials 13255164Sjhibbits * provided with the distribution. 14255164Sjhibbits * * Neither the name of the "Oracle America, Inc." nor the names of its 15255164Sjhibbits * contributors may be used to endorse or promote products derived 16255164Sjhibbits * from this software without specific prior written permission. 17255164Sjhibbits * 18255164Sjhibbits * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19255164Sjhibbits * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20255164Sjhibbits * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 21255164Sjhibbits * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 22255164Sjhibbits * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 23255164Sjhibbits * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24255164Sjhibbits * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 25255164Sjhibbits * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26255164Sjhibbits * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27255164Sjhibbits * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28255164Sjhibbits * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29255164Sjhibbits * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30255164Sjhibbits */ 31255164Sjhibbits 32255164Sjhibbits/* 33255164Sjhibbits * Find out about remote users 34255164Sjhibbits */ 35255164Sjhibbits 36255164Sjhibbits#ifndef RPC_HDR 37255164Sjhibbits%#ifndef lint 38255164Sjhibbits%/*static char sccsid[] = "from: @(#)rnusers.x 1.2 87/09/20 Copyr 1987 Sun Micro";*/ 39255164Sjhibbits%/*static char sccsid[] = "from: @(#)rnusers.x 2.1 88/08/01 4.0 RPCSRC";*/ 40255164Sjhibbits%#endif /* not lint */ 41255164Sjhibbits%#include <sys/cdefs.h> 42255164Sjhibbits%__FBSDID("$FreeBSD: stable/11/include/rpcsvc/rnusers.x 259117 2013-12-09 04:26:50Z hrs $"); 43255164Sjhibbits#endif 44255164Sjhibbits 45255164Sjhibbitsconst MAXUSERS = 100; 46255164Sjhibbitsconst MAXUTLEN = 256; 47255164Sjhibbits 48255164Sjhibbitsstruct utmp { 49263122Sjhibbits string ut_line<MAXUTLEN>; 50255164Sjhibbits string ut_name<MAXUTLEN>; 51255164Sjhibbits string ut_host<MAXUTLEN>; 52255164Sjhibbits int ut_time; 53255164Sjhibbits}; 54255164Sjhibbits 55263122Sjhibbits 56255164Sjhibbitsstruct utmpidle { 57255164Sjhibbits utmp ui_utmp; 58255164Sjhibbits unsigned int ui_idle; 59255164Sjhibbits}; 60255164Sjhibbits 61255164Sjhibbitstypedef utmp utmparr<MAXUSERS>; 62 63typedef utmpidle utmpidlearr<MAXUSERS>; 64 65const RUSERS_MAXUSERLEN = 32; 66const RUSERS_MAXLINELEN = 32; 67const RUSERS_MAXHOSTLEN = 257; 68 69struct rusers_utmp { 70 string ut_user<RUSERS_MAXUSERLEN>; /* aka ut_name */ 71 string ut_line<RUSERS_MAXLINELEN>; /* device */ 72 string ut_host<RUSERS_MAXHOSTLEN>; /* host user logged on from */ 73 int ut_type; /* type of entry */ 74 int ut_time; /* time entry was made */ 75 unsigned int ut_idle; /* minutes idle */ 76}; 77 78typedef rusers_utmp utmp_array<>; 79 80program RUSERSPROG { 81 /* 82 * Old version does not include idle information 83 */ 84 version RUSERSVERS_ORIG { 85 int 86 RUSERSPROC_NUM(void) = 1; 87 88 utmparr 89 RUSERSPROC_NAMES(void) = 2; 90 91 utmparr 92 RUSERSPROC_ALLNAMES(void) = 3; 93 } = 1; 94 95 /* 96 * Includes idle information 97 */ 98 version RUSERSVERS_IDLE { 99 int 100 RUSERSPROC_NUM(void) = 1; 101 102 utmpidlearr 103 RUSERSPROC_NAMES(void) = 2; 104 105 utmpidlearr 106 RUSERSPROC_ALLNAMES(void) = 3; 107 } = 2; 108 109 /* 110 * Version 3 rusers procedures (from Solaris). 111 * (Thanks a lot Sun.) 112 */ 113 version RUSERSVERS_3 { 114 int 115 RUSERSPROC_NUM(void) = 1; 116 117 utmp_array 118 RUSERSPROC_NAMES(void) = 2; 119 120 utmp_array 121 RUSERSPROC_ALLNAMES(void) = 3; 122 } = 3; 123 124} = 100002; 125 126