Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / programs / dtlogin / apollo / passwd.h
1 /* $XConsortium: passwd.h /main/3 1995/10/27 16:19:23 rswiston $ */
2 /*                                                                      *
3  * (c) Copyright 1993, 1994 Hewlett-Packard Company                     *
4  * (c) Copyright 1993, 1994 International Business Machines Corp.       *
5  * (c) Copyright 1993, 1994 Sun Microsystems, Inc.                      *
6  * (c) Copyright 1993, 1994 Novell, Inc.                                *
7  */
8 /* passwd.h us/unix/include/apollo/sys, brian
9    Password definitions
10
11
12      --------------------------------------------------------------------------
13     |   THE FOLLOWING PROGRAMS ARE THE SOLE PROPERTY OF APOLLO COMPUTER INC.   |
14     |         AND CONTAIN ITS PROPRIETARY AND CONFIDENTIAL INFORMATION.        |
15      --------------------------------------------------------------------------
16
17 Changes:
18     12/27/88    gilbert Modifications for C++.
19     03/25/88    brian   ANSI version (from .ins.c)
20     11/05/87    betsy   need to include des.ins.c 
21     08/31/87    betsy   add support for unix encryption, remove passwd_$create
22                           for sr10 registry
23     07/07/87    pato    drop the (wrong) explicit values for passwd_$encrypt_t
24     04/02/86    lwa     Change enum to short enum.
25     01/13/86    nazgul  Created C version
26     04/05/82    PJL     changes for DES encryption
27 */
28
29 #ifndef apollo_sys_passwd_ins_c
30 #define apollo_sys_passwd_ins_c
31
32
33 /*  Enable function prototypes for ANSI C and C++  */
34 #if defined(__STDC__) || defined(c_plusplus) || defined(__cplusplus)
35 #    define _PROTOTYPES
36 #endif
37
38 /*  Required for C++ V2.0  */
39 #ifdef  __cplusplus
40     extern "C" {
41 #endif
42
43 #ifdef _PROTOTYPES
44 #define std_$call       extern
45 #endif
46
47 #include "apollo/des.h"         /* copy from <apollo/sys/des.h>  */
48
49 #define  passwd_$mod     3
50 #define  passwd_$maxlen 8
51
52 typedef  short  enum { passwd_$none, passwd_$des,
53                        passwd_$unix, passwd_$unix_bits }   passwd_$encrypt_t;
54 typedef  struct {
55     passwd_$encrypt_t  ptype;
56     union {
57         char  plain[8];                 /* passwd_$none */
58         struct {                        /* passwd_$des, passwd_$unix_bits   */
59             short       rand;
60             des_$text   bits;
61         } des; 
62         struct {                        /* passwd_$unix */
63             char        salt[2];
64             char        cipher[12]; 
65         } unix_encrypted;
66     } pw_union;
67 } passwd_$rec_t;
68
69 typedef  char  passwd_$str_t[passwd_$maxlen];            
70
71 std_$call boolean   passwd_$check(
72 #ifdef _PROTOTYPES
73                 passwd_$str_t           & pass_str,
74                 short                   & pass_len,
75                 passwd_$rec_t           & enc_passwd,
76                 status_$t               * status
77 #endif
78 );
79
80 #ifdef  __cplusplus
81     }
82 #endif
83
84 #endif