source: rtems/c/src/librpc/include/rpc/auth.h @ 48bfd992

4.104.114.84.95
Last change on this file since 48bfd992 was 4721cf1, checked in by Joel Sherrill <joel.sherrill@…>, on 12/03/98 at 23:54:14

Patch from Emmanuel Raguet <raguet@…> to add remote debug server
and RPC support to RTEMS. Thanks. :) Email follows:

Hello,

For Xmas, here is the Remote Debugger on RTEMS !

Here are 2 patches for the Remote Debugger on RTEMS for pc386 from Linux
host :

  • one for RTEMS it self,
  • one for GDB-4.17.

1/ RTEMS patch
--------------

This patch adds 2 libraries :

  • a simplified SUN RPC library
  • the Remote Debugger library

The configuration command is the following :
../rtems4/configure --target=i386-rtemself --enable-rtemsbsp=pc386
--enable-rdbg

The SUN RPC library is built only if networking is set.
The RDBG library is built if networking and enable-rdbg are set.

The function used to initialize the debugger is :

rtems_rdbg_initialize ();

A special function has been created to force a task to be
in a "debug" state : enterRdbg().
The use of this function is not mandatory.

2/ GDB-4.17 patch
-----------------

This patch create a new RTEMS target for GDB-4.17.

The configuration command is the following :
./configure --enable-shared --target=i386RTEMS

To connect to a target, use :

target rtems [your_site_address]

Then, attach the target using : attach 1

And... Debug ;)

You can obtain the original GDB-4.17 on
ftp://ftp.debian.org/debian/dists/stable/main/source/devel/gdb_4.17.orig.tar.gz

This has been tested from a Debian 2.0.1 linux host.

  • Property mode set to 100644
File size: 4.7 KB
Line 
1#ifndef RPC_AUTH_H
2#define RPC_AUTH_H
3
4/* @(#)auth.h   2.3 88/08/07 4.0 RPCSRC; from 1.17 88/02/08 SMI */
5/*
6 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
7 * unrestricted use provided that this legend is included on all tape
8 * media and as a part of the software program in whole or part.  Users
9 * may copy or modify Sun RPC without charge, but are not authorized
10 * to license or distribute it to anyone else except as part of a product or
11 * program developed by the user.
12 *
13 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
14 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
15 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
16 *
17 * Sun RPC is provided with no support and without any obligation on the
18 * part of Sun Microsystems, Inc. to assist in its use, correction,
19 * modification or enhancement.
20 *
21 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
22 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
23 * OR ANY PART THEREOF.
24 *
25 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
26 * or profits or other special, indirect and consequential damages, even if
27 * Sun has been advised of the possibility of such damages.
28 *
29 * Sun Microsystems, Inc.
30 * 2550 Garcia Avenue
31 * Mountain View, California  94043
32 */
33
34/*
35 * auth.h, Authentication interface.
36 *
37 * Copyright (C) 1984, Sun Microsystems, Inc.
38 *
39 * The data structures are completely opaque to the client.  The client
40 * is required to pass a AUTH * to routines that create rpc
41 * "sessions".
42 */
43
44
45#define MAX_AUTH_BYTES  400
46#define MAXNETNAMELEN   255     /* maximum length of network user's name */
47
48/*
49 * Status returned from authentication check
50 */
51enum auth_stat {
52        AUTH_OK=0,
53        /*
54         * failed at remote end
55         */
56        AUTH_BADCRED=1,                 /* bogus credentials (seal broken) */
57        AUTH_REJECTEDCRED=2,            /* client should begin new session */
58        AUTH_BADVERF=3,                 /* bogus verifier (seal broken) */
59        AUTH_REJECTEDVERF=4,            /* verifier expired or was replayed */
60        AUTH_TOOWEAK=5,                 /* rejected due to security reasons */
61        /*
62         * failed locally
63        */
64        AUTH_INVALIDRESP=6,             /* bogus response verifier */
65        AUTH_FAILED=7                   /* some unknown reason */
66};
67
68union des_block {
69        struct {
70                u_int32 high;
71                u_int32 low;
72        } key;
73        char c[8];
74};
75typedef union des_block des_block;
76extern bool_t xdr_des_block();
77
78/*
79 * Authentication info.  Opaque to client.
80 */
81struct opaque_auth {
82        enum_t  oa_flavor;              /* flavor of auth */
83        caddr_t oa_base;                /* address of more auth stuff */
84        u_int   oa_length;              /* not to exceed MAX_AUTH_BYTES */
85};
86
87
88/*
89 * Auth handle, interface to client side authenticators.
90 */
91typedef struct {
92        struct  opaque_auth     ah_cred;
93        struct  opaque_auth     ah_verf;
94        union   des_block       ah_key;
95        struct auth_ops {
96                void    (*ah_nextverf)();
97                int     (*ah_marshal)();        /* nextverf & serialize */
98                int     (*ah_validate)();       /* validate varifier */
99                int     (*ah_refresh)();        /* refresh credentials */
100                void    (*ah_destroy)();        /* destroy this structure */
101        } *ah_ops;
102        caddr_t ah_private;
103} AUTH;
104
105
106/*
107 * Authentication ops.
108 * The ops and the auth handle provide the interface to the authenticators.
109 *
110 * AUTH *auth;
111 * XDR  *xdrs;
112 * struct opaque_auth verf;
113 */
114#define AUTH_NEXTVERF(auth)             \
115                ((*((auth)->ah_ops->ah_nextverf))(auth))
116#define auth_nextverf(auth)             \
117                ((*((auth)->ah_ops->ah_nextverf))(auth))
118
119#define AUTH_MARSHALL(auth, xdrs)       \
120                ((*((auth)->ah_ops->ah_marshal))(auth, xdrs))
121#define auth_marshall(auth, xdrs)       \
122                ((*((auth)->ah_ops->ah_marshal))(auth, xdrs))
123
124#define AUTH_VALIDATE(auth, verfp)      \
125                ((*((auth)->ah_ops->ah_validate))((auth), verfp))
126#define auth_validate(auth, verfp)      \
127                ((*((auth)->ah_ops->ah_validate))((auth), verfp))
128
129#define AUTH_REFRESH(auth)              \
130                ((*((auth)->ah_ops->ah_refresh))(auth))
131#define auth_refresh(auth)              \
132                ((*((auth)->ah_ops->ah_refresh))(auth))
133
134#define AUTH_DESTROY(auth)              \
135                ((*((auth)->ah_ops->ah_destroy))(auth))
136#define auth_destroy(auth)              \
137                ((*((auth)->ah_ops->ah_destroy))(auth))
138
139
140extern struct opaque_auth _null_auth;
141
142
143/*
144 * These are the various implementations of client side authenticators.
145 */
146
147/*
148 * Unix style authentication
149 * AUTH *authunix_create(machname, uid, gid, len, aup_gids)
150 *      char *machname;
151 *      int uid;
152 *      int gid;
153 *      int len;
154 *      int *aup_gids;
155 */
156extern AUTH *authunix_create();
157extern AUTH *authunix_create_default(); /* takes no parameters */
158extern AUTH *authnone_create();         /* takes no parameters */
159extern AUTH *authdes_create();
160
161#define AUTH_NONE       0               /* no authentication */
162#define AUTH_NULL       0               /* backward compatibility */
163#define AUTH_UNIX       1               /* unix style (uid, gids) */
164#define AUTH_SHORT      2               /* short hand unix style */
165#define AUTH_DES        3               /* des style (encrypted timestamps) */
166
167#endif /* RPC_AUTH_H */
Note: See TracBrowser for help on using the repository browser.