[4.1] c713147 Add a new VRT_acl_match function to the VMODs ABI

Lasse Karstensen lkarsten at varnish-software.com
Thu Feb 25 15:11:14 CET 2016


commit c713147813bfedca7e36986769aa4f468ad38729
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Tue Feb 23 18:26:08 2016 +0100

    Add a new VRT_acl_match function to the VMODs ABI
    
    VRT_MINOR_VERSION needs to be incremented for the 4.1 branch.

diff --git a/bin/varnishd/cache/cache_vrt.c b/bin/varnishd/cache/cache_vrt.c
index 665dcf3..a73489b 100644
--- a/bin/varnishd/cache/cache_vrt.c
+++ b/bin/varnishd/cache/cache_vrt.c
@@ -39,6 +39,7 @@
 #include "vcl.h"
 #include "vrt.h"
 #include "vrt_obj.h"
+#include "vsa.h"
 #include "vtcp.h"
 #include "vtim.h"
 
@@ -74,6 +75,16 @@ VRT_acl_log(VRT_CTX, const char *msg)
 		VSL(SLT_VCL_acl, 0, "%s", msg);
 }
 
+int
+VRT_acl_match(VRT_CTX, VCL_ACL acl, VCL_IP ip)
+{
+
+	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
+	CHECK_OBJ_NOTNULL(acl, VRT_ACL_MAGIC);
+	assert(VSA_Sane(ip));
+	return (acl->match(ctx, ip));
+}
+
 /*--------------------------------------------------------------------*/
 
 struct http *
diff --git a/include/vrt.h b/include/vrt.h
index 9a27305..449d8b1 100644
--- a/include/vrt.h
+++ b/include/vrt.h
@@ -248,6 +248,7 @@ struct vrt_acl {
 };
 
 void VRT_acl_log(VRT_CTX, const char *msg);
+int VRT_acl_match(VRT_CTX, VCL_ACL, VCL_IP);
 
 /* req related */
 



More information about the varnish-commit mailing list