s4:scripting/python/modules.c - remove a really unnecessary variable
[Samba.git] / source3 / librpc / ndr / ndr_server_id.c
bloba6152d755e822f8dc002a0c2ff2de0c11277156b
1 /*
2 Unix SMB/CIFS implementation.
4 libndr interface
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/>.
22 #include "includes.h"
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,
30 (uint32_t)r->pid));
31 #ifdef CLUSTER_SUPPORT
32 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS,
33 (uint32_t)r->vnn));
34 #endif
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) {
44 uint32_t pid;
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));
49 #endif
50 r->pid = (pid_t)pid;
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");
60 ndr->depth++;
61 ndr_print_uint32(ndr, "id", (uint32_t)r->pid);
62 #ifdef CLUSTER_SUPPORT
63 ndr_print_uint32(ndr, "vnn", (uint32_t)r->vnn);
64 #endif
65 ndr->depth--;