]>
Commit | Line | Data |
---|---|---|
eab30d01 | 1 | /* |
2 | * $Source$ | |
3 | * $Author$ | |
4 | * $Header$ | |
5 | * | |
6 | * Copyright (C) 1987 by the Massachusetts Institute of Technology | |
7 | * | |
8 | * $Log$ | |
90052a6f | 9 | * Revision 1.8 1988-01-14 13:12:06 mar |
10 | * added definition of ARGLEN | |
eab30d01 | 11 | * |
90052a6f | 12 | * Revision 1.7 87/07/29 16:03:30 wesommer |
13 | * Added last_time_used field to client structure. | |
14 | * | |
50f51267 | 15 | * Revision 1.6 87/07/14 00:36:40 wesommer |
16 | * Added debugging options. | |
17 | * | |
16904979 | 18 | * Revision 1.5 87/06/30 20:05:14 wesommer |
19 | * Added parsed kerberos principal name. | |
20 | * | |
0311b667 | 21 | * Revision 1.4 87/06/21 16:42:07 wesommer |
22 | * Performance work, rearrangement of include files. | |
23 | * | |
c27b3454 | 24 | * Revision 1.3 87/06/03 16:07:59 wesommer |
25 | * Fixes for lint. | |
26 | * | |
5dbd09a0 | 27 | * Revision 1.2 87/06/01 03:35:10 wesommer |
28 | * added stuff for authentication. | |
29 | * | |
eab30d01 | 30 | */ |
31 | ||
5dbd09a0 | 32 | #include <sys/types.h> |
33 | #include <sys/uio.h> | |
34 | #include <sys/socket.h> | |
35 | #include <netinet/in.h> | |
c27b3454 | 36 | #include "sms_proto.h" |
0311b667 | 37 | #include <krb.h> |
5dbd09a0 | 38 | |
c27b3454 | 39 | typedef struct returned_tuples { |
40 | struct returned_tuples *next; | |
41 | OPERATION op; | |
0311b667 | 42 | sms_params *retval; |
c27b3454 | 43 | } returned_tuples; |
5dbd09a0 | 44 | |
0311b667 | 45 | /* |
46 | * This should be in the kerberos header file. | |
47 | */ | |
48 | ||
49 | struct krbname { | |
50 | char name[ANAME_SZ]; | |
51 | char inst[INST_SZ]; | |
52 | char realm[REALM_SZ]; | |
53 | }; | |
54 | ||
55 | /* | |
56 | * This structure holds all per-client information; one of these is | |
57 | * allocated for each active client. | |
58 | */ | |
59 | ||
0fa91a0a | 60 | typedef struct _client { |
0311b667 | 61 | OPERATION pending_op; /* Primary pending operation */ |
62 | CONNECTION con; /* Connection to the client */ | |
63 | int state; /* XXX this is really superfluous and should */ | |
64 | /* be removed */ | |
65 | int action; /* what action is pending? */ | |
eab30d01 | 66 | sms_params *args, reply; |
67 | int id; /* Unique id of client */ | |
0311b667 | 68 | struct sockaddr_in haddr; /* IP address of client */ |
69 | char *clname; /* Name client authenticated to */ | |
70 | struct krbname kname; /* Parsed version of the above */ | |
c27b3454 | 71 | returned_tuples *first, *last; |
50f51267 | 72 | time_t last_time_used; /* Last time connection used */ |
0fa91a0a | 73 | } client; |
74 | ||
75 | /* | |
76 | * States | |
77 | */ | |
78 | ||
79 | #define CL_DEAD 0 | |
80 | #define CL_STARTING 1 | |
81 | ||
82 | /* | |
83 | * Actions. | |
84 | */ | |
85 | ||
86 | #define CL_ACCEPT 0 | |
87 | #define CL_RECEIVE 1 | |
88 | #define CL_SEND 2 | |
89 | ||
0311b667 | 90 | extern char *krb_realm; |
16904979 | 91 | |
92 | /* | |
93 | * Debugging options. | |
94 | */ | |
95 | ||
96 | extern int log_flags; | |
97 | ||
98 | #define LOG_CONNECT 0x0001 | |
99 | #define LOG_REQUESTS 0x0002 | |
100 | #define LOG_ARGS 0x0004 | |
101 | #define LOG_RESP 0x0008 | |
102 | #define LOG_RES 0x0010 | |
103 | ||
90052a6f | 104 | |
105 | /* max length of query argument allowed */ | |
106 | #define ARGLEN 128 |