Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
1c759b87
Commit
1c759b87
authored
Apr 30, 2013
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move acls to vrt_ctx
parent
2e3b542d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
9 deletions
+10
-9
cache_vrt.c
bin/varnishd/cache/cache_vrt.c
+3
-2
vrt.h
include/vrt.h
+1
-1
vcc_acl.c
lib/libvcl/vcc_acl.c
+5
-5
vcc_expr.c
lib/libvcl/vcc_expr.c
+1
-1
No files found.
bin/varnishd/cache/cache_vrt.c
View file @
1c759b87
...
...
@@ -98,10 +98,11 @@ VRT_count(const struct vrt_ctx *ctx, unsigned u)
/*--------------------------------------------------------------------*/
void
VRT_acl_log
(
struct
req
*
req
,
const
char
*
msg
)
VRT_acl_log
(
const
struct
vrt_ctx
*
ctx
,
const
char
*
msg
)
{
VSLb
(
req
->
vsl
,
SLT_VCL_acl
,
"%s"
,
msg
);
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
VSLb
(
ctx
->
vsl
,
SLT_VCL_acl
,
"%s"
,
msg
);
}
/*--------------------------------------------------------------------*/
...
...
include/vrt.h
View file @
1c759b87
...
...
@@ -182,7 +182,7 @@ struct vrt_ref {
/* ACL related */
#define VRT_ACL_MAXADDR 16
/* max(IPv4, IPv6) */
void
VRT_acl_log
(
struct
req
*
,
const
char
*
msg
);
void
VRT_acl_log
(
const
struct
vrt_ctx
*
,
const
char
*
msg
);
/* req related */
...
...
lib/libvcl/vcc_acl.c
View file @
1c759b87
...
...
@@ -357,7 +357,7 @@ vcc_acl_emit(const struct vcc *tl, const char *acln, int anon)
const
char
*
oc
;
Fh
(
tl
,
0
,
"
\n
static int
\n
"
);
Fh
(
tl
,
0
,
"match_acl_%s_%s(
struct req *req
, const void *p)
\n
"
,
Fh
(
tl
,
0
,
"match_acl_%s_%s(
const struct vrt_ctx *ctx
, const void *p)
\n
"
,
anon
?
"anon"
:
"named"
,
acln
);
Fh
(
tl
,
0
,
"{
\n
"
);
Fh
(
tl
,
0
,
"
\t
const unsigned char *a;
\n
"
);
...
...
@@ -372,7 +372,7 @@ vcc_acl_emit(const struct vcc *tl, const char *acln, int anon)
Fh
(
tl
,
0
,
"
\t
else if (fam == %d)
\n
"
,
PF_INET6
);
Fh
(
tl
,
0
,
"
\t\t
a += %zd;
\n
"
,
offsetof
(
struct
sockaddr_in6
,
sin6_addr
));
Fh
(
tl
,
0
,
"
\t
else {
\n
"
);
Fh
(
tl
,
0
,
"
\t\t
VRT_acl_log(
req
,
\"
NO_FAM %s
\"
);
\n
"
,
acln
);
Fh
(
tl
,
0
,
"
\t\t
VRT_acl_log(
ctx
,
\"
NO_FAM %s
\"
);
\n
"
,
acln
);
Fh
(
tl
,
0
,
"
\t\t
return(0);
\n
"
);
Fh
(
tl
,
0
,
"
\t
}
\n\n
"
);
depth
=
-
1
;
...
...
@@ -424,7 +424,7 @@ vcc_acl_emit(const struct vcc *tl, const char *acln, int anon)
i
=
(
ae
->
mask
+
7
)
/
8
;
if
(
!
anon
)
{
Fh
(
tl
,
0
,
"
\t
%*sVRT_acl_log(
req
,
\"
%sMATCH %s
\"
"
,
Fh
(
tl
,
0
,
"
\t
%*sVRT_acl_log(
ctx
,
\"
%sMATCH %s
\"
"
,
-
i
,
""
,
ae
->
not
?
"NEG_"
:
""
,
acln
);
EncToken
(
tl
->
fh
,
ae
->
t_addr
);
if
(
ae
->
t_mask
!=
NULL
)
...
...
@@ -441,7 +441,7 @@ vcc_acl_emit(const struct vcc *tl, const char *acln, int anon)
/* Deny by default */
if
(
!
anon
)
Fh
(
tl
,
0
,
"
\t
VRT_acl_log(
req
,
\"
NO_MATCH %s
\"
);
\n
"
,
acln
);
Fh
(
tl
,
0
,
"
\t
VRT_acl_log(
ctx
,
\"
NO_MATCH %s
\"
);
\n
"
,
acln
);
Fh
(
tl
,
0
,
"
\t
return (0);
\n
}
\n
"
);
}
...
...
@@ -457,7 +457,7 @@ vcc_Acl_Hack(struct vcc *tl, char *b)
bprintf
(
acln
,
"%u"
,
tl
->
unique
++
);
vcc_acl_entry
(
tl
);
vcc_acl_emit
(
tl
,
acln
,
1
);
sprintf
(
b
,
"%smatch_acl_anon_%s(
req
,
\v
1)"
,
sprintf
(
b
,
"%smatch_acl_anon_%s(
ctx
,
\v
1)"
,
(
tcond
==
T_NEQ
?
"!"
:
""
),
acln
);
}
...
...
lib/libvcl/vcc_expr.c
View file @
1c759b87
...
...
@@ -1012,7 +1012,7 @@ vcc_expr_cmp(struct vcc *tl, struct expr **e, enum var_type fmt)
vcc_NextToken
(
tl
);
ExpectErr
(
tl
,
ID
);
vcc_AddRef
(
tl
,
tl
->
t
,
SYM_ACL
);
bprintf
(
buf
,
"%smatch_acl_named_%.*s(
req
,
\v
1)"
,
bprintf
(
buf
,
"%smatch_acl_named_%.*s(
ctx
,
\v
1)"
,
not
,
PF
(
tl
->
t
));
vcc_NextToken
(
tl
);
*
e
=
vcc_expr_edit
(
BOOL
,
buf
,
*
e
,
NULL
);
...
...
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