Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
c4c50274
Commit
c4c50274
authored
Feb 23, 2016
by
Dridi Boukelmoune
Committed by
Lasse Karstensen
Feb 25, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce a new ACL type for VMODs
parent
b16b6733
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
vrt.h
include/vrt.h
+10
-0
vcc_acl.c
lib/libvcc/vcc_acl.c
+10
-1
No files found.
include/vrt.h
View file @
c4c50274
...
...
@@ -50,6 +50,7 @@
/***********************************************************************/
struct
VCL_conf
;
struct
vrt_acl
;
struct
busyobj
;
struct
director
;
struct
http
;
...
...
@@ -67,6 +68,7 @@ struct ws;
* (alphabetic order)
*/
typedef
const
struct
vrt_acl
*
VCL_ACL
;
typedef
const
struct
director
*
VCL_BACKEND
;
typedef
const
struct
vmod_priv
*
VCL_BLOB
;
typedef
unsigned
VCL_BOOL
;
...
...
@@ -237,6 +239,14 @@ struct vrt_ref {
/* ACL related */
#define VRT_ACL_MAXADDR 16
/* max(IPv4, IPv6) */
typedef
int
acl_f
(
VRT_CTX
,
VCL_IP
);
struct
vrt_acl
{
unsigned
magic
;
#define VRT_ACL_MAGIC 0x78329d96
acl_f
*
match
;
};
void
VRT_acl_log
(
VRT_CTX
,
const
char
*
msg
);
/* req related */
...
...
lib/libvcc/vcc_acl.c
View file @
c4c50274
...
...
@@ -351,7 +351,7 @@ vcc_acl_emit(struct vcc *tl, const char *acln, int anon)
struct
token
*
t
;
struct
inifin
*
ifp
;
Fh
(
tl
,
0
,
"
\n
static int
\n
"
);
Fh
(
tl
,
0
,
"
\n
static int
__match_proto__(acl_f)
\n
"
);
Fh
(
tl
,
0
,
"match_acl_%s_%s(VRT_CTX, const VCL_IP p)
\n
"
,
anon
?
"anon"
:
"named"
,
acln
);
...
...
@@ -443,6 +443,15 @@ vcc_acl_emit(struct vcc *tl, const char *acln, int anon)
if
(
!
anon
)
Fh
(
tl
,
0
,
"
\t
VRT_acl_log(ctx,
\"
NO_MATCH %s
\"
);
\n
"
,
acln
);
Fh
(
tl
,
0
,
"
\t
return (0);
\n
}
\n
"
);
if
(
anon
)
return
;
/* Emit the struct that will be referenced */
Fh
(
tl
,
0
,
"
\n
const struct vrt_acl vrt_acl_named_%s = {
\n
"
,
acln
);
Fh
(
tl
,
0
,
"
\t
.magic = VRT_ACL_MAGIC,
\n
"
);
Fh
(
tl
,
0
,
"
\t
.match = &match_acl_named_%s,
\n
"
,
acln
);
Fh
(
tl
,
0
,
"};
\n\n
"
);
}
void
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment