bool torture_rpc_connect_binding(struct torture_context *torture) { const enum libnet_RpcConnect_level level = LIBNET_RPC_CONNECT_BINDING; NTSTATUS status; struct dcerpc_binding *binding; const char *bindstr; status = torture_rpc_binding(torture, &binding); if (!NT_STATUS_IS_OK(status)) { return false; } bindstr = dcerpc_binding_string(torture, binding); return torture_rpc_connect(torture, level, bindstr, NULL); }
BOOL torture_rpc_connect_binding(struct torture_context *torture) { const enum libnet_RpcConnect_level level = LIBNET_RPC_CONNECT_BINDING; NTSTATUS status; struct dcerpc_binding *binding; const char *bindstr; bindstr = torture_setting_string(torture, "binding", NULL); status = dcerpc_parse_binding(torture, bindstr, &binding); if (!NT_STATUS_IS_OK(status)) { d_printf("failed to parse binding string\n"); return False; } return torture_rpc_connect(torture, level, bindstr, NULL); }
bool torture_rpc_connect_srv(struct torture_context *torture) { const enum libnet_RpcConnect_level level = LIBNET_RPC_CONNECT_SERVER; NTSTATUS status; struct dcerpc_binding *binding; const char *host; status = torture_rpc_binding(torture, &binding); if (!NT_STATUS_IS_OK(status)) { return false; } host = dcerpc_binding_get_string_option(binding, "host"); return torture_rpc_connect(torture, level, NULL, host); }
bool torture_rpc_connect_dc_info(struct torture_context *torture) { const enum libnet_RpcConnect_level level = LIBNET_RPC_CONNECT_DC_INFO; NTSTATUS status; struct dcerpc_binding *binding; const char *domain_name; status = torture_rpc_binding(torture, &binding); if (!NT_STATUS_IS_OK(status)) { return false; } /* we're accessing domain controller so the domain name should be passed (it's going to be resolved to dc name and address) instead of specific server name. */ domain_name = lpcfg_workgroup(torture->lp_ctx); return torture_rpc_connect(torture, level, NULL, domain_name); }
BOOL torture_rpc_connect_dc_info(struct torture_context *torture) { const enum libnet_RpcConnect_level level = LIBNET_RPC_CONNECT_DC_INFO; NTSTATUS status; struct dcerpc_binding *binding; const char *bindstr; const char *domain_name; bindstr = torture_setting_string(torture, "binding", NULL); status = dcerpc_parse_binding(torture, bindstr, &binding); if (!NT_STATUS_IS_OK(status)) { d_printf("failed to parse binding string\n"); return False; } /* we're accessing domain controller so the domain name should be passed (it's going to be resolved to dc name and address) instead of specific server name. */ domain_name = lp_workgroup(); return torture_rpc_connect(torture, level, NULL, domain_name); }