|
|
1.1 root 1: /*
2: * $Source: /usr/src/kerberosIV/include/RCS/kadm.h,v $
3: * $Author: kfall $
4: * $Header: /usr/src/kerberosIV/include/RCS/kadm.h,v 4.3 90/06/25 20:49:12 kfall Exp $
5: *
6: * Copyright 1988 by the Massachusetts Institute of Technology.
7: *
8: * For copying and distribution information, please see the file
9: * <mit-copyright.h>.
10: *
11: * Definitions for Kerberos administration server & client
12: */
13:
14: #ifndef KADM_DEFS
15: #define KADM_DEFS
16:
17: #ifdef ATHENA
18: #include <mit-copyright.h>
19: #endif
20:
21: /*
22: * kadm.h
23: * Header file for the fourth attempt at an admin server
24: * Doug Church, December 28, 1989, MIT Project Athena
25: */
26:
27: /* for those broken Unixes without this defined... should be in sys/param.h */
28: #ifndef MAXHOSTNAMELEN
29: #define MAXHOSTNAMELEN 64
30: #endif
31:
32: #include <sys/types.h>
33: #include <netinet/in.h>
34:
35: #ifdef ATHENA
36: #include <krb.h>
37: #include <des.h>
38: #endif
39:
40: /* The global structures for the client and server */
41: typedef struct {
42: struct sockaddr_in admin_addr;
43: struct sockaddr_in my_addr;
44: int my_addr_len;
45: int admin_fd; /* file descriptor for link to admin server */
46: char sname[ANAME_SZ]; /* the service name */
47: char sinst[INST_SZ]; /* the services instance */
48: char krbrlm[REALM_SZ];
49: } Kadm_Client;
50:
51: typedef struct { /* status of the server, i.e the parameters */
52: int inter; /* Space for command line flags */
53: char *sysfile; /* filename of server */
54: } admin_params; /* Well... it's the admin's parameters */
55:
56: /* Largest password length to be supported */
57: #define MAX_KPW_LEN 128
58:
59: /* Largest packet the admin server will ever allow itself to return */
60: #define KADM_RET_MAX 2048
61:
62: /* That's right, versions are 8 byte strings */
63: #define KADM_VERSTR "KADM0.0A"
64: #define KADM_ULOSE "KYOULOSE" /* sent back when server can't
65: decrypt client's msg */
66: #define KADM_VERSIZE strlen(KADM_VERSTR)
67:
68: /* the lookups for the server instances */
69: #define PWSERV_NAME "changepw"
70: #define KADM_SNAME "kerberos_master"
71: #define KADM_SINST "kerberos"
72:
73: /* Attributes fields constants and macros */
74: #define ALLOC 2
75: #define RESERVED 3
76: #define DEALLOC 4
77: #define DEACTIVATED 5
78: #define ACTIVE 6
79:
80: /* Kadm_vals structure for passing db fields into the server routines */
81: #define FLDSZ 4
82:
83: typedef struct {
84: u_char fields[FLDSZ]; /* The active fields in this struct */
85: char name[ANAME_SZ];
86: char instance[INST_SZ];
87: unsigned long key_low;
88: unsigned long key_high;
89: unsigned long exp_date;
90: unsigned short attributes;
91: unsigned char max_life;
92: } Kadm_vals; /* The basic values structure in Kadm */
93:
94: /* Kadm_vals structure for passing db fields into the server routines */
95: #define FLDSZ 4
96:
97: /* Need to define fields types here */
98: #define KADM_NAME 31
99: #define KADM_INST 30
100: #define KADM_EXPDATE 29
101: #define KADM_ATTR 28
102: #define KADM_MAXLIFE 27
103: #define KADM_DESKEY 26
104:
105: /* To set a field entry f in a fields structure d */
106: #define SET_FIELD(f,d) (d[3-(f/8)]|=(1<<(f%8)))
107:
108: /* To set a field entry f in a fields structure d */
109: #define CLEAR_FIELD(f,d) (d[3-(f/8)]&=(~(1<<(f%8))))
110:
111: /* Is field f in fields structure d */
112: #define IS_FIELD(f,d) (d[3-(f/8)]&(1<<(f%8)))
113:
114: /* Various return codes */
115: #define KADM_SUCCESS 0
116:
117: #define WILDCARD_STR "*"
118:
119: enum acl_types {
120: ADDACL,
121: GETACL,
122: MODACL
123: };
124:
125: /* Various opcodes for the admin server's functions */
126: #define CHANGE_PW 2
127: #define ADD_ENT 3
128: #define MOD_ENT 4
129: #define GET_ENT 5
130:
131: extern long kdb_get_master_key(); /* XXX should be in krb_db.h */
132: extern long kdb_verify_master_key(); /* XXX ditto */
133:
134: extern long krb_mk_priv(), krb_rd_priv(); /* XXX should be in krb.h */
135: extern void krb_set_tkt_string(); /* XXX ditto */
136:
137: extern unsigned long quad_cksum(); /* XXX should be in des.h */
138:
139: /* XXX This doesn't belong here!!! */
140: char *malloc(), *realloc();
141: #ifdef POSIX
142: typedef void sigtype;
143: #else
144: typedef int sigtype;
145: #endif
146:
147: #endif KADM_DEFS
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.