ReactOS  0.4.13-dev-66-gc714b7f
auth_none.c File Reference
#include <wintirpc.h>
#include <reentrant.h>
#include <assert.h>
#include <stdlib.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <rpc/auth.h>
Include dependency graph for auth_none.c:

Go to the source code of this file.

Classes

struct  authnone_private
 

Macros

#define MAX_MARSHAL_SIZE   20
 

Functions

static bool_t authnone_marshal (AUTH *, XDR *, u_int *)
 
static void authnone_verf (AUTH *)
 
static bool_t authnone_validate (AUTH *, struct opaque_auth *, u_int)
 
static bool_t authnone_refresh (AUTH *, void *)
 
static void authnone_destroy (AUTH *)
 
bool_t xdr_opaque_auth ()
 
static struct auth_ops * authnone_ops ()
 
AUTHauthnone_create ()
 
static int authnone_wrap (AUTH *auth, XDR *xdrs, xdrproc_t func, caddr_t args)
 
static int authnone_unwrap (AUTH *auth, XDR *xdrs, xdrproc_t func, caddr_t args, u_int seq)
 

Variables

static struct authnone_privateauthnone_private
 

Macro Definition Documentation

◆ MAX_MARSHAL_SIZE

#define MAX_MARSHAL_SIZE   20

Definition at line 77 of file auth_none.c.

Function Documentation

◆ authnone_create()

AUTH* authnone_create ( void  )

Definition at line 100 of file auth_none.c.

101 {
103  XDR xdr_stream;
104  XDR *xdrs;
105  extern mutex_t authnone_lock;
106 
108  if (ap == 0) {
109  ap = (struct authnone_private *)calloc(1, sizeof (*ap));
110  if (ap == 0) {
112  return (0);
113  }
115  }
116  if (!ap->mcnt) {
117  ap->no_client.ah_cred = ap->no_client.ah_verf = _null_auth;
118  ap->no_client.ah_ops = authnone_ops();
119  xdrs = &xdr_stream;
120  xdrmem_create(xdrs, ap->marshalled_client,
122  (void)xdr_opaque_auth(xdrs, &ap->no_client.ah_cred);
123  (void)xdr_opaque_auth(xdrs, &ap->no_client.ah_verf);
124  ap->mcnt = XDR_GETPOS(xdrs);
125  XDR_DESTROY(xdrs);
126  }
128  return (&ap->no_client);
129 }
#define MAX_MARSHAL_SIZE
Definition: auth_none.c:77
#define XDR_GETPOS(xdrs)
Definition: xdr.h:199
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
static struct authnone_private * authnone_private
Definition: xdr.h:103
#define mutex_lock(m)
Definition: reentrant.h:128
#define mutex_unlock(m)
Definition: reentrant.h:129
struct opaque_auth _null_auth
static struct auth_ops * authnone_ops()
Definition: auth_none.c:194
mutex_t authnone_lock
Definition: mt_misc.c:44
Definition: xdr.h:85
UINT32 u_int
Definition: types.h:82
void xdrmem_create(XDR *xdrs, char *addr, u_int size, enum xdr_op op)
Definition: xdr_mem.c:94
bool_t xdr_opaque_auth()
#define calloc
Definition: rosglue.h:14
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
Definition: module.h:446
#define XDR_DESTROY(xdrs)
Definition: xdr.h:214

Referenced by clnt_dg_create(), clnt_raw_create(), and clnt_vc_create().

◆ authnone_destroy()

static void authnone_destroy ( AUTH client)
static

Definition at line 177 of file auth_none.c.

178 {
179 }

Referenced by authnone_ops().

◆ authnone_marshal()

static bool_t authnone_marshal ( AUTH client,
XDR xdrs,
u_int seq 
)
static

Definition at line 133 of file auth_none.c.

134 {
135  struct authnone_private *ap;
136  bool_t dummy;
137  extern mutex_t authnone_lock;
138 
139  assert(xdrs != NULL);
140 
142  if (ap == NULL) {
144  return (FALSE);
145  }
146  dummy = (*xdrs->x_ops->x_putbytes)(xdrs,
147  ap->marshalled_client, ap->mcnt);
149  return (dummy);
150 }
int32_t bool_t
Definition: types.h:101
static struct authnone_private * authnone_private
#define assert(x)
Definition: debug.h:53
#define mutex_unlock(m)
Definition: reentrant.h:129
smooth NULL
Definition: ftsmooth.c:416
mutex_t authnone_lock
Definition: mt_misc.c:44
unsigned char dummy
Definition: maze.c:118
const struct __rpc_xdr::xdr_ops * x_ops
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
Definition: module.h:446

Referenced by authnone_ops().

◆ authnone_ops()

static struct auth_ops * authnone_ops ( )
static

Definition at line 194 of file auth_none.c.

195 {
196  static struct auth_ops ops;
197  extern mutex_t ops_lock;
198 
199 /* VARIABLES PROTECTED BY ops_lock: ops */
200 
202  if (ops.ah_nextverf == NULL) {
203  ops.ah_nextverf = authnone_verf;
204  ops.ah_marshal = authnone_marshal;
205  ops.ah_validate = authnone_validate;
206  ops.ah_refresh = authnone_refresh;
207  ops.ah_destroy = authnone_destroy;
208  ops.ah_wrap = authnone_wrap;
209  ops.ah_unwrap = authnone_unwrap;
210  }
212  return (&ops);
213 }
static bool_t authnone_validate(AUTH *, struct opaque_auth *, u_int)
Definition: auth_none.c:161
mutex_t ops_lock
Definition: mt_misc.c:71
static int authnone_wrap(AUTH *auth, XDR *xdrs, xdrproc_t func, caddr_t args)
Definition: auth_none.c:182
static int authnone_unwrap(AUTH *auth, XDR *xdrs, xdrproc_t func, caddr_t args, u_int seq)
Definition: auth_none.c:188
#define mutex_lock(m)
Definition: reentrant.h:128
#define mutex_unlock(m)
Definition: reentrant.h:129
static bool_t authnone_marshal(AUTH *, XDR *, u_int *)
Definition: auth_none.c:133
static void authnone_verf(AUTH *)
Definition: auth_none.c:155
smooth NULL
Definition: ftsmooth.c:416
static bool_t authnone_refresh(AUTH *, void *)
Definition: auth_none.c:169
Definition: module.h:446
static void authnone_destroy(AUTH *)
Definition: auth_none.c:177

Referenced by authnone_create().

◆ authnone_refresh()

static bool_t authnone_refresh ( AUTH client,
void dummy 
)
static

Definition at line 169 of file auth_none.c.

170 {
171 
172  return (FALSE);
173 }

Referenced by authnone_ops().

◆ authnone_unwrap()

static int authnone_unwrap ( AUTH auth,
XDR xdrs,
xdrproc_t  func,
caddr_t  args,
u_int  seq 
)
static

Definition at line 188 of file auth_none.c.

189 {
190  return ((*func)(xdrs, args));
191 }
GLenum func
Definition: glext.h:6028
Definition: match.c:390

Referenced by authnone_ops().

◆ authnone_validate()

static bool_t authnone_validate ( AUTH client,
struct opaque_auth opaque,
u_int  seq 
)
static

Definition at line 161 of file auth_none.c.

162 {
163 
164  return (TRUE);
165 }
#define TRUE
Definition: types.h:120

Referenced by authnone_ops().

◆ authnone_verf()

static void authnone_verf ( AUTH client)
static

Definition at line 155 of file auth_none.c.

156 {
157 }

Referenced by authnone_ops().

◆ authnone_wrap()

static int authnone_wrap ( AUTH auth,
XDR xdrs,
xdrproc_t  func,
caddr_t  args 
)
static

Definition at line 182 of file auth_none.c.

183 {
184  return ((*func)(xdrs, args));
185 }
GLenum func
Definition: glext.h:6028
Definition: match.c:390

Referenced by authnone_ops().

◆ xdr_opaque_auth()

Variable Documentation

◆ authnone_private