Mailing List Archive

r74 - trunk/varnish-cache/include
Author: phk
Date: 2006-03-27 13:21:18 +0200 (Mon, 27 Mar 2006)
New Revision: 74

Added:
trunk/varnish-cache/include/vcl_lang.h
Log:
Stuff VCL programs needs to know about.



Added: trunk/varnish-cache/include/vcl_lang.h
===================================================================
--- trunk/varnish-cache/include/vcl_lang.h 2006-03-27 09:02:10 UTC (rev 73)
+++ trunk/varnish-cache/include/vcl_lang.h 2006-03-27 11:21:18 UTC (rev 74)
@@ -0,0 +1,74 @@
+/*
+ * Stuff necessary to compile a VCL programs C code
+ *
+ * XXX: When this file is changed, lib/libvcl/vcl_gen_fixed_token.tcl
+ * XXX: *MUST* be rerun.
+ */
+
+
+struct vcl_ref {
+ unsigned line;
+ unsigned pos;
+ unsigned count;
+ const char *token;
+};
+
+struct vcl_acl {
+ unsigned ip;
+ unsigned mask;
+};
+
+struct client {
+ unsigned ip;
+};
+
+struct req {
+ char *req;
+ char *useragent;
+ struct {
+ char *path;
+ char *host;
+ } url;
+ double ttlfactor;
+ struct backend *backend;
+};
+
+struct backend {
+ unsigned ip;
+ double responsetime;
+ double timeout;
+ double bandwidth;
+ int down;
+};
+
+struct obj {
+ int exists;
+ double ttl;
+ unsigned result;
+ unsigned size;
+ unsigned usage;
+};
+
+#define VCL_FARGS struct client *client, struct obj *obj, struct req *req, struct backend *backend
+#define VCL_PASS_ARGS client, obj, req, backend
+
+void VCL_count(unsigned);
+void VCL_no_cache();
+void VCL_no_new_cache();
+int ip_match(unsigned, struct vcl_acl *);
+int string_match(const char *, const char *);
+int VCL_rewrite(const char *, const char *);
+int VCL_error(unsigned, const char *);
+int VCL_fetch(void);
+int VCL_switch_config(const char *);
+
+typedef void vcl_init_f(void);
+
+struct VCL_conf {
+ unsigned magic;
+#define VCL_CONF_MAGIC 0x7406c509 /* from /dev/random */
+ vcl_init_f *init_func;
+ struct backend *default_backend;
+ struct vcl_ref *ref;
+ unsigned nref;
+};