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]
23 * Copyright (c) 1986,1997 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #pragma ident "%Z%%M% %I% %E% SMI"
30 #include <rpc/bootparam.h>
33 xdr_bp_machine_name_t(XDR
*xdrs
, bp_machine_name_t
*objp
)
35 return (xdr_string(xdrs
, objp
, MAX_MACHINE_NAME
));
39 xdr_bp_path_t(XDR
*xdrs
, bp_path_t
*objp
)
41 return (xdr_string(xdrs
, objp
, MAX_PATH_LEN
));
45 xdr_bp_fileid_t(XDR
*xdrs
, bp_fileid_t
*objp
)
47 return (xdr_string(xdrs
, objp
, MAX_FILEID
));
51 xdr_ip_addr_t(XDR
*xdrs
, ip_addr_t
*objp
)
53 if (!xdr_char(xdrs
, &objp
->net
))
55 if (!xdr_char(xdrs
, &objp
->host
))
57 if (!xdr_char(xdrs
, &objp
->lh
))
59 if (!xdr_char(xdrs
, &objp
->impno
))
64 static struct xdr_discrim choices
[] = {
65 { IP_ADDR_TYPE
, xdr_ip_addr_t
},
66 { __dontcare__
, NULL
}
70 xdr_bp_address(XDR
*xdrs
, bp_address
*objp
)
72 return (xdr_union(xdrs
, (enum_t
*)&objp
->address_type
,
73 (char *)&objp
->bp_address
, choices
, (xdrproc_t
)NULL
));
77 xdr_bp_whoami_arg(XDR
*xdrs
, bp_whoami_arg
*objp
)
79 return (xdr_bp_address(xdrs
, &objp
->client_address
));
83 xdr_bp_whoami_res(XDR
*xdrs
, bp_whoami_res
*objp
)
85 if (!xdr_bp_machine_name_t(xdrs
, &objp
->client_name
))
87 if (!xdr_bp_machine_name_t(xdrs
, &objp
->domain_name
))
89 if (!xdr_bp_address(xdrs
, &objp
->router_address
))
95 xdr_bp_getfile_arg(XDR
*xdrs
, bp_getfile_arg
*objp
)
97 if (!xdr_bp_machine_name_t(xdrs
, &objp
->client_name
))
99 if (!xdr_bp_fileid_t(xdrs
, &objp
->file_id
))
105 xdr_bp_getfile_res(XDR
*xdrs
, bp_getfile_res
*objp
)
107 if (!xdr_bp_machine_name_t(xdrs
, &objp
->server_name
))
109 if (!xdr_bp_address(xdrs
, &objp
->server_address
))
111 if (!xdr_bp_path_t(xdrs
, &objp
->server_path
))