]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Allow arbitrary text in the config file
authorwessels <>
Fri, 24 Oct 1997 10:56:34 +0000 (10:56 +0000)
committerwessels <>
Fri, 24 Oct 1997 10:56:34 +0000 (10:56 +0000)
Oskar Pearson

src/cf.data.pre
src/cf_gen.cc

index 8c1b6f7f34f15fa5e5101c7b47378063794ef934..a1cae01496c6dc673c415b7e03d74faa967295e5 100644 (file)
@@ -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
index 8bc953307db4696cecfd0275ad712620cd22989a..3c2ba4bc3cea86a69f79782301cce484fd37bd63 100644 (file)
@@ -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");