Use $Restrict

parent b8d7bb72
...@@ -301,6 +301,10 @@ ACL xacl.get([ACL fallback]) ...@@ -301,6 +301,10 @@ ACL xacl.get([ACL fallback])
Return the value of the topvar or the `fallback` argument Return the value of the topvar or the `fallback` argument
if it is undefined. Using .get() on an undefined value without a fallback triggers a VCL error. if it is undefined. Using .get() on an undefined value without a fallback triggers a VCL error.
Restricted to: ``client``.
.. _xacl.set(): .. _xacl.set():
VOID xacl.set(ACL) VOID xacl.set(ACL)
...@@ -310,6 +314,10 @@ Set the value of the topvar. ...@@ -310,6 +314,10 @@ Set the value of the topvar.
Triggers a vcl failure for protected variables. Triggers a vcl failure for protected variables.
Restricted to: ``client``.
.. _xacl.undefine(): .. _xacl.undefine():
VOID xacl.undefine() VOID xacl.undefine()
...@@ -317,6 +325,10 @@ VOID xacl.undefine() ...@@ -317,6 +325,10 @@ VOID xacl.undefine()
Undefine the topvar. Undefine the topvar.
Restricted to: ``client``.
.. _xacl.defined(): .. _xacl.defined():
BOOL xacl.defined() BOOL xacl.defined()
...@@ -324,6 +336,10 @@ BOOL xacl.defined() ...@@ -324,6 +336,10 @@ BOOL xacl.defined()
Return whether the topvar is defined. Return whether the topvar is defined.
Restricted to: ``client``.
.. _xacl.protect(): .. _xacl.protect():
VOID xacl.protect() VOID xacl.protect()
...@@ -332,6 +348,10 @@ VOID xacl.protect() ...@@ -332,6 +348,10 @@ VOID xacl.protect()
Protect the topvar, so any future .set() calls on it Protect the topvar, so any future .set() calls on it
trigger a vcl failure. trigger a vcl failure.
Restricted to: ``client``.
.. _xacl.protected(): .. _xacl.protected():
BOOL xacl.protected() BOOL xacl.protected()
...@@ -339,6 +359,10 @@ BOOL xacl.protected() ...@@ -339,6 +359,10 @@ BOOL xacl.protected()
Return whether the topvar is protected. Return whether the topvar is protected.
Restricted to: ``client``.
.. _topvar.backend(): .. _topvar.backend():
new xbackend = topvar.backend([BACKEND init]) new xbackend = topvar.backend([BACKEND init])
...@@ -356,6 +380,10 @@ BACKEND xbackend.get([BACKEND fallback]) ...@@ -356,6 +380,10 @@ BACKEND xbackend.get([BACKEND fallback])
Return the value of the topvar or the `fallback` argument Return the value of the topvar or the `fallback` argument
if it is undefined. The default `fallback` is the ``None`` backend. if it is undefined. The default `fallback` is the ``None`` backend.
Restricted to: ``client``.
.. _xbackend.set(): .. _xbackend.set():
VOID xbackend.set(BACKEND) VOID xbackend.set(BACKEND)
...@@ -365,6 +393,10 @@ Set the value of the topvar. ...@@ -365,6 +393,10 @@ Set the value of the topvar.
Triggers a vcl failure for protected variables. Triggers a vcl failure for protected variables.
Restricted to: ``client``.
.. _xbackend.undefine(): .. _xbackend.undefine():
VOID xbackend.undefine() VOID xbackend.undefine()
...@@ -372,6 +404,10 @@ VOID xbackend.undefine() ...@@ -372,6 +404,10 @@ VOID xbackend.undefine()
Undefine the topvar. Undefine the topvar.
Restricted to: ``client``.
.. _xbackend.defined(): .. _xbackend.defined():
BOOL xbackend.defined() BOOL xbackend.defined()
...@@ -379,6 +415,10 @@ BOOL xbackend.defined() ...@@ -379,6 +415,10 @@ BOOL xbackend.defined()
Return whether the topvar is defined. Return whether the topvar is defined.
Restricted to: ``client``.
.. _xbackend.protect(): .. _xbackend.protect():
VOID xbackend.protect() VOID xbackend.protect()
...@@ -387,6 +427,10 @@ VOID xbackend.protect() ...@@ -387,6 +427,10 @@ VOID xbackend.protect()
Protect the topvar, so any future .set() calls on it Protect the topvar, so any future .set() calls on it
trigger a vcl failure. trigger a vcl failure.
Restricted to: ``client``.
.. _xbackend.protected(): .. _xbackend.protected():
BOOL xbackend.protected() BOOL xbackend.protected()
...@@ -394,6 +438,10 @@ BOOL xbackend.protected() ...@@ -394,6 +438,10 @@ BOOL xbackend.protected()
Return whether the topvar is protected. Return whether the topvar is protected.
Restricted to: ``client``.
.. _topvar.blob(): .. _topvar.blob():
new xblob = topvar.blob([BLOB init]) new xblob = topvar.blob([BLOB init])
...@@ -411,6 +459,10 @@ BLOB xblob.get([BLOB fallback]) ...@@ -411,6 +459,10 @@ BLOB xblob.get([BLOB fallback])
Return the value of the topvar or the `fallback` argument Return the value of the topvar or the `fallback` argument
if it is undefined. The default `fallback` is the null blob. if it is undefined. The default `fallback` is the null blob.
Restricted to: ``client``.
.. _xblob.set(): .. _xblob.set():
VOID xblob.set(BLOB) VOID xblob.set(BLOB)
...@@ -420,6 +472,10 @@ Set the value of the topvar. ...@@ -420,6 +472,10 @@ Set the value of the topvar.
Triggers a vcl failure for protected variables. Triggers a vcl failure for protected variables.
Restricted to: ``client``.
.. _xblob.undefine(): .. _xblob.undefine():
VOID xblob.undefine() VOID xblob.undefine()
...@@ -427,6 +483,10 @@ VOID xblob.undefine() ...@@ -427,6 +483,10 @@ VOID xblob.undefine()
Undefine the topvar. Undefine the topvar.
Restricted to: ``client``.
.. _xblob.defined(): .. _xblob.defined():
BOOL xblob.defined() BOOL xblob.defined()
...@@ -434,6 +494,10 @@ BOOL xblob.defined() ...@@ -434,6 +494,10 @@ BOOL xblob.defined()
Return whether the topvar is defined. Return whether the topvar is defined.
Restricted to: ``client``.
.. _xblob.protect(): .. _xblob.protect():
VOID xblob.protect() VOID xblob.protect()
...@@ -442,6 +506,10 @@ VOID xblob.protect() ...@@ -442,6 +506,10 @@ VOID xblob.protect()
Protect the topvar, so any future .set() calls on it Protect the topvar, so any future .set() calls on it
trigger a vcl failure. trigger a vcl failure.
Restricted to: ``client``.
.. _xblob.protected(): .. _xblob.protected():
BOOL xblob.protected() BOOL xblob.protected()
...@@ -449,6 +517,10 @@ BOOL xblob.protected() ...@@ -449,6 +517,10 @@ BOOL xblob.protected()
Return whether the topvar is protected. Return whether the topvar is protected.
Restricted to: ``client``.
.. _topvar.body(): .. _topvar.body():
new xbody = topvar.body([BODY init]) new xbody = topvar.body([BODY init])
...@@ -466,6 +538,10 @@ BODY xbody.get([BODY fallback]) ...@@ -466,6 +538,10 @@ BODY xbody.get([BODY fallback])
Return the value of the topvar or the `fallback` argument Return the value of the topvar or the `fallback` argument
if it is undefined. Using .get() on an undefined value without a fallback triggers a VCL error. if it is undefined. Using .get() on an undefined value without a fallback triggers a VCL error.
Restricted to: ``client``.
.. _xbody.set(): .. _xbody.set():
VOID xbody.set(BODY) VOID xbody.set(BODY)
...@@ -475,6 +551,10 @@ Set the value of the topvar. ...@@ -475,6 +551,10 @@ Set the value of the topvar.
Triggers a vcl failure for protected variables. Triggers a vcl failure for protected variables.
Restricted to: ``client``.
.. _xbody.undefine(): .. _xbody.undefine():
VOID xbody.undefine() VOID xbody.undefine()
...@@ -482,6 +562,10 @@ VOID xbody.undefine() ...@@ -482,6 +562,10 @@ VOID xbody.undefine()
Undefine the topvar. Undefine the topvar.
Restricted to: ``client``.
.. _xbody.defined(): .. _xbody.defined():
BOOL xbody.defined() BOOL xbody.defined()
...@@ -489,6 +573,10 @@ BOOL xbody.defined() ...@@ -489,6 +573,10 @@ BOOL xbody.defined()
Return whether the topvar is defined. Return whether the topvar is defined.
Restricted to: ``client``.
.. _xbody.protect(): .. _xbody.protect():
VOID xbody.protect() VOID xbody.protect()
...@@ -497,6 +585,10 @@ VOID xbody.protect() ...@@ -497,6 +585,10 @@ VOID xbody.protect()
Protect the topvar, so any future .set() calls on it Protect the topvar, so any future .set() calls on it
trigger a vcl failure. trigger a vcl failure.
Restricted to: ``client``.
.. _xbody.protected(): .. _xbody.protected():
BOOL xbody.protected() BOOL xbody.protected()
...@@ -504,6 +596,10 @@ BOOL xbody.protected() ...@@ -504,6 +596,10 @@ BOOL xbody.protected()
Return whether the topvar is protected. Return whether the topvar is protected.
Restricted to: ``client``.
.. _topvar.bool(): .. _topvar.bool():
new xbool = topvar.bool([BOOL init]) new xbool = topvar.bool([BOOL init])
...@@ -521,6 +617,10 @@ BOOL xbool.get([BOOL fallback]) ...@@ -521,6 +617,10 @@ BOOL xbool.get([BOOL fallback])
Return the value of the topvar or the `fallback` argument Return the value of the topvar or the `fallback` argument
if it is undefined. The default `fallback` is false if it is undefined. The default `fallback` is false
Restricted to: ``client``.
.. _xbool.set(): .. _xbool.set():
VOID xbool.set(BOOL) VOID xbool.set(BOOL)
...@@ -530,6 +630,10 @@ Set the value of the topvar. ...@@ -530,6 +630,10 @@ Set the value of the topvar.
Triggers a vcl failure for protected variables. Triggers a vcl failure for protected variables.
Restricted to: ``client``.
.. _xbool.undefine(): .. _xbool.undefine():
VOID xbool.undefine() VOID xbool.undefine()
...@@ -537,6 +641,10 @@ VOID xbool.undefine() ...@@ -537,6 +641,10 @@ VOID xbool.undefine()
Undefine the topvar. Undefine the topvar.
Restricted to: ``client``.
.. _xbool.defined(): .. _xbool.defined():
BOOL xbool.defined() BOOL xbool.defined()
...@@ -544,6 +652,10 @@ BOOL xbool.defined() ...@@ -544,6 +652,10 @@ BOOL xbool.defined()
Return whether the topvar is defined. Return whether the topvar is defined.
Restricted to: ``client``.
.. _xbool.protect(): .. _xbool.protect():
VOID xbool.protect() VOID xbool.protect()
...@@ -552,6 +664,10 @@ VOID xbool.protect() ...@@ -552,6 +664,10 @@ VOID xbool.protect()
Protect the topvar, so any future .set() calls on it Protect the topvar, so any future .set() calls on it
trigger a vcl failure. trigger a vcl failure.
Restricted to: ``client``.
.. _xbool.protected(): .. _xbool.protected():
BOOL xbool.protected() BOOL xbool.protected()
...@@ -559,6 +675,10 @@ BOOL xbool.protected() ...@@ -559,6 +675,10 @@ BOOL xbool.protected()
Return whether the topvar is protected. Return whether the topvar is protected.
Restricted to: ``client``.
.. _topvar.bytes(): .. _topvar.bytes():
new xbytes = topvar.bytes([BYTES init]) new xbytes = topvar.bytes([BYTES init])
...@@ -576,6 +696,10 @@ BYTES xbytes.get([BYTES fallback]) ...@@ -576,6 +696,10 @@ BYTES xbytes.get([BYTES fallback])
Return the value of the topvar or the `fallback` argument Return the value of the topvar or the `fallback` argument
if it is undefined. The default `fallback` is 0 bytes. if it is undefined. The default `fallback` is 0 bytes.
Restricted to: ``client``.
.. _xbytes.set(): .. _xbytes.set():
VOID xbytes.set(BYTES) VOID xbytes.set(BYTES)
...@@ -585,6 +709,10 @@ Set the value of the topvar. ...@@ -585,6 +709,10 @@ Set the value of the topvar.
Triggers a vcl failure for protected variables. Triggers a vcl failure for protected variables.
Restricted to: ``client``.
.. _xbytes.undefine(): .. _xbytes.undefine():
VOID xbytes.undefine() VOID xbytes.undefine()
...@@ -592,6 +720,10 @@ VOID xbytes.undefine() ...@@ -592,6 +720,10 @@ VOID xbytes.undefine()
Undefine the topvar. Undefine the topvar.
Restricted to: ``client``.
.. _xbytes.defined(): .. _xbytes.defined():
BOOL xbytes.defined() BOOL xbytes.defined()
...@@ -599,6 +731,10 @@ BOOL xbytes.defined() ...@@ -599,6 +731,10 @@ BOOL xbytes.defined()
Return whether the topvar is defined. Return whether the topvar is defined.
Restricted to: ``client``.
.. _xbytes.protect(): .. _xbytes.protect():
VOID xbytes.protect() VOID xbytes.protect()
...@@ -607,6 +743,10 @@ VOID xbytes.protect() ...@@ -607,6 +743,10 @@ VOID xbytes.protect()
Protect the topvar, so any future .set() calls on it Protect the topvar, so any future .set() calls on it
trigger a vcl failure. trigger a vcl failure.
Restricted to: ``client``.
.. _xbytes.protected(): .. _xbytes.protected():
BOOL xbytes.protected() BOOL xbytes.protected()
...@@ -614,6 +754,10 @@ BOOL xbytes.protected() ...@@ -614,6 +754,10 @@ BOOL xbytes.protected()
Return whether the topvar is protected. Return whether the topvar is protected.
Restricted to: ``client``.
.. _topvar.duration(): .. _topvar.duration():
new xduration = topvar.duration([DURATION init]) new xduration = topvar.duration([DURATION init])
...@@ -631,6 +775,10 @@ DURATION xduration.get([DURATION fallback]) ...@@ -631,6 +775,10 @@ DURATION xduration.get([DURATION fallback])
Return the value of the topvar or the `fallback` argument Return the value of the topvar or the `fallback` argument
if it is undefined. The default `fallback` is 0s. if it is undefined. The default `fallback` is 0s.
Restricted to: ``client``.
.. _xduration.set(): .. _xduration.set():
VOID xduration.set(DURATION) VOID xduration.set(DURATION)
...@@ -640,6 +788,10 @@ Set the value of the topvar. ...@@ -640,6 +788,10 @@ Set the value of the topvar.
Triggers a vcl failure for protected variables. Triggers a vcl failure for protected variables.
Restricted to: ``client``.
.. _xduration.undefine(): .. _xduration.undefine():
VOID xduration.undefine() VOID xduration.undefine()
...@@ -647,6 +799,10 @@ VOID xduration.undefine() ...@@ -647,6 +799,10 @@ VOID xduration.undefine()
Undefine the topvar. Undefine the topvar.
Restricted to: ``client``.
.. _xduration.defined(): .. _xduration.defined():
BOOL xduration.defined() BOOL xduration.defined()
...@@ -654,6 +810,10 @@ BOOL xduration.defined() ...@@ -654,6 +810,10 @@ BOOL xduration.defined()
Return whether the topvar is defined. Return whether the topvar is defined.
Restricted to: ``client``.
.. _xduration.protect(): .. _xduration.protect():
VOID xduration.protect() VOID xduration.protect()
...@@ -662,6 +822,10 @@ VOID xduration.protect() ...@@ -662,6 +822,10 @@ VOID xduration.protect()
Protect the topvar, so any future .set() calls on it Protect the topvar, so any future .set() calls on it
trigger a vcl failure. trigger a vcl failure.
Restricted to: ``client``.
.. _xduration.protected(): .. _xduration.protected():
BOOL xduration.protected() BOOL xduration.protected()
...@@ -669,6 +833,10 @@ BOOL xduration.protected() ...@@ -669,6 +833,10 @@ BOOL xduration.protected()
Return whether the topvar is protected. Return whether the topvar is protected.
Restricted to: ``client``.
.. _topvar.header(): .. _topvar.header():
new xheader = topvar.header([HEADER init]) new xheader = topvar.header([HEADER init])
...@@ -686,6 +854,10 @@ HEADER xheader.get([HEADER fallback]) ...@@ -686,6 +854,10 @@ HEADER xheader.get([HEADER fallback])
Return the value of the topvar or the `fallback` argument Return the value of the topvar or the `fallback` argument
if it is undefined. Using .get() on an undefined value without a fallback triggers a VCL error. if it is undefined. Using .get() on an undefined value without a fallback triggers a VCL error.
Restricted to: ``client``.
.. _xheader.set(): .. _xheader.set():
VOID xheader.set(HEADER) VOID xheader.set(HEADER)
...@@ -695,6 +867,10 @@ Set the value of the topvar. ...@@ -695,6 +867,10 @@ Set the value of the topvar.
Triggers a vcl failure for protected variables. Triggers a vcl failure for protected variables.
Restricted to: ``client``.
.. _xheader.undefine(): .. _xheader.undefine():
VOID xheader.undefine() VOID xheader.undefine()
...@@ -702,6 +878,10 @@ VOID xheader.undefine() ...@@ -702,6 +878,10 @@ VOID xheader.undefine()
Undefine the topvar. Undefine the topvar.
Restricted to: ``client``.
.. _xheader.defined(): .. _xheader.defined():
BOOL xheader.defined() BOOL xheader.defined()
...@@ -709,6 +889,10 @@ BOOL xheader.defined() ...@@ -709,6 +889,10 @@ BOOL xheader.defined()
Return whether the topvar is defined. Return whether the topvar is defined.
Restricted to: ``client``.
.. _xheader.protect(): .. _xheader.protect():
VOID xheader.protect() VOID xheader.protect()
...@@ -717,6 +901,10 @@ VOID xheader.protect() ...@@ -717,6 +901,10 @@ VOID xheader.protect()
Protect the topvar, so any future .set() calls on it Protect the topvar, so any future .set() calls on it
trigger a vcl failure. trigger a vcl failure.
Restricted to: ``client``.
.. _xheader.protected(): .. _xheader.protected():
BOOL xheader.protected() BOOL xheader.protected()
...@@ -724,6 +912,10 @@ BOOL xheader.protected() ...@@ -724,6 +912,10 @@ BOOL xheader.protected()
Return whether the topvar is protected. Return whether the topvar is protected.
Restricted to: ``client``.
.. _topvar.int(): .. _topvar.int():
new xint = topvar.int([INT init]) new xint = topvar.int([INT init])
...@@ -741,6 +933,10 @@ INT xint.get([INT fallback]) ...@@ -741,6 +933,10 @@ INT xint.get([INT fallback])
Return the value of the topvar or the `fallback` argument Return the value of the topvar or the `fallback` argument
if it is undefined. The default `fallback` is 0. if it is undefined. The default `fallback` is 0.
Restricted to: ``client``.
.. _xint.set(): .. _xint.set():
VOID xint.set(INT) VOID xint.set(INT)
...@@ -750,6 +946,10 @@ Set the value of the topvar. ...@@ -750,6 +946,10 @@ Set the value of the topvar.
Triggers a vcl failure for protected variables. Triggers a vcl failure for protected variables.
Restricted to: ``client``.
.. _xint.undefine(): .. _xint.undefine():
VOID xint.undefine() VOID xint.undefine()
...@@ -757,6 +957,10 @@ VOID xint.undefine() ...@@ -757,6 +957,10 @@ VOID xint.undefine()
Undefine the topvar. Undefine the topvar.
Restricted to: ``client``.
.. _xint.defined(): .. _xint.defined():
BOOL xint.defined() BOOL xint.defined()
...@@ -764,6 +968,10 @@ BOOL xint.defined() ...@@ -764,6 +968,10 @@ BOOL xint.defined()
Return whether the topvar is defined. Return whether the topvar is defined.
Restricted to: ``client``.
.. _xint.protect(): .. _xint.protect():
VOID xint.protect() VOID xint.protect()
...@@ -772,6 +980,10 @@ VOID xint.protect() ...@@ -772,6 +980,10 @@ VOID xint.protect()
Protect the topvar, so any future .set() calls on it Protect the topvar, so any future .set() calls on it
trigger a vcl failure. trigger a vcl failure.
Restricted to: ``client``.
.. _xint.protected(): .. _xint.protected():
BOOL xint.protected() BOOL xint.protected()
...@@ -779,6 +991,10 @@ BOOL xint.protected() ...@@ -779,6 +991,10 @@ BOOL xint.protected()
Return whether the topvar is protected. Return whether the topvar is protected.
Restricted to: ``client``.
.. _topvar.ip(): .. _topvar.ip():
new xip = topvar.ip([IP init]) new xip = topvar.ip([IP init])
...@@ -796,6 +1012,10 @@ IP xip.get([IP fallback]) ...@@ -796,6 +1012,10 @@ IP xip.get([IP fallback])
Return the value of the topvar or the `fallback` argument Return the value of the topvar or the `fallback` argument
if it is undefined. The default `fallback` is IPv4 0.0.0.0. if it is undefined. The default `fallback` is IPv4 0.0.0.0.
Restricted to: ``client``.
.. _xip.set(): .. _xip.set():
VOID xip.set(IP) VOID xip.set(IP)
...@@ -805,6 +1025,10 @@ Set the value of the topvar. ...@@ -805,6 +1025,10 @@ Set the value of the topvar.
Triggers a vcl failure for protected variables. Triggers a vcl failure for protected variables.
Restricted to: ``client``.
.. _xip.undefine(): .. _xip.undefine():
VOID xip.undefine() VOID xip.undefine()
...@@ -812,6 +1036,10 @@ VOID xip.undefine() ...@@ -812,6 +1036,10 @@ VOID xip.undefine()
Undefine the topvar. Undefine the topvar.
Restricted to: ``client``.
.. _xip.defined(): .. _xip.defined():
BOOL xip.defined() BOOL xip.defined()
...@@ -819,6 +1047,10 @@ BOOL xip.defined() ...@@ -819,6 +1047,10 @@ BOOL xip.defined()
Return whether the topvar is defined. Return whether the topvar is defined.
Restricted to: ``client``.
.. _xip.protect(): .. _xip.protect():
VOID xip.protect() VOID xip.protect()
...@@ -827,6 +1059,10 @@ VOID xip.protect() ...@@ -827,6 +1059,10 @@ VOID xip.protect()
Protect the topvar, so any future .set() calls on it Protect the topvar, so any future .set() calls on it
trigger a vcl failure. trigger a vcl failure.
Restricted to: ``client``.
.. _xip.protected(): .. _xip.protected():
BOOL xip.protected() BOOL xip.protected()
...@@ -834,6 +1070,10 @@ BOOL xip.protected() ...@@ -834,6 +1070,10 @@ BOOL xip.protected()
Return whether the topvar is protected. Return whether the topvar is protected.
Restricted to: ``client``.
.. _topvar.probe(): .. _topvar.probe():
new xprobe = topvar.probe([PROBE init]) new xprobe = topvar.probe([PROBE init])
...@@ -851,6 +1091,10 @@ PROBE xprobe.get([PROBE fallback]) ...@@ -851,6 +1091,10 @@ PROBE xprobe.get([PROBE fallback])
Return the value of the topvar or the `fallback` argument Return the value of the topvar or the `fallback` argument
if it is undefined. The default `fallback` is no backend. if it is undefined. The default `fallback` is no backend.
Restricted to: ``client``.
.. _xprobe.set(): .. _xprobe.set():
VOID xprobe.set(PROBE) VOID xprobe.set(PROBE)
...@@ -860,6 +1104,10 @@ Set the value of the topvar. ...@@ -860,6 +1104,10 @@ Set the value of the topvar.
Triggers a vcl failure for protected variables. Triggers a vcl failure for protected variables.
Restricted to: ``client``.
.. _xprobe.undefine(): .. _xprobe.undefine():
VOID xprobe.undefine() VOID xprobe.undefine()
...@@ -867,6 +1115,10 @@ VOID xprobe.undefine() ...@@ -867,6 +1115,10 @@ VOID xprobe.undefine()
Undefine the topvar. Undefine the topvar.
Restricted to: ``client``.
.. _xprobe.defined(): .. _xprobe.defined():
BOOL xprobe.defined() BOOL xprobe.defined()
...@@ -874,6 +1126,10 @@ BOOL xprobe.defined() ...@@ -874,6 +1126,10 @@ BOOL xprobe.defined()
Return whether the topvar is defined. Return whether the topvar is defined.
Restricted to: ``client``.
.. _xprobe.protect(): .. _xprobe.protect():
VOID xprobe.protect() VOID xprobe.protect()
...@@ -882,6 +1138,10 @@ VOID xprobe.protect() ...@@ -882,6 +1138,10 @@ VOID xprobe.protect()
Protect the topvar, so any future .set() calls on it Protect the topvar, so any future .set() calls on it
trigger a vcl failure. trigger a vcl failure.
Restricted to: ``client``.
.. _xprobe.protected(): .. _xprobe.protected():
BOOL xprobe.protected() BOOL xprobe.protected()
...@@ -889,6 +1149,10 @@ BOOL xprobe.protected() ...@@ -889,6 +1149,10 @@ BOOL xprobe.protected()
Return whether the topvar is protected. Return whether the topvar is protected.
Restricted to: ``client``.
.. _topvar.real(): .. _topvar.real():
new xreal = topvar.real([REAL init]) new xreal = topvar.real([REAL init])
...@@ -906,6 +1170,10 @@ REAL xreal.get([REAL fallback]) ...@@ -906,6 +1170,10 @@ REAL xreal.get([REAL fallback])
Return the value of the topvar or the `fallback` argument Return the value of the topvar or the `fallback` argument
if it is undefined. The default `fallback` is 0.0. if it is undefined. The default `fallback` is 0.0.
Restricted to: ``client``.
.. _xreal.set(): .. _xreal.set():
VOID xreal.set(REAL) VOID xreal.set(REAL)
...@@ -915,6 +1183,10 @@ Set the value of the topvar. ...@@ -915,6 +1183,10 @@ Set the value of the topvar.
Triggers a vcl failure for protected variables. Triggers a vcl failure for protected variables.
Restricted to: ``client``.
.. _xreal.undefine(): .. _xreal.undefine():
VOID xreal.undefine() VOID xreal.undefine()
...@@ -922,6 +1194,10 @@ VOID xreal.undefine() ...@@ -922,6 +1194,10 @@ VOID xreal.undefine()
Undefine the topvar. Undefine the topvar.
Restricted to: ``client``.
.. _xreal.defined(): .. _xreal.defined():
BOOL xreal.defined() BOOL xreal.defined()
...@@ -929,6 +1205,10 @@ BOOL xreal.defined() ...@@ -929,6 +1205,10 @@ BOOL xreal.defined()
Return whether the topvar is defined. Return whether the topvar is defined.
Restricted to: ``client``.
.. _xreal.protect(): .. _xreal.protect():
VOID xreal.protect() VOID xreal.protect()
...@@ -937,6 +1217,10 @@ VOID xreal.protect() ...@@ -937,6 +1217,10 @@ VOID xreal.protect()
Protect the topvar, so any future .set() calls on it Protect the topvar, so any future .set() calls on it
trigger a vcl failure. trigger a vcl failure.
Restricted to: ``client``.
.. _xreal.protected(): .. _xreal.protected():
BOOL xreal.protected() BOOL xreal.protected()
...@@ -944,6 +1228,10 @@ BOOL xreal.protected() ...@@ -944,6 +1228,10 @@ BOOL xreal.protected()
Return whether the topvar is protected. Return whether the topvar is protected.
Restricted to: ``client``.
.. _topvar.stevedore(): .. _topvar.stevedore():
new xstevedore = topvar.stevedore([STEVEDORE init]) new xstevedore = topvar.stevedore([STEVEDORE init])
...@@ -961,6 +1249,10 @@ STEVEDORE xstevedore.get([STEVEDORE fallback]) ...@@ -961,6 +1249,10 @@ STEVEDORE xstevedore.get([STEVEDORE fallback])
Return the value of the topvar or the `fallback` argument Return the value of the topvar or the `fallback` argument
if it is undefined. The default `fallback` is the default storage. if it is undefined. The default `fallback` is the default storage.
Restricted to: ``client``.
.. _xstevedore.set(): .. _xstevedore.set():
VOID xstevedore.set(STEVEDORE) VOID xstevedore.set(STEVEDORE)
...@@ -970,6 +1262,10 @@ Set the value of the topvar. ...@@ -970,6 +1262,10 @@ Set the value of the topvar.
Triggers a vcl failure for protected variables. Triggers a vcl failure for protected variables.
Restricted to: ``client``.
.. _xstevedore.undefine(): .. _xstevedore.undefine():
VOID xstevedore.undefine() VOID xstevedore.undefine()
...@@ -977,6 +1273,10 @@ VOID xstevedore.undefine() ...@@ -977,6 +1273,10 @@ VOID xstevedore.undefine()
Undefine the topvar. Undefine the topvar.
Restricted to: ``client``.
.. _xstevedore.defined(): .. _xstevedore.defined():
BOOL xstevedore.defined() BOOL xstevedore.defined()
...@@ -984,6 +1284,10 @@ BOOL xstevedore.defined() ...@@ -984,6 +1284,10 @@ BOOL xstevedore.defined()
Return whether the topvar is defined. Return whether the topvar is defined.
Restricted to: ``client``.
.. _xstevedore.protect(): .. _xstevedore.protect():
VOID xstevedore.protect() VOID xstevedore.protect()
...@@ -992,6 +1296,10 @@ VOID xstevedore.protect() ...@@ -992,6 +1296,10 @@ VOID xstevedore.protect()
Protect the topvar, so any future .set() calls on it Protect the topvar, so any future .set() calls on it
trigger a vcl failure. trigger a vcl failure.
Restricted to: ``client``.
.. _xstevedore.protected(): .. _xstevedore.protected():
BOOL xstevedore.protected() BOOL xstevedore.protected()
...@@ -999,6 +1307,10 @@ BOOL xstevedore.protected() ...@@ -999,6 +1307,10 @@ BOOL xstevedore.protected()
Return whether the topvar is protected. Return whether the topvar is protected.
Restricted to: ``client``.
.. _topvar.string(): .. _topvar.string():
new xstring = topvar.string([STRING init]) new xstring = topvar.string([STRING init])
...@@ -1016,6 +1328,10 @@ STRING xstring.get([STRING fallback]) ...@@ -1016,6 +1328,10 @@ STRING xstring.get([STRING fallback])
Return the value of the topvar or the `fallback` argument Return the value of the topvar or the `fallback` argument
if it is undefined. The default `fallback` is the empty string. if it is undefined. The default `fallback` is the empty string.
Restricted to: ``client``.
.. _xstring.set(): .. _xstring.set():
VOID xstring.set(STRING) VOID xstring.set(STRING)
...@@ -1025,6 +1341,10 @@ Set the value of the topvar. ...@@ -1025,6 +1341,10 @@ Set the value of the topvar.
Triggers a vcl failure for protected variables. Triggers a vcl failure for protected variables.
Restricted to: ``client``.
.. _xstring.undefine(): .. _xstring.undefine():
VOID xstring.undefine() VOID xstring.undefine()
...@@ -1032,6 +1352,10 @@ VOID xstring.undefine() ...@@ -1032,6 +1352,10 @@ VOID xstring.undefine()
Undefine the topvar. Undefine the topvar.
Restricted to: ``client``.
.. _xstring.defined(): .. _xstring.defined():
BOOL xstring.defined() BOOL xstring.defined()
...@@ -1039,6 +1363,10 @@ BOOL xstring.defined() ...@@ -1039,6 +1363,10 @@ BOOL xstring.defined()
Return whether the topvar is defined. Return whether the topvar is defined.
Restricted to: ``client``.
.. _xstring.protect(): .. _xstring.protect():
VOID xstring.protect() VOID xstring.protect()
...@@ -1047,6 +1375,10 @@ VOID xstring.protect() ...@@ -1047,6 +1375,10 @@ VOID xstring.protect()
Protect the topvar, so any future .set() calls on it Protect the topvar, so any future .set() calls on it
trigger a vcl failure. trigger a vcl failure.
Restricted to: ``client``.
.. _xstring.protected(): .. _xstring.protected():
BOOL xstring.protected() BOOL xstring.protected()
...@@ -1054,6 +1386,10 @@ BOOL xstring.protected() ...@@ -1054,6 +1386,10 @@ BOOL xstring.protected()
Return whether the topvar is protected. Return whether the topvar is protected.
Restricted to: ``client``.
.. _topvar.time(): .. _topvar.time():
new xtime = topvar.time([TIME init]) new xtime = topvar.time([TIME init])
...@@ -1071,6 +1407,10 @@ TIME xtime.get([TIME fallback]) ...@@ -1071,6 +1407,10 @@ TIME xtime.get([TIME fallback])
Return the value of the topvar or the `fallback` argument Return the value of the topvar or the `fallback` argument
if it is undefined. The default `fallback` is the epoch (1970/1/1 0:00:00 GMT). if it is undefined. The default `fallback` is the epoch (1970/1/1 0:00:00 GMT).
Restricted to: ``client``.
.. _xtime.set(): .. _xtime.set():
VOID xtime.set(TIME) VOID xtime.set(TIME)
...@@ -1080,6 +1420,10 @@ Set the value of the topvar. ...@@ -1080,6 +1420,10 @@ Set the value of the topvar.
Triggers a vcl failure for protected variables. Triggers a vcl failure for protected variables.
Restricted to: ``client``.
.. _xtime.undefine(): .. _xtime.undefine():
VOID xtime.undefine() VOID xtime.undefine()
...@@ -1087,6 +1431,10 @@ VOID xtime.undefine() ...@@ -1087,6 +1431,10 @@ VOID xtime.undefine()
Undefine the topvar. Undefine the topvar.
Restricted to: ``client``.
.. _xtime.defined(): .. _xtime.defined():
BOOL xtime.defined() BOOL xtime.defined()
...@@ -1094,6 +1442,10 @@ BOOL xtime.defined() ...@@ -1094,6 +1442,10 @@ BOOL xtime.defined()
Return whether the topvar is defined. Return whether the topvar is defined.
Restricted to: ``client``.
.. _xtime.protect(): .. _xtime.protect():
VOID xtime.protect() VOID xtime.protect()
...@@ -1102,6 +1454,10 @@ VOID xtime.protect() ...@@ -1102,6 +1454,10 @@ VOID xtime.protect()
Protect the topvar, so any future .set() calls on it Protect the topvar, so any future .set() calls on it
trigger a vcl failure. trigger a vcl failure.
Restricted to: ``client``.
.. _xtime.protected(): .. _xtime.protected():
BOOL xtime.protected() BOOL xtime.protected()
...@@ -1109,6 +1465,7 @@ BOOL xtime.protected() ...@@ -1109,6 +1465,7 @@ BOOL xtime.protected()
Return whether the topvar is protected. Return whether the topvar is protected.
Restricted to: ``client``.
SEE ALSO SEE ALSO
======== ========
...@@ -1120,26 +1477,28 @@ COPYRIGHT ...@@ -1120,26 +1477,28 @@ COPYRIGHT
:: ::
Copyright 2018 UPLEX Nils Goroll Systemoptimierung Copyright 2018-2022 UPLEX Nils Goroll Systemoptimierung
All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions modification, are permitted provided that the following conditions are
are met: met:
1. Redistributions of source code must retain the above copyright 1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer. notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright 2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution. documentation and/or other materials provided with the
distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SUCH DAMAGE. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
...@@ -62,18 +62,24 @@ will be initially undefined.\n \ ...@@ -62,18 +62,24 @@ will be initially undefined.\n \
$Method TYPE .get([TYPE fallback])\n \ $Method TYPE .get([TYPE fallback])\n \
Return the value of the topvar or the `fallback` argument\n \ Return the value of the topvar or the `fallback` argument\n \
if it is undefined. DEFDOC_ ## TYPE\n \ if it is undefined. DEFDOC_ ## TYPE\n \
$Restrict client\n \
$Method VOID .set(TYPE)\n \ $Method VOID .set(TYPE)\n \
Set the value of the topvar.\n\n \ Set the value of the topvar.\n\n \
Triggers a vcl failure for protected variables.\n \ Triggers a vcl failure for protected variables.\n \
$Restrict client\n \
$Method VOID .undefine()\n \ $Method VOID .undefine()\n \
Undefine the topvar.\n \ Undefine the topvar.\n \
$Restrict client\n \
$Method BOOL .defined()\n \ $Method BOOL .defined()\n \
Return whether the topvar is defined.\n \ Return whether the topvar is defined.\n \
$Restrict client\n \
$Method VOID .protect()\n \ $Method VOID .protect()\n \
Protect the topvar, so any future .set() calls on it\n \ Protect the topvar, so any future .set() calls on it\n \
trigger a vcl failure.\n \ trigger a vcl failure.\n \
$Restrict client\n \
$Method BOOL .protected()\n \ $Method BOOL .protected()\n \
Return whether the topvar is protected.\n Return whether the topvar is protected.\n \
$Restrict client\n
#include "tbl_types.h" #include "tbl_types.h"
SEE ALSO SEE ALSO
......
...@@ -37,9 +37,6 @@ varnish v1 \\ ...@@ -37,9 +37,6 @@ varnish v1 \\
} }
sub vcl_recv { sub vcl_recv {
if (req.url ~ "^/backend/") {
return (pass);
}
#define VCC_TYPE(TYPE, type) \ #define VCC_TYPE(TYPE, type) \
if (req.http.what == #type) { \ if (req.http.what == #type) { \
set req.http.def1-x = x ## type %% .defined(); \ set req.http.def1-x = x ## type %% .defined(); \
...@@ -58,30 +55,6 @@ varnish v1 \\ ...@@ -58,30 +55,6 @@ varnish v1 \\
return (hash); return (hash);
} }
sub vcl_backend_fetch {
if (bereq.url !~ "^/backend/") {
return (fetch);
} else
if (bereq.url ~ "/get$") {
set bereq.http.foo = xint.get();
} else
if (bereq.url ~ "/set$") {
xint.set(5);
} else
if (bereq.url ~ "/undefine$") {
xint.undefine();
} else
if (bereq.url ~ "/defined$") {
set bereq.http.foo = xint.defined();
} else
if (bereq.url ~ "/protect$") {
xint.protect();
} else
if (bereq.url ~ "/protected$") {
set bereq.http.foo = xint.protected();
}
}
sub vcl_deliver { sub vcl_deliver {
set resp.http.def1-x = req.http.def1-x; set resp.http.def1-x = req.http.def1-x;
set resp.http.def1-xd = req.http.def1-xd; set resp.http.def1-xd = req.http.def1-xd;
...@@ -117,38 +90,33 @@ client c ## type {\n \ ...@@ -117,38 +90,33 @@ client c ## type {\n \
} -run } -run
#include "../tbl_vtc.h" #include "../tbl_vtc.h"
client cget { varnish v1 -errvcl {Not available in subroutine} {
txreq -url "/backend/get" import topvar;
rxresp backend none none;
expect resp.status == 503 sub vcl_init {
} -run new xint = topvar.int();
}
client cset { sub vcl_backend_fetch {
txreq -url "/backend/set" if (bereq.url !~ "^/backend/") {
rxresp return (fetch);
expect resp.status == 503 } else
} -run if (bereq.url ~ "/get$") {
set bereq.http.foo = xint.get();
client cundefine { } else
txreq -url "/backend/undefine" if (bereq.url ~ "/set$") {
rxresp xint.set(5);
expect resp.status == 503 } else
} -run if (bereq.url ~ "/undefine$") {
xint.undefine();
client cdefined { } else
txreq -url "/backend/defined" if (bereq.url ~ "/defined$") {
rxresp set bereq.http.foo = xint.defined();
expect resp.status == 503 } else
} -run if (bereq.url ~ "/protect$") {
xint.protect();
client cprotect { } else
txreq -url "/backend/protect" if (bereq.url ~ "/protected$") {
rxresp set bereq.http.foo = xint.protected();
expect resp.status == 503 }
} -run }
}
client cprotected {
txreq -url "/backend/protected"
rxresp
expect resp.status == 503
} -run
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment