2 Unix SMB/CIFS implementation.
6 Copyright (C) Andrew Tridgell 2003
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "librpc/ndr/ndr_server_id.h"
25 enum ndr_err_code
ndr_push_server_id(struct ndr_push
*ndr
, int ndr_flags
, const struct server_id
*r
)
27 if (ndr_flags
& NDR_SCALARS
) {
28 NDR_CHECK(ndr_push_align(ndr
, 4));
29 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
,
31 #ifdef CLUSTER_SUPPORT
32 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
,
36 if (ndr_flags
& NDR_BUFFERS
) {
38 return NDR_ERR_SUCCESS
;
41 enum ndr_err_code
ndr_pull_server_id(struct ndr_pull
*ndr
, int ndr_flags
, struct server_id
*r
)
43 if (ndr_flags
& NDR_SCALARS
) {
45 NDR_CHECK(ndr_pull_align(ndr
, 4));
46 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &pid
));
47 #ifdef CLUSTER_SUPPORT
48 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->vnn
));
52 if (ndr_flags
& NDR_BUFFERS
) {
54 return NDR_ERR_SUCCESS
;
57 void ndr_print_server_id(struct ndr_print
*ndr
, const char *name
, const struct server_id
*r
)
59 ndr_print_struct(ndr
, name
, "server_id");
61 ndr_print_uint32(ndr
, "id", (uint32_t)r
->pid
);
62 #ifdef CLUSTER_SUPPORT
63 ndr_print_uint32(ndr
, "vnn", (uint32_t)r
->vnn
);