1 /*_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
5 * Function:..File for TWEB-SOFTWARE *
9 * Authors:...Dr. Kurt Spanier & Bernhard Winkler, *
10 * Zentrum fuer Datenverarbeitung, Bereich Entwicklung *
11 * neuer Dienste, Universitaet Tuebingen, GERMANY *
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 *
19 _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_*/
22 * $Id: init.h,v 1.6 1999/09/10 15:01:17 zrnsk01 Exp $
30 #include "strng_exp.h"
32 #include "charray_exp.h"
33 #include "ch_malloc_exp.h"
34 #include "support_exp.h"
37 # include "tueTel_exp.h"
41 # include "ambix_exp.h"
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\
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\
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\
67 /* Funktions in the init-module */
72 PRIVATE int webport();
73 PRIVATE int timeout();
75 PRIVATE int ldapportf();
76 PRIVATE int hostname();
79 PRIVATE int index_url();
80 PRIVATE int allow_msg();
81 PRIVATE int helpfilef();
82 PRIVATE int filterfilef();
84 PRIVATE int friendlyfilef();
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();
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();
115 PRIVATE int no_show_rdn();
116 PRIVATE int no_modify();
118 PRIVATE int firstPage();
119 PRIVATE int secondPage();
120 PRIVATE int modattr();
121 PRIVATE void usage();
123 PRIVATE int parse2();
124 PRIVATE int table_disp();
125 PRIVATE int form_button();
126 PRIVATE int ip_refuse();
129 /* Sub-tables to analyse the DISPLAY-Keys */
130 static PARSE_ENTRY first_table[] = {
131 {"SECOND-PAGE", secondPage, NULL},
135 static PARSE_ENTRY display_table[] = {
136 {"FIRST-PAGE", firstPage, first_table},
141 /* Sub-tables to analyse the MODIFY-Keys */
142 static PARSE_ENTRY modify_table[] = {
143 {"MODATTR", modattr, NULL},
147 /* Sub-tables to analyse the IND_ATTRS-Keys */
148 static PARSE_ENTRY ind_attrs_table[] = {
149 {"IND_ATTRS", ind_attribute, NULL},
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},
207 {"SELBSTEINTRAG", selbsteintrag, NULL},
211 {"DIT-CONFIG", dit_config, NULL},
212 {"PHONEWORLD", phoneworld, NULL},
213 {"TON-URLS", ton_urls, NULL},
215 {"IP-REFUSE", ip_refuse, NULL},
221 /* tables to compute DISPLAY-types to integer */
222 STRDISP disp_types[] = {
226 { "MULTILINE", 5, 1 },
228 { "JPEG2GIF", 8, 10 },
235 { "BOOLEAN", 9, 11 },
238 { "INDEXURL", 8, 14 },
239 { "DYNAMICDN", 9, 15 },
240 { "REFERRAL", 8, 20 },
245 { "PHONREFSHORT", 12, 16 },
246 { "PHONREFLONG", 11, 17 },
247 { "TFUNCPERS", 9, 18 },
248 { "FAXTABLE", 8, 19 },
255 /* tables to compute syslog-options to integer */
256 static STRDISP syslog_types[] = {
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 },
272 #define DEFAULT_TIMEOUT 120
273 #define DEFAULT_MAXCOUNT 200
274 #define MAX_EXPIRE 604800
277 /* Variable for the Anti-Hack-Code */
278 extern COMREFUSE *comRefuseP;
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 */
285 int items_displayed = 0; /* number of items showed on