Line data Source code
1 : /* 2 : Unix SMB/CIFS implementation. 3 : test suite for various Domain DFS 4 : Copyright (C) Matthieu Patou 2010 5 : 6 : This program is free software; you can redistribute it and/or modify 7 : it under the terms of the GNU General Public License as published by 8 : the Free Software Foundation; either version 3 of the License, or 9 : (at your option) any later version. 10 : 11 : This program is distributed in the hope that it will be useful, 12 : but WITHOUT ANY WARRANTY; without even the implied warranty of 13 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 : GNU General Public License for more details. 15 : 16 : You should have received a copy of the GNU General Public License 17 : along with this program. If not, see <http://www.gnu.org/licenses/>. 18 : */ 19 : 20 : #include "includes.h" 21 : #include "libcli/libcli.h" 22 : #include "torture/smbtorture.h" 23 : #include "torture/util.h" 24 : #include "../librpc/gen_ndr/ndr_dfsblobs.h" 25 : #include "librpc/ndr/libndr.h" 26 : #include "param/param.h" 27 : #include "torture/torture.h" 28 : #include "torture/dfs/proto.h" 29 : #include "libcli/raw/raw_proto.h" 30 : 31 51 : NTSTATUS dfs_cli_do_call(struct smbcli_tree *tree, 32 : struct dfs_GetDFSReferral *ref) 33 : { 34 0 : NTSTATUS result; 35 0 : enum ndr_err_code ndr_err; 36 51 : uint16_t setup = TRANSACT2_GET_DFS_REFERRAL; 37 0 : struct smb_trans2 trans; 38 : 39 51 : ZERO_STRUCT(trans); 40 51 : trans.in.max_param = 0; 41 51 : trans.in.max_data = 4096; 42 51 : trans.in.max_setup = 0; 43 51 : trans.in.flags = 0; 44 51 : trans.in.timeout = 0; 45 51 : trans.in.setup_count = 1; 46 51 : trans.in.setup = &setup; 47 51 : trans.in.trans_name = NULL; 48 : 49 51 : ndr_err = ndr_push_struct_blob(&trans.in.params, tree, 50 51 : &ref->in.req, 51 : (ndr_push_flags_fn_t)ndr_push_dfs_GetDFSReferral_in); 52 51 : if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { 53 0 : return NT_STATUS_INTERNAL_ERROR; 54 : } 55 51 : trans.in.data = data_blob(NULL, 0); 56 : 57 51 : result = smb_raw_trans2(tree, tree, &trans); 58 : 59 51 : if (!NT_STATUS_IS_OK(result)) 60 9 : return result; 61 : 62 42 : ndr_err = ndr_pull_struct_blob(&trans.out.data, tree, 63 42 : ref->out.resp, 64 : (ndr_pull_flags_fn_t)ndr_pull_dfs_referral_resp); 65 42 : if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { 66 0 : return NT_STATUS_INVALID_NETWORK_RESPONSE; 67 : } 68 : 69 42 : return NT_STATUS_OK; 70 : } 71 :