Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-ece
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
libvmod-ece
Commits
33eca69a
Commit
33eca69a
authored
Sep 19, 2019
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add decrypter.create_stats().
parent
766d3b42
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
1 deletion
+44
-1
decrypter.vtc
src/tests/decrypter.vtc
+18
-1
roundtrip.vtc
src/tests/roundtrip.vtc
+11
-0
vmod_ece.c
src/vmod_ece.c
+7
-0
vmod_ece.vcc
src/vmod_ece.vcc
+8
-0
No files found.
src/tests/decrypter.vtc
View file @
33eca69a
...
...
@@ -31,6 +31,7 @@ varnish v1 -arg "-p vsl_mask=+VfpAcct" -vcl+backend {
# With all params set to defaults, the decrypter is
# just like the default ece_decrypt VFP.
new default_dup = ece.decrypter("default_dup");
default_dup.create_stats();
ece.set_key("", blob.decode(BASE64URLNOPAD,
encoded="yqdlZ-tYemfogSmv7Ws5PQ"));
ece.set_key("a1", blob.decode(BASE64URLNOPAD,
...
...
@@ -76,6 +77,10 @@ logexpect l1 -v v1 -d 1 -g vxid -q "VfpAcct" {
expect * = End
} -run
varnish v1 -expect ECE.vfp.vcl1.default_dup.ops == 2
varnish v1 -expect ECE.vfp.vcl1.default_dup.in == 126
varnish v1 -expect ECE.vfp.vcl1.default_dup.out == 30
server s1 -wait
server s1 -start
...
...
@@ -85,6 +90,7 @@ varnish v1 -vcl+backend {
sub vcl_init {
# Use a chunk size that is smaller than the default.
new chunk4k = ece.decrypter("chunk4k", chunksz=4k);
chunk4k.create_stats();
}
sub vcl_backend_response {
...
...
@@ -114,6 +120,10 @@ client c1 -run
logexpect l1 -wait
varnish v1 -expect ECE.vfp.vcl2.chunk4k.ops == 2
varnish v1 -expect ECE.vfp.vcl2.chunk4k.in == 126
varnish v1 -expect ECE.vfp.vcl2.chunk4k.out == 30
server s1 -wait
server s1 -start
...
...
@@ -122,7 +132,8 @@ varnish v1 -vcl+backend {
sub vcl_init {
# max_rs=0 means that record sizes are only limited by INT_MAX.
new chunk4k = ece.decrypter("maxrs0", max_rs=0B);
new maxrs0 = ece.decrypter("maxrs0", max_rs=0B);
maxrs0.create_stats();
}
sub vcl_backend_response {
...
...
@@ -150,6 +161,12 @@ logexpect l1 -v v1 -d 0 -g vxid -q "VfpAcct" {
client c1 -run
logexpect l1 -wait
varnish v1 -expect ECE.vfp.vcl3.maxrs0.ops == 2
varnish v1 -expect ECE.vfp.vcl3.maxrs0.in == 126
varnish v1 -expect ECE.vfp.vcl3.maxrs0.out == 30
server s1 -wait
server s1 {
rxreq
...
...
src/tests/roundtrip.vtc
View file @
33eca69a
...
...
@@ -170,6 +170,7 @@ varnish v1 -vcl+backend {
rs128.create_stats();
# Decrypter uses 8k chunk size.
new chunk8k = ece.decrypter("chunk8k", chunksz=8k);
chunk8k.create_stats();
}
sub vcl_backend_response {
...
...
@@ -226,10 +227,15 @@ client c1 -run
logexpect l1 -wait
# Verify in the logs for the custom VFPs that encrypter.out == decrypter.in
varnish v1 -expect ECE.vfp.vcl2.rs128.ops == 6
varnish v1 -expect ECE.vfp.vcl2.rs128.in == 199975
varnish v1 -expect ECE.vfp.vcl2.rs128.out > 199975
varnish v1 -expect ECE.vfp.vcl2.chunk8k.ops == 6
varnish v1 -expect ECE.vfp.vcl2.chunk8k.in > 199975
varnish v1 -expect ECE.vfp.vcl2.chunk8k.out == 199975
varnish v1 -vcl+backend {
import ${vmod_ece};
...
...
@@ -237,6 +243,7 @@ varnish v1 -vcl+backend {
new rs815 = ece.encrypter("rs815", rs=815B);
rs815.create_stats();
new chunk4711 = ece.decrypter("chunk4711", chunksz=4711B);
chunk4711.create_stats();
}
sub vcl_backend_response {
...
...
@@ -297,6 +304,10 @@ varnish v1 -expect ECE.vfp.vcl3.rs815.ops == 6
varnish v1 -expect ECE.vfp.vcl3.rs815.in == 199975
varnish v1 -expect ECE.vfp.vcl3.rs815.out > 199975
varnish v1 -expect ECE.vfp.vcl3.chunk4711.ops == 6
varnish v1 -expect ECE.vfp.vcl3.chunk4711.in > 199975
varnish v1 -expect ECE.vfp.vcl3.chunk4711.out == 199975
varnish v1 -cli "vcl.discard vcl1"
varnish v1 -cli "vcl.discard vcl2"
varnish v1 -cli "vcl.list"
src/vmod_ece.c
View file @
33eca69a
...
...
@@ -503,6 +503,13 @@ VCL_VOID vmod_decrypter__fini(struct VPFX(ece_decrypter) **decp)
FREE_OBJ
(
dec
);
}
VCL_VOID
vmod_decrypter_create_stats
(
VRT_CTX
,
struct
VPFX
(
ece_decrypter
)
*
dec
)
{
CHECK_OBJ_NOTNULL
(
dec
,
ECE_DECRYPTER_MAGIC
);
create_stats
(
ctx
,
dec
->
vfp
,
dec
->
vcl_name
);
}
/* Key manipulation functions */
#define CHECK_ID(ctx, id, len, ret) \
...
...
src/vmod_ece.vcc
View file @
33eca69a
...
...
@@ -79,6 +79,14 @@ Create a decryption filter named ``name`` with custom parameters.
XXX ...
$Method VOID .create_stats()
Create statistics for the custom decryption filter, the same as the
counters created for the standard ``"ece_decrypt"`` filter. See
`STATISTICS`_ for details.
XXX ...
$Function VOID add_key(STRING id, BLOB key)
Add the keying material identified by ``id`` with the contents of the
...
...
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