ReactOS  0.4.13-dev-39-g8b6696f
nfs41_rpc.c File Reference
#include "nfs41_ops.h"
#include "daemon_debug.h"
#include "nfs41_xdr.h"
#include "nfs41_callback.h"
#include "nfs41_driver.h"
#include "rpc/rpc.h"
#include <security.h>
#include "rpc/auth_sspi.h"
Include dependency graph for nfs41_rpc.c:

Go to the source code of this file.

Macros

#define SECURITY_WIN32
 

Functions

static enum clnt_stat send_null (CLIENT *client)
 
static int get_client_for_netaddr (IN const netaddr4 *netaddr, IN uint32_t wsize, IN uint32_t rsize, IN nfs41_rpc_clnt *rpc, OUT OPTIONAL char *server_name, OUT CLIENT **client_out)
 
static int get_client_for_multi_addr (IN const multi_addr4 *addrs, IN uint32_t wsize, IN uint32_t rsize, IN nfs41_rpc_clnt *rpc, OUT OPTIONAL char *server_name, OUT CLIENT **client_out, OUT uint32_t *addr_index)
 
int create_rpcsec_auth_client (IN uint32_t sec_flavor, IN char *server_name, CLIENT *client)
 
int nfs41_rpc_clnt_create (IN const multi_addr4 *addrs, IN uint32_t wsize, IN uint32_t rsize, IN uint32_t uid, IN uint32_t gid, IN uint32_t sec_flavor, OUT nfs41_rpc_clnt **rpc_out)
 
void nfs41_rpc_clnt_free (IN nfs41_rpc_clnt *rpc)
 
static bool_t rpc_renew_in_progress (nfs41_rpc_clnt *rpc, int *value)
 
static bool_t rpc_should_retry (nfs41_rpc_clnt *rpc, uint32_t version)
 
static int rpc_reconnect (IN nfs41_rpc_clnt *rpc)
 
int nfs41_send_compound (IN nfs41_rpc_clnt *rpc, IN char *inbuf, OUT char *outbuf)
 

Macro Definition Documentation

◆ SECURITY_WIN32

#define SECURITY_WIN32

Definition at line 29 of file nfs41_rpc.c.

Function Documentation

◆ create_rpcsec_auth_client()

int create_rpcsec_auth_client ( IN uint32_t  sec_flavor,
IN char server_name,
CLIENT client 
)

Definition at line 105 of file nfs41_rpc.c.

110 {
112 
113  switch (sec_flavor) {
114  case RPCSEC_AUTHGSS_KRB5:
117  break;
121  break;
125  break;
126  default:
127  eprintf("create_rpc_auth_client: unknown rpcsec flavor %d\n",
128  sec_flavor);
129  client->cl_auth = NULL;
130  }
131 
132  if (client->cl_auth == NULL) {
133  eprintf("nfs41_rpc_clnt_create: failed to create %s\n",
135  goto out;
136  } else
137  dprintf(1, "nfs41_rpc_clnt_create: successfully created %s\n",
139  status = 0;
140 out:
141  return status;
142 }
void eprintf(LPCSTR format,...)
Definition: daemon_debug.c:86
#define dprintf
Definition: regdump.c:33
smooth NULL
Definition: ftsmooth.c:416
AUTH * authsspi_create_default(CLIENT *clnt, char *service, int svc)
Definition: auth_sspi.c:133
static FILE * client
Definition: client.c:41
static FILE * out
Definition: regtests2xml.c:44
char * server_name
Definition: widl.c:145
const char * secflavorop2name(DWORD sec_flavor)
Definition: daemon_debug.c:558
#define ERROR_NETWORK_UNREACHABLE
Definition: winerror.h:734
sec_flavor
Definition: nfs41_ops.h:861
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by nfs41_rpc_clnt_create(), nfs41_send_compound(), and rpc_reconnect().

◆ get_client_for_multi_addr()

static int get_client_for_multi_addr ( IN const multi_addr4 addrs,
IN uint32_t  wsize,
IN uint32_t  rsize,
IN nfs41_rpc_clnt rpc,
OUT OPTIONAL char server_name,
OUT CLIENT **  client_out,
OUT uint32_t addr_index 
)
static

Definition at line 83 of file nfs41_rpc.c.

91 {
93  uint32_t i;
94  for (i = 0; i < addrs->count; i++) {
95  status = get_client_for_netaddr(&addrs->arr[i],
96  wsize, rsize, rpc, server_name, client_out);
97  if (status == NO_ERROR) {
98  *addr_index = i;
99  break;
100  }
101  }
102  return status;
103 }
#define NO_ERROR
Definition: dderror.h:5
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
char * server_name
Definition: widl.c:145
#define ERROR_NETWORK_UNREACHABLE
Definition: winerror.h:734
UINT32 uint32_t
Definition: types.h:75
static SERVICE_STATUS status
Definition: service.c:31
static int get_client_for_netaddr(IN const netaddr4 *netaddr, IN uint32_t wsize, IN uint32_t rsize, IN nfs41_rpc_clnt *rpc, OUT OPTIONAL char *server_name, OUT CLIENT **client_out)
Definition: nfs41_rpc.c:42
Definition: ps.c:97

Referenced by nfs41_rpc_clnt_create(), and rpc_reconnect().

◆ get_client_for_netaddr()

static int get_client_for_netaddr ( IN const netaddr4 netaddr,
IN uint32_t  wsize,
IN uint32_t  rsize,
IN nfs41_rpc_clnt rpc,
OUT OPTIONAL char server_name,
OUT CLIENT **  client_out 
)
static

Definition at line 42 of file nfs41_rpc.c.

49 {
51  struct netconfig *nconf;
52  struct netbuf *addr;
53  CLIENT *client;
54 
55  nconf = getnetconfigent(netaddr->netid);
56  if (nconf == NULL)
57  goto out;
58 
59  addr = uaddr2taddr(nconf, netaddr->uaddr);
60  if (addr == NULL)
61  goto out_free_conf;
62 
63  if (server_name) {
64  getnameinfo(addr->buf, addr->len, server_name, NI_MAXHOST, NULL, 0, 0);
65  dprintf(1, "servername is %s\n", server_name);
66  }
67  dprintf(1, "callback function %p args %p\n", nfs41_handle_callback, rpc);
69  NFS41_RPC_VERSION, wsize, rsize, rpc ? proc_cb_compound_res : NULL,
70  rpc ? nfs41_handle_callback : NULL, rpc ? rpc : NULL);
71  if (client) {
72  *client_out = client;
73  status = NO_ERROR;
74  }
75 
77 out_free_conf:
78  freenetconfigent(nconf);
79 out:
80  return status;
81 }
#define RPC_ANYFD
Definition: svc.h:328
void freenetbuf(struct netbuf *nbuf)
Definition: rpc_generic.c:633
#define NO_ERROR
Definition: dderror.h:5
#define NFS41_RPC_PROGRAM
Definition: nfs41_const.h:78
int nfs41_handle_callback(void *rpc_clnt, void *cb, struct cb_compound_res **reply)
#define dprintf
Definition: regdump.c:33
void freenetconfigent(struct netconfig *netconfigp)
Definition: getnetconfig.c:530
smooth NULL
Definition: ftsmooth.c:416
struct netconfig * getnetconfigent(char *netid) const
Definition: getnetconfig.c:432
struct netbuf * uaddr2taddr(const struct netconfig *nconf, const char *uaddr)
Definition: rpc_generic.c:619
static FILE * client
Definition: client.c:41
static FILE * out
Definition: regtests2xml.c:44
#define NI_MAXHOST
Definition: ws2def.h:359
char * server_name
Definition: widl.c:145
GLenum const GLvoid * addr
Definition: glext.h:9621
CLIENT * clnt_tli_create(const SOCKET fd_in, const struct netconfig *nconf, struct netbuf *svcaddr, const rpcprog_t prog, const rpcvers_t vers, const uint sendsz, const uint recvsz, int(*callback_xdr)(void *, void *), int(*callback_function)(void *, void *, void **), void *callback_args)
Definition: clnt_generic.c:347
#define NFS41_RPC_VERSION
Definition: nfs41_const.h:79
#define ERROR_NETWORK_UNREACHABLE
Definition: winerror.h:734
#define getnameinfo
Definition: wspiapi.h:45
Definition: types.h:144
bool_t proc_cb_compound_res(XDR *xdr, struct cb_compound_res *res)
Definition: callback_xdr.c:638
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by get_client_for_multi_addr().

◆ nfs41_rpc_clnt_create()

int nfs41_rpc_clnt_create ( IN const multi_addr4 addrs,
IN uint32_t  wsize,
IN uint32_t  rsize,
IN uint32_t  uid,
IN uint32_t  gid,
IN uint32_t  sec_flavor,
OUT nfs41_rpc_clnt **  rpc_out 
)

Definition at line 145 of file nfs41_rpc.c.

153 {
154  CLIENT *client;
155  nfs41_rpc_clnt *rpc;
156  uint32_t addr_index;
157  int status;
158  char machname[MAXHOSTNAMELEN + 1];
159  gid_t gids[1];
160  bool_t needcb = 1;
161 
162  rpc = calloc(1, sizeof(nfs41_rpc_clnt));
163  if (rpc == NULL) {
164  status = GetLastError();
165  goto out;
166  }
167 #ifdef NO_CB_4_KRB5P
169  needcb = 0;
170 #endif
171  rpc->needcb = needcb;
172  rpc->cond = CreateEvent(NULL, TRUE, FALSE, NULL);
173  if (rpc->cond == NULL) {
174  status = GetLastError();
175  eprintf("CreateEvent failed %d\n", status);
176  goto out_free_rpc_clnt;
177  }
178  status = get_client_for_multi_addr(addrs, wsize, rsize, needcb?rpc:NULL,
179  rpc->server_name, &client, &addr_index);
180  if (status) {
181  clnt_pcreateerror("connecting failed");
182  goto out_free_rpc_cond;
183  }
184  if (send_null(client) != RPC_SUCCESS) {
185  // XXX Do what here?
186  eprintf("nfs41_rpc_clnt_create: send_null failed\n");
188  goto out_err_client;
189  }
190 
191  rpc->sec_flavor = sec_flavor;
192  if (sec_flavor == RPCSEC_AUTH_SYS) {
193  if (gethostname(machname, sizeof(machname)) == -1) {
194  eprintf("nfs41_rpc_clnt_create: gethostname failed\n");
195  goto out_err_client;
196  }
197  machname[sizeof(machname) - 1] = '\0';
198  client->cl_auth = authsys_create(machname, uid, gid, 0, gids);
199  if (client->cl_auth == NULL) {
200  eprintf("nfs41_rpc_clnt_create: failed to create rpc authsys\n");
202  goto out_err_client;
203  }
204  } else {
206  if (status) {
207  eprintf("nfs41_rpc_clnt_create: failed to establish security "
208  "context with %s\n", rpc->server_name);
210  goto out_err_client;
211  } else
212  dprintf(1, "nfs41_rpc_clnt_create: successfully created %s\n",
214  }
215  rpc->rpc = client;
216 
217  /* keep a copy of the address and buffer sizes for reconnect */
218  memcpy(&rpc->addrs, addrs, sizeof(multi_addr4));
219  /* save the index of the address we connected to */
220  rpc->addr_index = addr_index;
221  rpc->wsize = wsize;
222  rpc->rsize = rsize;
223  rpc->is_valid_session = TRUE;
224  rpc->uid = uid;
225  rpc->gid = gid;
226 
227  //initialize rpc client lock
228  InitializeSRWLock(&rpc->lock);
229 
230  *rpc_out = rpc;
231 out:
232  return status;
233 out_err_client:
235 out_free_rpc_cond:
236  CloseHandle(rpc->cond);
237 out_free_rpc_clnt:
238  free(rpc);
239  goto out;
240 }
#define CreateEvent
Definition: winbase.h:3562
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
static enum clnt_stat send_null(CLIENT *client)
Definition: nfs41_rpc.c:33
int32_t bool_t
Definition: types.h:101
#define free
Definition: debug_ros.c:5
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
void eprintf(LPCSTR format,...)
Definition: daemon_debug.c:86
bool_t is_valid_session
Definition: nfs41.h:181
uint32_t rsize
Definition: nfs41.h:175
bool_t needcb
Definition: nfs41.h:183
UINT gid_t
Definition: types.h:89
INT WSAAPI gethostname(OUT char FAR *name, IN INT namelen)
Definition: getxbyxx.c:397
#define dprintf
Definition: regdump.c:33
smooth NULL
Definition: ftsmooth.c:416
static int get_client_for_multi_addr(IN const multi_addr4 *addrs, IN uint32_t wsize, IN uint32_t rsize, IN nfs41_rpc_clnt *rpc, OUT OPTIONAL char *server_name, OUT CLIENT **client_out, OUT uint32_t *addr_index)
Definition: nfs41_rpc.c:83
char server_name[NI_MAXHOST]
Definition: nfs41.h:180
uint32_t wsize
Definition: nfs41.h:174
multi_addr4 addrs
Definition: nfs41.h:172
int create_rpcsec_auth_client(IN uint32_t sec_flavor, IN char *server_name, CLIENT *client)
Definition: nfs41_rpc.c:105
static FILE * client
Definition: client.c:41
static FILE * out
Definition: regtests2xml.c:44
HANDLE cond
Definition: nfs41.h:170
uint32_t sec_flavor
Definition: nfs41.h:177
SRWLOCK lock
Definition: nfs41.h:169
void clnt_pcreateerror(char *s) const
Definition: clnt_perror.c:307
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
VOID WINAPI InitializeSRWLock(PSRWLOCK Lock)
Definition: sync.c:75
uint32_t addr_index
Definition: nfs41.h:173
const char * secflavorop2name(DWORD sec_flavor)
Definition: daemon_debug.c:558
struct __rpc_client * rpc
Definition: nfs41.h:168
#define MAXHOSTNAMELEN
Definition: ftp.c:31
#define ERROR_NETWORK_UNREACHABLE
Definition: winerror.h:734
uint32_t uid
Definition: nfs41.h:178
UINT32 uint32_t
Definition: types.h:75
#define calloc
Definition: rosglue.h:14
#define authsys_create(c, i1, i2, i3, ip)
Definition: auth.h:323
sec_flavor
Definition: nfs41_ops.h:861
uint32_t gid
Definition: nfs41.h:179
static SERVICE_STATUS status
Definition: service.c:31
#define clnt_destroy(rh)
Definition: clnt.h:276
Definition: ps.c:97

Referenced by nfs41_root_mount_addrs().

◆ nfs41_rpc_clnt_free()

void nfs41_rpc_clnt_free ( IN nfs41_rpc_clnt rpc)

Definition at line 243 of file nfs41_rpc.c.

245 {
246  auth_destroy(rpc->rpc->cl_auth);
247  clnt_destroy(rpc->rpc);
248  CloseHandle(rpc->cond);
249  free(rpc);
250 }
#define CloseHandle
Definition: compat.h:398
#define free
Definition: debug_ros.c:5
#define clnt_destroy(rh)
Definition: clnt.h:276
#define auth_destroy(auth)
Definition: auth.h:259

Referenced by nfs41_client_create(), nfs41_client_free(), and nfs41_root_mount_addrs().

◆ nfs41_send_compound()

int nfs41_send_compound ( IN nfs41_rpc_clnt rpc,
IN char inbuf,
OUT char outbuf 
)

Definition at line 337 of file nfs41_rpc.c.

341 {
342  struct timeval timeout = {90, 100};
343  enum clnt_stat rpc_status;
344  int status, count = 0, one = 1, zero = 0;
346 
347  try_again:
348  AcquireSRWLockShared(&rpc->lock);
349  version = rpc->version;
350  rpc_status = clnt_call(rpc->rpc, 1,
353  timeout);
354  ReleaseSRWLockShared(&rpc->lock);
355 
356  if (rpc_status != RPC_SUCCESS) {
357  eprintf("clnt_call returned rpc_status = %s\n",
358  rpc_error_string(rpc_status));
359  switch(rpc_status) {
360  case RPC_CANTRECV:
361  case RPC_CANTSEND:
362  case RPC_TIMEDOUT:
363  case RPC_AUTHERROR:
364  if (++count > 3 || !rpc->is_valid_session) {
366  break;
367  }
368  if (rpc_should_retry(rpc, version))
369  goto try_again;
370  while (rpc_renew_in_progress(rpc, NULL)) {
371  status = WaitForSingleObject(rpc->cond, INFINITE);
372  if (status != WAIT_OBJECT_0) {
373  dprintf(1, "rpc_renew_in_progress: WaitForSingleObject failed\n");
376  goto out;
377  }
379  goto try_again;
380  }
381  rpc_renew_in_progress(rpc, &one);
382  if (rpc_status == RPC_AUTHERROR && rpc->sec_flavor != RPCSEC_AUTH_SYS) {
383  AcquireSRWLockExclusive(&rpc->lock);
384  auth_destroy(rpc->rpc->cl_auth);
385  status = create_rpcsec_auth_client(rpc->sec_flavor,
386  rpc->server_name, rpc->rpc);
387  ReleaseSRWLockExclusive(&rpc->lock);
388  if (status) {
389  eprintf("Failed to reestablish security context\n");
391  goto out;
392  }
393  } else
394  if (rpc_reconnect(rpc))
395  eprintf("rpc_reconnect: Failed to reconnect!\n");
397  goto try_again;
398  default:
399  eprintf("UNHANDLED RPC_ERROR: %d\n", rpc_status);
401  goto out;
402  }
403  goto out;
404  }
405 
406  status = 0;
407 out:
408  return status;
409 }
VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK Lock)
Definition: sync.c:54
GLuint GLuint GLsizei count
Definition: gl.h:1545
void eprintf(LPCSTR format,...)
Definition: daemon_debug.c:86
Definition: dhcpd.h:245
static double one
Definition: j0_y0.c:80
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144
#define dprintf
Definition: regdump.c:33
const char * rpc_error_string(int status)
Definition: daemon_debug.c:482
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR version[]
Definition: asmname.c:64
#define WAIT_OBJECT_0
Definition: winbase.h:387
static bool_t rpc_renew_in_progress(nfs41_rpc_clnt *rpc, int *value)
Definition: nfs41_rpc.c:252
bool_t nfs_decode_compound(XDR *xdr, caddr_t *pres)
Definition: nfs41_xdr.c:3625
int create_rpcsec_auth_client(IN uint32_t sec_flavor, IN char *server_name, CLIENT *client)
Definition: nfs41_rpc.c:105
static FILE * out
Definition: regtests2xml.c:44
uchar inbuf[M_BLOCK]
Definition: unzcrash.c:40
static double zero
Definition: j0_y0.c:96
VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK Lock)
Definition: sync.c:82
static int rpc_reconnect(IN nfs41_rpc_clnt *rpc)
Definition: nfs41_rpc.c:279
#define ERROR_NETWORK_UNREACHABLE
Definition: winerror.h:734
#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs)
Definition: clnt.h:202
UINT32 uint32_t
Definition: types.h:75
#define ERROR_LOCK_VIOLATION
Definition: winerror.h:136
bool_t nfs_encode_compound(XDR *xdr, caddr_t *pargs)
Definition: nfs41_xdr.c:3591
static bool_t rpc_should_retry(nfs41_rpc_clnt *rpc, uint32_t version)
Definition: nfs41_rpc.c:269
#define INFINITE
Definition: serial.h:102
static SERVICE_STATUS status
Definition: service.c:31
void print_condwait_status(int level, int status)
Definition: daemon_debug.c:513
VOID WINAPI AcquireSRWLockShared(PSRWLOCK Lock)
Definition: sync.c:61
#define auth_destroy(auth)
Definition: auth.h:259
VOID WINAPI ReleaseSRWLockShared(PSRWLOCK Lock)
Definition: sync.c:89
clnt_stat
Definition: clnt_stat.h:21
uchar outbuf[M_BLOCK_OUT]
Definition: unzcrash.c:41
Definition: ps.c:97

Referenced by compound_encode_send_decode(), nfs41_bind_conn_to_session(), nfs41_destroy_clientid(), and nfs41_exchange_id().

◆ rpc_reconnect()

static int rpc_reconnect ( IN nfs41_rpc_clnt rpc)
static

Definition at line 279 of file nfs41_rpc.c.

281 {
282  CLIENT *client = NULL;
283  uint32_t addr_index;
284  int status;
285 
286  AcquireSRWLockExclusive(&rpc->lock);
287 
288  status = get_client_for_multi_addr(&rpc->addrs, rpc->wsize, rpc->rsize,
289  rpc->needcb?rpc:NULL, NULL, &client, &addr_index);
290  if (status)
291  goto out_unlock;
292 
293  if(rpc->sec_flavor == RPCSEC_AUTH_SYS)
294  client->cl_auth = rpc->rpc->cl_auth;
295  else {
296  auth_destroy(rpc->rpc->cl_auth);
297  status = create_rpcsec_auth_client(rpc->sec_flavor, rpc->server_name, client);
298  if (status) {
299  eprintf("Failed to reestablish security context\n");
301  goto out_err_client;
302  }
303  }
304  if (send_null(client) != RPC_SUCCESS) {
305  eprintf("rpc_reconnect: send_null failed\n");
307  goto out_err_client;
308  }
309 
310  clnt_destroy(rpc->rpc);
311  rpc->rpc = client;
312  rpc->addr_index = addr_index;
313  rpc->version++;
314  dprintf(1, "nfs41_send_compound: reestablished RPC connection\n");
315 
316 out_unlock:
317  ReleaseSRWLockExclusive(&rpc->lock);
318 
319  /* after releasing the rpc lock, send a BIND_CONN_TO_SESSION if
320  * we need to associate the connection with the backchannel */
321  if (status == NO_ERROR && rpc->needcb &&
322  rpc->client && rpc->client->session) {
324  rpc->client->session->session_id, CDFC4_BACK_OR_BOTH);
325  if (status)
326  eprintf("nfs41_bind_conn_to_session() failed with %s\n",
328  status = NFS4_OK;
329  }
330  return status;
331 
332 out_err_client:
334  goto out_unlock;
335 }
VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK Lock)
Definition: sync.c:54
static enum clnt_stat send_null(CLIENT *client)
Definition: nfs41_rpc.c:33
void eprintf(LPCSTR format,...)
Definition: daemon_debug.c:86
#define NO_ERROR
Definition: dderror.h:5
enum nfsstat4 nfs41_bind_conn_to_session(IN nfs41_rpc_clnt *rpc, IN const unsigned char *sessionid, IN enum channel_dir_from_client4 dir)
Definition: nfs41_ops.c:185
#define dprintf
Definition: regdump.c:33
smooth NULL
Definition: ftsmooth.c:416
static int get_client_for_multi_addr(IN const multi_addr4 *addrs, IN uint32_t wsize, IN uint32_t rsize, IN nfs41_rpc_clnt *rpc, OUT OPTIONAL char *server_name, OUT CLIENT **client_out, OUT uint32_t *addr_index)
Definition: nfs41_rpc.c:83
int create_rpcsec_auth_client(IN uint32_t sec_flavor, IN char *server_name, CLIENT *client)
Definition: nfs41_rpc.c:105
static FILE * client
Definition: client.c:41
const char * nfs_error_string(int status)
Definition: daemon_debug.c:370
VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK Lock)
Definition: sync.c:82
#define ERROR_NETWORK_UNREACHABLE
Definition: winerror.h:734
UINT32 uint32_t
Definition: types.h:75
static SERVICE_STATUS status
Definition: service.c:31
#define clnt_destroy(rh)
Definition: clnt.h:276
#define auth_destroy(auth)
Definition: auth.h:259
Definition: ps.c:97

Referenced by nfs41_send_compound().

◆ rpc_renew_in_progress()

static bool_t rpc_renew_in_progress ( nfs41_rpc_clnt rpc,
int value 
)
static

Definition at line 252 of file nfs41_rpc.c.

253 {
254  bool_t status = FALSE;
256  if (value) {
257  dprintf(1, "nfs41_rpc_renew_in_progress: setting value %d\n", *value);
258  rpc->in_recovery = *value;
259  if (!rpc->in_recovery)
260  SetEvent(rpc->cond);
261  } else {
262  status = rpc->in_recovery;
263  dprintf(1, "nfs41_rpc_renew_in_progress: returning value %d\n", status);
264  }
266  return status;
267 }
VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK Lock)
Definition: sync.c:54
int32_t bool_t
Definition: types.h:101
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:679
#define dprintf
Definition: regdump.c:33
bool_t in_recovery
Definition: nfs41.h:182
HANDLE cond
Definition: nfs41.h:170
SRWLOCK lock
Definition: nfs41.h:169
VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK Lock)
Definition: sync.c:82
GLsizei const GLfloat * value
Definition: glext.h:6069
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by nfs41_send_compound().

◆ rpc_should_retry()

static bool_t rpc_should_retry ( nfs41_rpc_clnt rpc,
uint32_t  version 
)
static

Definition at line 269 of file nfs41_rpc.c.

270 {
271  bool_t status = 0;
273  if (rpc->version > version)
274  status = 1;
276  return status;
277 }
VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK Lock)
Definition: sync.c:54
int32_t bool_t
Definition: types.h:101
static const WCHAR version[]
Definition: asmname.c:64
SRWLOCK lock
Definition: nfs41.h:169
VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK Lock)
Definition: sync.c:82
static SERVICE_STATUS status
Definition: service.c:31
uint32_t version
Definition: nfs41.h:176
Definition: ps.c:97

Referenced by nfs41_send_compound().

◆ send_null()

static enum clnt_stat send_null ( CLIENT client)
static

Definition at line 33 of file nfs41_rpc.c.

34 {
35  struct timeval timeout = {10, 100};
36 
37  return clnt_call(client, 0,
40 }
Definition: dhcpd.h:245
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144
smooth NULL
Definition: ftsmooth.c:416
static FILE * client
Definition: client.c:41
bool_t xdr_void(void)
Definition: xdr.c:92
#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs)
Definition: clnt.h:202

Referenced by nfs41_rpc_clnt_create(), and rpc_reconnect().