]> git.sur5r.net Git - openldap/blob - contrib/tweb/init.h
Update man page date.
[openldap] / contrib / tweb / init.h
1 /*_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
2 *                                                                          *
3 * init.h.....                                                              *
4 *                                                                          *
5 * Function:..File for TWEB-SOFTWARE                                        *
6 *                                                                          *
7 *                                                                          *
8 *                                                                          *
9 * Authors:...Dr. Kurt Spanier & Bernhard Winkler,                          *
10 *            Zentrum fuer Datenverarbeitung, Bereich Entwicklung           *
11 *            neuer Dienste, Universitaet Tuebingen, GERMANY                *
12 *                                                                          *
13 *                                       ZZZZZ  DDD    V   V                *
14 *            Creation date:                Z   D  D   V   V                *
15 *            July 21 1995                 Z    D   D   V V                 *
16 *            Last modification:          Z     D  D    V V                 *
17 *            May 14 1999                ZZZZ   DDD      V                  *
18 *                                                                          *
19 _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_*/
20
21 /*
22  * $Id: init.h,v 1.6 1999/09/10 15:01:17 zrnsk01 Exp $
23  *
24  */
25
26 #ifndef _INIT_
27 #define _INIT_
28
29 #include <getopt.h>
30 #include "strng_exp.h"
31 #include "init_exp.h"
32 #include "charray_exp.h"
33 #include "ch_malloc_exp.h"
34 #include "support_exp.h"
35
36 #ifdef TUE_TEL
37 #  include "tueTel_exp.h"
38 #endif
39
40 #ifdef AMBIXGW
41 #  include "ambix_exp.h"
42 #endif
43
44
45 /* Usage-Text */
46 #define USAGE "\nUSAGE: %s -Lx[yz..] [-p webport] [-x ldaphost]\
47          \n\t\t[-P ldapport] [-b basedn] [-f filterfile] [-l logger] [-d]\n\
48     \n\
49     A short description of TWEB WWW2X.500-Gateway: \n\n\
50     (does not compensate reading the README files\n\
51     and the correct configuration)\n\
52     \n\
53     Options:\n\n\
54     -L:\ttells TWEB the numbers of the languages that have to be started,\n\
55     \twherewith are also created the language-buttons\n\
56     \tExample: tweb -L01 starts TWEB in german und english\n\
57     -p:\tnames the port on which the gateway is to be reached\n\
58     -x:\tnames the LDAP-Hosts\n\
59     -P:\tnames the port of the LDAP-Server\n\
60     -b:\tnames the DN where the gateway shall start by default\n\
61     -f:\tnames the ldapfilter-file\n\
62     -l:\tswitches on logging for example LOCAL3\n\
63     -d:\tswitches on debugging (no sub-processes!)\n\
64     \n"
65
66
67 /* Funktions in the init-module */
68 PRIVATE int webdn();
69 PRIVATE int webpw();
70 PRIVATE int webdn2();
71 PRIVATE int webpw2();
72 PRIVATE int webport();
73 PRIVATE int timeout();
74 PRIVATE int ldapd();
75 PRIVATE int ldapportf();
76 PRIVATE int hostname();
77 PRIVATE int header();
78 PRIVATE int footer();
79 PRIVATE int index_url();
80 PRIVATE int allow_msg();
81 PRIVATE int helpfilef();
82 PRIVATE int filterfilef();
83 PRIVATE int etcdir();
84 PRIVATE int friendlyfilef();
85 PRIVATE int grant();
86 PRIVATE int refuse();
87 PRIVATE int allow_string();
88 PRIVATE int allow_proxy();
89 PRIVATE int subtree_search();
90 PRIVATE int deny_string();
91 PRIVATE int show_defoc();
92 PRIVATE int display();
93 PRIVATE int basednf();
94 PRIVATE int search_only();
95 PRIVATE int gw_switch();
96 PRIVATE int modify();
97 PRIVATE int ind_attrs();
98 PRIVATE int ind_attribute();
99 PRIVATE int maxcount();
100 PRIVATE int cache_expire();
101 PRIVATE int max_person();
102 PRIVATE int caching_terms();
103 PRIVATE int comrefuse();
104 PRIVATE int language();
105 PRIVATE void f_test();
106 PRIVATE void main_loop();
107 PRIVATE int strip_pin();
108 PRIVATE int prefer_ref_uris();
109 PRIVATE int pull_down_menus();
110 PRIVATE int no_proxy();
111 PRIVATE int disp_sea_rdn();
112 PRIVATE int strict_basedn();
113 PRIVATE int dynamic_gw();
114 PRIVATE int legal();
115 PRIVATE int no_show_rdn();
116 PRIVATE int no_modify();
117 PRIVATE int sort();
118 PRIVATE int firstPage();
119 PRIVATE int secondPage();
120 PRIVATE int modattr();
121 PRIVATE void usage();
122 PRIVATE int parse();
123 PRIVATE int parse2();
124 PRIVATE int table_disp();
125 PRIVATE int form_button();
126 PRIVATE int ip_refuse();
127
128
129 /* Sub-tables to analyse the DISPLAY-Keys */
130 static PARSE_ENTRY first_table[] = {
131     {"SECOND-PAGE",        secondPage,        NULL},
132     { NULL, NULL, NULL }
133 };
134
135 static PARSE_ENTRY display_table[] = {
136     {"FIRST-PAGE",         firstPage,        first_table},
137     { NULL, NULL, NULL }
138 };
139
140
141 /* Sub-tables to analyse the MODIFY-Keys */
142 static PARSE_ENTRY modify_table[] = {
143     {"MODATTR",            modattr,          NULL},
144     { NULL, NULL, NULL }
145 };
146
147 /* Sub-tables to analyse the IND_ATTRS-Keys */
148 static PARSE_ENTRY ind_attrs_table[] = {
149     {"IND_ATTRS",            ind_attribute,          NULL},
150     { NULL, NULL, NULL }
151 };
152
153
154 /* The main-table for key-word-parsing */
155 static PARSE_ENTRY parse_table[] = {
156     {"WEBDN",              webdn,            NULL},
157     {"WEBPW",              webpw,            NULL},
158     {"WEBDN2",             webdn2,           NULL},
159     {"WEBPW2",             webpw2,           NULL},
160     {"WEBPORT",            webport,          NULL},
161     {"TIMEOUT",            timeout,          NULL},
162     {"TWEBHOST",           hostname,         NULL},
163     {"LDAPD",              ldapd,            NULL},
164     {"LDAPPORT",           ldapportf,        NULL},
165     {"HEADER",             header,           NULL},
166     {"FOOTER",             footer,           NULL},
167     {"INDEX-URL",          index_url,        NULL},
168     {"ALLOW-MSG",          allow_msg,        NULL},
169     {"HELPFILE",           helpfilef,        NULL},
170     {"FILTERFILE",         filterfilef,      NULL},
171     {"ETCDIR",             etcdir,           NULL},
172     {"FRIENDLYFILE",       friendlyfilef,    NULL},
173     {"GRANT",              grant,            NULL},
174     {"REFUSE",             refuse,           NULL},
175     {"ALLOW-STRING",       allow_string,     NULL},
176     {"ALLOW-PROXY",        allow_proxy,      NULL},
177     {"SUBTREE-SEARCH",     subtree_search,   NULL},
178     {"DENY-STRING",        deny_string,      NULL},
179     {"SHOW-DEFAULT-OC",    show_defoc,       NULL},
180     {"DISPLAY-OBJECT" ,    display,          display_table},
181     {"BASEDN",             basednf,          NULL},
182     {"SEARCH-ONLY",        search_only,      NULL},
183     {"GW-SWITCH",          gw_switch,        NULL},
184     {"MODIFY",             modify,           modify_table},
185     {"INDIRECT-ATTRS",     ind_attrs,        ind_attrs_table},
186     {"MAXCOUNT",           maxcount,         NULL},
187     {"CACHE-EXPIRE-DEFAULT", cache_expire,   NULL},
188     {"MAX-PERSON",         max_person,       NULL},
189     {"CACHING-TERMS",      caching_terms,    NULL},
190     {"COMREFUSE",          comrefuse,        NULL},
191     {"LANGUAGE",           language,         NULL},
192     {"STRIP-PIN",          strip_pin,        NULL},
193     {"PREFER-REF-URIS",    prefer_ref_uris,  NULL},
194     {"PULL-DOWN-MENUS",    pull_down_menus,  NULL},
195     {"NO-PROXY",           no_proxy,         NULL},
196     {"DISP-SEA-RDN",       disp_sea_rdn,     NULL},
197     {"STRICT-BASEDN",      strict_basedn,    NULL},
198     {"DYNAMIC-GW",         dynamic_gw,       NULL},
199     {"LEGAL",              legal,            NULL},
200     {"NO-SHOW-RDN",        no_show_rdn,      NULL},
201     {"NO-MODIFY",          no_modify,        NULL},
202     {"SORT",               sort,             NULL},
203     {"TABLES",             table_disp,       NULL},
204     {"FORM-BUTTON",        form_button,      NULL},
205
206 #ifdef AMBIXGW
207     {"SELBSTEINTRAG",      selbsteintrag,    NULL},
208 #endif
209
210 #ifdef TUE_TEL
211     {"DIT-CONFIG",         dit_config,       NULL},
212     {"PHONEWORLD",         phoneworld,       NULL},
213     {"TON-URLS",           ton_urls,         NULL},
214 #endif
215     {"IP-REFUSE",          ip_refuse,        NULL},
216
217     { NULL, NULL, NULL }
218 };
219
220
221 /* tables to compute DISPLAY-types to integer */
222 STRDISP  disp_types[] = {
223
224     { "DEFAULT",         3, 0 },
225     { "MAILTO",          4, 6 },
226     { "MULTILINE",       5, 1 },
227     { "JPEG",            4, 9 },
228     { "JPEG2GIF",        8, 10 },
229     { "BMP",             3, 8 },
230     { "HREF",            4, 2 },
231     { "URL",             3, 5 },
232     { "FINGER",          6, 3 },
233     { "DATE",            4, 4 },
234     { "MOVETO",          4, 7 },
235     { "BOOLEAN",         9, 11 },
236     { "URI",             3, 12 },
237     { "PGPKEY",          6, 13 },
238     { "INDEXURL",        8, 14 },
239     { "DYNAMICDN",       9, 15 },
240     { "REFERRAL",        8, 20 },
241     { "PRE",             3, 21 },
242     { "HEADER",          6, 22 },
243
244 #ifdef TUE_TEL
245     { "PHONREFSHORT",   12, 16 },
246     { "PHONREFLONG",    11, 17 },
247     { "TFUNCPERS",       9, 18 },
248     { "FAXTABLE",        8, 19 },
249 #endif
250
251     { NULL, 0, 0 }
252
253 };
254
255 /* tables to compute syslog-options to integer */
256 static STRDISP  syslog_types[] = {
257
258     { "LOCAL0",         6, LOG_LOCAL0 },
259     { "LOCAL1",         6, LOG_LOCAL1 },
260     { "LOCAL2",         6, LOG_LOCAL2 },
261     { "LOCAL3",         6, LOG_LOCAL3 },
262     { "LOCAL4",         6, LOG_LOCAL4 },
263     { "LOCAL5",         6, LOG_LOCAL5 },
264     { "LOCAL6",         6, LOG_LOCAL6 },
265     { "LOCAL7",         6, LOG_LOCAL7 },
266     { NULL, 0, 0 }
267
268 };
269
270
271 /* Defaults */
272 #define  DEFAULT_TIMEOUT   120
273 #define  DEFAULT_MAXCOUNT  200
274 #define  MAX_EXPIRE        604800
275
276
277 /*  Variable for the Anti-Hack-Code */
278 extern COMREFUSE  *comRefuseP;
279
280 struct timeval timestore[5];    /* Time assigned to events:
281                                     0 -> after accept, 1-> after dns,
282                                     2 -> after check4access,
283                                     3 -> before list_output/print_attr */
284
285 int items_displayed = 0;         /* number of items showed on
286                                     do_menu/do_search*/
287
288 #endif /* _INIT_ */
289