2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
13 * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
17 * Private API to force DC Rediscovery.
22 #include <smb/nterror.h>
23 #include <arpa/inet.h>
28 static struct timeval TIMEOUT
= { 15, 0 };
31 _DsForceRediscovery(char *domain
, int flags
)
33 DsForceRediscoveryArgs args
;
35 enum clnt_stat clstat
;
38 (void) memset(&args
, 0, sizeof (args
));
40 args
.DomainName
= domain
;
43 * Call the ADS deamon.
45 clnt
= clnt_door_create(ADSPRIV_PROGRAM
, ADSPRIV_V1
, ADSPRIV_MAX_XFER
);
47 return (RPC_S_NOT_LISTENING
);
49 clstat
= clnt_call(clnt
, ADSPRIV_ForceRediscovery
,
50 (xdrproc_t
)xdr_DsForceRediscoveryArgs
, (caddr_t
)&args
,
51 (xdrproc_t
)xdr_int
, (caddr_t
)&res
, TIMEOUT
);
54 if (clstat
!= RPC_SUCCESS
)
55 return (RPC_S_CALL_FAILED
);