4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
25 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
26 /* All Rights Reserved */
28 * Portions of this source code were derived from Berkeley
29 * 4.3 BSD under license from the Regents of the University of
33 #pragma ident "%Z%%M% %I% %E% SMI"
37 * These are the non-rpcgen-able XDR routines for version 2 of the rusers
42 #include <sys/types.h>
44 #include <rpcsvc/rusers.h>
47 xdr_ru_utmp(xdrsp
, up
)
55 * This code implements demented byte vectors: we send out the length
56 * of fixed-length vectors, followed by the opaque bytes. This is to
57 * be compatible with the over-the-wire protocol, as well as the
58 * rusers.h definition for struct ru_utmp.
60 len
= (int)sizeof (up
->ut_line
);
61 if (xdr_u_int(xdrsp
, &len
) == FALSE
)
63 if (len
!= sizeof (up
->ut_line
)) {
66 if (!xdr_opaque(xdrsp
, (char *)up
->ut_line
, len
)) {
69 len
= (int)sizeof (up
->ut_name
);
70 if (xdr_u_int(xdrsp
, &len
) == FALSE
)
72 if (len
!= sizeof (up
->ut_name
)) {
75 if (!xdr_opaque(xdrsp
, (char *)up
->ut_name
, len
)) {
78 len
= (int)sizeof (up
->ut_host
);
79 if (xdr_u_int(xdrsp
, &len
) == FALSE
)
81 if (len
!= sizeof (up
->ut_host
)) {
84 if (!xdr_opaque(xdrsp
, (char *)up
->ut_host
, len
)) {
87 if (xdr_int(xdrsp
, (int32_t *) &up
->ut_time
) == FALSE
)
93 xdr_utmpidle(xdrsp
, ui
)
97 if (xdr_ru_utmp(xdrsp
, &ui
->ui_utmp
) == FALSE
)
99 if (xdr_u_int(xdrsp
, &ui
->ui_idle
) == FALSE
)
105 xdr_utmpidleptr(xdrsp
, up
)
107 struct utmpidle
**up
;
109 if (xdr_reference(xdrsp
, (char **) up
, sizeof (struct utmpidle
),
110 xdr_utmpidle
) == FALSE
)
116 xdr_utmpidlearr(xdrsp
, up
)
118 struct utmpidlearr
*up
;
120 return (xdr_array(xdrsp
, (char **) &up
->uia_arr
,
121 (u_int
*)&(up
->uia_cnt
), MAXUSERS
, sizeof (struct utmpidle
*),