1: /*
   2:  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
   3:  * unrestricted use provided that this legend is included on all tape
   4:  * media and as a part of the software program in whole or part.  Users
   5:  * may copy or modify Sun RPC without charge, but are not authorized
   6:  * to license or distribute it to anyone else except as part of a product or
   7:  * program developed by the user.
   8:  *
   9:  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  10:  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  11:  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  12:  *
  13:  * Sun RPC is provided with no support and without any obligation on the
  14:  * part of Sun Microsystems, Inc. to assist in its use, correction,
  15:  * modification or enhancement.
  16:  *
  17:  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  18:  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  19:  * OR ANY PART THEREOF.
  20:  *
  21:  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  22:  * or profits or other special, indirect and consequential damages, even if
  23:  * Sun has been advised of the possibility of such damages.
  24:  *
  25:  * Sun Microsystems, Inc.
  26:  * 2550 Garcia Avenue
  27:  * Mountain View, California  94043
  28:  */
  29: #ifndef lint
  30: static char sccsid[] = "@(#)auth_none.c 1.4 85/03/17 Copyr 1984 Sun Micro";
  31: #endif
  32: 
  33: /*
  34:  * auth_none.c
  35:  * Creates a client authentication handle for passing "null"
  36:  * credentials and verifiers to remote systems.
  37:  *
  38:  * Copyright (C) 1984, Sun Microsystems, Inc.
  39:  */
  40: 
  41: #include "types.h"
  42: #include "xdr.h"
  43: #include "auth.h"
  44: #define NULL ((caddr_t)0)
  45: #define MAX_MARSHEL_SIZE 20
  46: 
  47: /*
  48:  * Authenticator operations routines
  49:  */
  50: static void authnone_verf();
  51: static void authnone_destroy();
  52: static bool_t   authnone_marshal();
  53: static bool_t   authnone_validate();
  54: static bool_t   authnone_refresh();
  55: 
  56: static struct auth_ops ops = {
  57:     authnone_verf,
  58:     authnone_marshal,
  59:     authnone_validate,
  60:     authnone_refresh,
  61:     authnone_destroy
  62: };
  63: 
  64: static AUTH no_client;
  65: static char marshalled_client[MAX_MARSHEL_SIZE];
  66: static u_int    mcnt = 0;
  67: 
  68: AUTH *
  69: authnone_create()
  70: {
  71:     XDR xdr_stream;
  72:     register XDR *xdrs;
  73: 
  74:     if (! mcnt) {
  75:         no_client.ah_cred = no_client.ah_verf = _null_auth;
  76:         no_client.ah_ops = &ops;
  77:         xdrs = &xdr_stream;
  78:         xdrmem_create(xdrs, marshalled_client, (u_int)MAX_MARSHEL_SIZE,
  79:             XDR_ENCODE);
  80:         if ((! xdr_opaque_auth(xdrs, &no_client.ah_cred)) ||
  81:             (! xdr_opaque_auth(xdrs, &no_client.ah_verf))) {
  82:         } else {
  83:             mcnt = XDR_GETPOS(xdrs);
  84:         }
  85:         XDR_DESTROY(xdrs);
  86:     }
  87:     return (&no_client);
  88: }
  89: 
  90: static bool_t
  91: /* ARGSUSED */
  92: authnone_marshal(client, xdrs)
  93:     AUTH *client;
  94:     XDR *xdrs;
  95: {
  96: 
  97:     return ((*xdrs->x_ops->x_putbytes)(xdrs, marshalled_client, mcnt));
  98: }
  99: 
 100: static void
 101: authnone_verf()
 102: {
 103: }
 104: 
 105: static bool_t
 106: authnone_validate()
 107: {
 108: 
 109:     return (TRUE);
 110: }
 111: 
 112: static bool_t
 113: authnone_refresh()
 114: {
 115: 
 116:     return (FALSE);
 117: }
 118: 
 119: static void
 120: authnone_destroy()
 121: {
 122: }

Defined functions

authnone_destroy defined in line 119; used 2 times
authnone_marshal defined in line 90; used 2 times
authnone_refresh defined in line 112; used 2 times
authnone_validate defined in line 105; used 2 times
authnone_verf defined in line 100; used 2 times

Defined variables

bool_t defined in line 112; never used
marshalled_client defined in line 65; used 2 times
ops defined in line 56; used 1 times
  • in line 76
sccsid defined in line 30; never used

Defined macros

MAX_MARSHEL_SIZE defined in line 45; used 2 times
NULL defined in line 44; never used
Last modified: 1985-04-19
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1134
Valid CSS Valid XHTML 1.0 Strict