aboutsummaryrefslogtreecommitdiff
path: root/src/tbf.h
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2014-11-01 14:10:23 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2014-11-01 14:10:23 +0200
commitdacdfd20c9e59e088bfb23c2852b566acc6ad06f (patch)
tree9c8acf2e253afd9593d5f6fccd560f7173485d48 /src/tbf.h
parent4d452a770122daf33fdbe0a549e2804b6f2db086 (diff)
downloadvmod-tbf-dacdfd20c9e59e088bfb23c2852b566acc6ad06f.tar.gz
vmod-tbf-dacdfd20c9e59e088bfb23c2852b566acc6ad06f.tar.bz2
Support for VCL 4.0
* NEWS: Update. * configure.ac: Version 1.0.90 Detect Varnish version, set up the C defines and automake conditionals to indicate it. * src/.gitignore: Update. * src/Makefile.am: Don't distribute vcc_if.c and vcc_if.h, build them for the current Varnish version. * src/tbf.h: New file. * src/getla.c: Include tbf.h, rewrite to compile with both 3.0 and 4.0 * src/sleep.c: Likewise. * src/tbf.c: Likewise. * src/time.c: Likewise. * src/vmod_tbf.vcc: Rewrite using v4.0 format. * tests/.gitignore: New file. * tests/Makefile.am: Build test00.vtc and test02.vtc * tests/test00.vtc: Rename to tests/test00.vti, add conditional compilation directives. * tests/test02.vtc: Rename to tests/test02.vti, add conditional compilation directives.
Diffstat (limited to 'src/tbf.h')
-rw-r--r--src/tbf.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/tbf.h b/src/tbf.h
new file mode 100644
index 0000000..3c7a118
--- /dev/null
+++ b/src/tbf.h
@@ -0,0 +1,38 @@
+/* This file is part of vmod-tbf
+ Copyright (C) 2013-2014 Sergey Poznyakoff
+
+ Vmod-tbf is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ Vmod-tbf is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with vmod-tbf. If not, see <http://www.gnu.org/licenses/>.
+*/
+#include <config.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdbool.h>
+#include <syslog.h>
+#include "vrt.h"
+#include "vcc_if.h"
+#include "pthread.h"
+#if VARNISHVERSION == 3
+# include "bin/varnishd/cache.h"
+# define VCL_VOID void
+# define VCL_INT int
+# define VCL_REAL double
+# define VCL_BOOL unsigned
+# define VCL_STRING const char *
+# define MOD_CTX struct sess *
+# define WSPTR(s) ((s)->wrk->ws)
+#else
+# include "bin/varnishd/cache/cache.h"
+# define MOD_CTX const struct vrt_ctx *
+# define WSPTR(s) ((s)->ws)
+#endif

Return to:

Send suggestions and report system problems to the System administrator.