From: wessels <> Date: Fri, 24 Oct 1997 10:56:34 +0000 (+0000) Subject: Allow arbitrary text in the config file X-Git-Tag: SQUID_3_0_PRE1~4701 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a278cb887902b7ab7f805b4e6286caf34ba7200;p=thirdparty%2Fsquid.git Allow arbitrary text in the config file Oskar Pearson --- diff --git a/src/cf.data.pre b/src/cf.data.pre index 8c1b6f7f34..a1cae01496 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -1,3 +1,28 @@ +# +# If you use the NAME arbtext AND the LOC arbtext, you can use teh +# DOC_START function to insert text into the generated squid.conf file +# for headings and the like - oskar +# + +NAME: arbtext +LOC: arbtext +DOC_START + WELCOME TO SQUID 1.2 + -------------------- + + This is the default squid configuration file. You may wish + to look at http://cache.is.co.za/squid/ for documentation, + or the squid home page (http://squid.nlanr.net/) for the FAQ + +DOC_END + +NAME: arbtext +LOC: arbtext +DOC_START + NETWORK OPTIONS + ----------------------------------------------------------------------------- +DOC_END + NAME: http_port ascii_port TYPE: ushortlist DEFAULT: none @@ -104,9 +129,12 @@ udp_incoming_address 0.0.0.0 udp_outgoing_address 0.0.0.0 DOC_END - -# OPTIONS WHICH AFFECT THE NEIGHBOR SELECTION ALGORITHM -#----------------------------------------------------------------------------- +NAME: arbtext +LOC: arbtext +DOC_START + OPTIONS WHICH AFFECT THE NEIGHBOR SELECTION ALGORITHM + ----------------------------------------------------------------------------- +DOC_END NAME: cache_peer TYPE: peer @@ -358,9 +386,12 @@ cache_stoplist_pattern DOC_END -# OPTIONS WHICH AFFECT THE CACHE SIZE -#----------------------------------------------------------------------------- - +NAME: arbtext +LOC: arbtext +DOC_START + OPTIONS WHICH AFFECT THE CACHE SIZE + ----------------------------------------------------------------------------- +DOC_END NAME: cache_mem COMMENT: (bytes) @@ -482,9 +513,12 @@ ipcache_low 90 ipcache_high 95 DOC_END - -# LOGFILE PATHNAMES AND CACHE DIRECTORIES -#----------------------------------------------------------------------------- +NAME: arbtext +LOC: arbtext +DOC_START + LOGFILE PATHNAMES AND CACHE DIRECTORIES + ----------------------------------------------------------------------------- +DOC_END NAME: cache_dir TYPE: cachedir @@ -681,8 +715,12 @@ client_netmask 255.255.255.255 DOC_END -# OPTIONS FOR EXTERNAL SUPPORT PROGRAMS -#----------------------------------------------------------------------------- +NAME: arbtext +LOC: arbtext +DOC_START + OPTIONS FOR EXTERNAL SUPPORT PROGRAMS + ----------------------------------------------------------------------------- +DOC_END # TAG: ftpget_program # Where to find the 'ftpget' program that retrieves FTP data (HTTP @@ -821,9 +859,13 @@ DOC_START redirect_children 5 DOC_END +NAME: arbtext +LOC: arbtext +DOC_START + OPTIONS FOR TUNING THE CACHE + ----------------------------------------------------------------------------- +DOC_END -# OPTIONS FOR TUNING THE CACHE -#----------------------------------------------------------------------------- NAME: wais_relay_host TYPE: string DEFAULT: none @@ -998,9 +1040,12 @@ DOC_START negative_dns_ttl 5 minutes DOC_END - -# TIMEOUTS -#----------------------------------------------------------------------------- +NAME: arbtext +LOC: arbtext +DOC_START + TIMEOUTS + ----------------------------------------------------------------------------- +DOC_END NAME: connect_timeout COMMENT: (in seconds) @@ -1097,9 +1142,12 @@ DOC_START shutdown_lifetime 30 seconds DOC_END - -# ACCESS CONTROLS -#----------------------------------------------------------------------------- +NAME: arbtext +LOC: arbtext +DOC_START + ACCESS CONTROLS + ----------------------------------------------------------------------------- +DOC_END NAME: acl TYPE: acl @@ -1249,9 +1297,12 @@ DOC_START * There are no defaults. DOC_END - -# ADMINISTRATIVE PARAMETERS -#----------------------------------------------------------------------------- +NAME: arbtext +LOC: arbtext +DOC_START + ADMINISTRATIVE PARAMETERS + ----------------------------------------------------------------------------- +DOC_END NAME: cache_mgr TYPE: string @@ -1297,29 +1348,31 @@ DOC_START visible_hostname www-cache.foo.org DOC_END +NAME: arbtext +LOC: arbtext +DOC_START + OPTIONS FOR THE CACHE REGISTRATION SERVICE + ----------------------------------------------------------------------------- -# OPTIONS FOR THE CACHE REGISTRATION SERVICE -#----------------------------------------------------------------------------- + This section contains parameters for the (optional) cache + announcement service. This service is provided to help + cache administrators locate one another in order to join or + create cache hierarchies. -# This section contains parameters for the (optional) cache -# announcement service. This service is provided to help -# cache administrators locate one another in order to join or -# create cache hierarchies. -# -# An 'announcement' message is sent (via UDP) to the registration -# service by Squid. By default, the annoucement message is NOT -# SENT unless you enable it with 'cache_announce' below. -# -# The announcement message includes your hostname, plus the -# following information from this configuration file: -# -# http_port -# icp_port -# cache_mgr -# -# All current information is processed regularly and made -# available on the Web at http://www.nlanr.net/Cache/Tracker/. + An 'announcement' message is sent (via UDP) to the registration + service by Squid. By default, the annoucement message is NOT + SENT unless you enable it with 'cache_announce' below. + + The announcement message includes your hostname, plus the + following information from this configuration file: + http_port + icp_port + cache_mgr + + All current information is processed regularly and made + available on the Web at http://www.nlanr.net/Cache/Tracker/. +DOC_END NAME: announce_period TYPE: time_t @@ -1365,9 +1418,12 @@ DEFAULT: /dev/null LOC: Config.Announce.file DOC_NONE - -# HTTPD-ACCELERATOR OPTIONS -#----------------------------------------------------------------------------- +NAME: arbtext +LOC: arbtext +DOC_START + HTTPD-ACCELERATOR OPTIONS + ----------------------------------------------------------------------------- +DOC_END NAME: httpd_accel_host TYPE: string @@ -1420,9 +1476,12 @@ DOC_START httpd_accel_uses_host_header off DOC_END - -# MISCELLANEOUS -#----------------------------------------------------------------------------- +NAME: arbtext +LOC: arbtext +DOC_START + MISCELLANEOUS + ----------------------------------------------------------------------------- +DOC_END NAME: dns_testnames TYPE: wordlist diff --git a/src/cf_gen.cc b/src/cf_gen.cc index 8bc953307d..3c2ba4bc3c 100644 --- a/src/cf_gen.cc +++ b/src/cf_gen.cc @@ -1,5 +1,5 @@ /* - * $Id: cf_gen.cc,v 1.11 1997/10/22 19:25:17 wessels Exp $ + * $Id: cf_gen.cc,v 1.12 1997/10/24 04:56:35 wessels Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Max Okumoto @@ -31,6 +31,7 @@ /***************************************************************************** * Abstract: This program parses the input file and generates code and * files used to configure the variables in squid. + * (ie it creates the squid.conf file from the cf.data file) * * The output files are as follows: * cf_parser.c - this file contains, default_all() which @@ -302,6 +303,9 @@ gen_default(Entry * head, FILE * fp) ); for (entry = head; entry != NULL; entry = entry->next) { assert(entry->name); + + if (!strcmp(entry->name, "arbtext")) + continue; if (entry->loc == NULL) { fprintf(stderr, "NO LOCATION FOR %s\n", entry->name); rc |= 1; @@ -378,7 +382,7 @@ gen_parse(Entry * head, FILE * fp) "\t\tparse_%s();\n", entry->type ); - } else { + } else if (strcmp(entry->loc, "arbtext")) { fprintf(fp, "\t\tparse_%s(&%s);\n", entry->type, entry->loc @@ -408,6 +412,8 @@ gen_dump(Entry * head, FILE * fp) assert(entry->loc); if (strcmp(entry->loc, "none") == 0) continue; + if (strcmp(entry->name, "arbtext") == 0) + continue; fprintf(fp, "\tdump_%s(entry, \"%s\", %s);\n", entry->type, entry->name, @@ -429,6 +435,8 @@ gen_free(Entry * head, FILE * fp) assert(entry->loc); if (strcmp(entry->loc, "none") == 0) continue; + if (strcmp(entry->name, "arbtext") == 0) + continue; fprintf(fp, "\tfree_%s(&%s);\n", entry->type, entry->loc); } fprintf(fp, "}\n\n"); @@ -442,7 +450,8 @@ gen_conf(Entry * head, FILE * fp) for (entry = head; entry != NULL; entry = entry->next) { Line *line; - fprintf(fp, "# TAG: %s", entry->name); + if (strcmp(entry->name, "arbtext")) + fprintf(fp, "# TAG: %s", entry->name); if (entry->comment) fprintf(fp, "\t%s", entry->comment); fprintf(fp, "\n");