]> andersk Git - moira.git/blob - server/mr_server.h
sync'ing files for RCS->CVS migration
[moira.git] / server / mr_server.h
1 /*
2  *      $Source$
3  *      $Author$
4  *      $Header$
5  *
6  *      Copyright (C) 1987 by the Massachusetts Institute of Technology
7  *
8  */
9
10 #include <sys/types.h>
11 #include <sys/uio.h>
12 #include <sys/socket.h>
13 #include <netinet/in.h>
14 #include "mr_proto.h"
15 #include <moira_site.h>
16 #include <krb.h>
17 #include "malloc.h"
18
19 typedef struct returned_tuples {
20         struct returned_tuples *next;
21         OPERATION op;
22         mr_params *retval;
23 } returned_tuples;
24
25 /*
26  * This should be in the kerberos header file.
27  */
28
29 struct krbname {
30         char name[ANAME_SZ];
31         char inst[INST_SZ];
32         char realm[REALM_SZ];
33 };
34
35 /*
36  * This structure holds all per-client information; one of these is
37  * allocated for each active client.
38  */
39
40 typedef struct _client {
41         OPERATION pending_op;   /* Primary pending operation */
42         CONNECTION con;         /* Connection to the client */
43         int action;             /* what action is pending? */
44         mr_params *args, reply;
45         int id;                 /* Unique id of client */
46         struct sockaddr_in haddr; /* IP address of client */
47         char clname[MAX_K_NAME_SZ];/* Name client authenticated to */
48         struct krbname kname;   /* Parsed version of the above */
49         int users_id;           /* MR internal ID of authenticated user */
50         int client_id;          /* MR internal ID of client for modby field */
51         returned_tuples *first, *last;
52         time_t last_time_used;  /* Last time connection used */
53         char entity[9];         /* entity on other end of the connection */
54 } client;
55
56 /*
57  * States
58  */
59
60 #define CL_DEAD 0
61 #define CL_STARTING 1
62
63 /*
64  * Actions.
65  */
66
67 #define CL_ACCEPT 0
68 #define CL_RECEIVE 1
69 #define CL_SEND 2
70
71 extern char *krb_realm;
72
73 /*
74  * Debugging options.
75  */
76
77 extern int log_flags;
78
79 #define LOG_CONNECT             0x0001
80 #define LOG_REQUESTS            0x0002
81 #define LOG_ARGS                0x0004
82 #define LOG_RESP                0x0008
83 #define LOG_RES                 0x0010
84 #define LOG_VALID               0x0020
85 #define LOG_SQL                 0x0040
86 #define LOG_GDSS                0x0080
87
88
89 /* max length of query argument allowed */
90 #define ARGLEN  257
91 /* Used to setup static argv, maximum argc */
92 #define QMAXARGS        22
93
94 /* statistics on number of queries by version number */
95 extern int newqueries, oldqueries;
96
97 /* Maximum and minimum values that will ever be chosen for IDs */
98 #define MAX_ID_VALUE    31999
99 #define MIN_ID_VALUE    100
100
101 /* Sleepy states for the server! */
102 #define AWAKE 0
103 #define SLEEPY 1
104 #define ASLEEP 2
105 #define GROGGY 3
106 extern int dormant;
107
108 /* state for the incremental update system */
109 extern int inc_running, inc_pid;
110 extern time_t inc_started, now;
111 #define INC_TIMEOUT (3 * 60)    /* 3 minutes */
This page took 0.043758 seconds and 5 git commands to generate.