fix previous NEWS commit, oops
[ferm.git] / test / misc / defined.ferm
blob75ace600afd804dbf9a199a7585e328cfffd4a41
1 @def $a = 'AAA';
2 chain INPUT {
3     @if @defined($a) LOG log-prefix "a is defined: $a";
4     @if @defined($b) LOG log-prefix "b is not defined: $b";
5     @if @defined($c) LOG log-prefix "c is not yet defined: $c";
7     @def $c = 'CCC';
8     @if @defined($c) LOG log-prefix "c is now defined: $c";
10     proto tcp {
11         @def $c = 'CCC2';
12         @def $d = 'DDD';
13         @if @defined($a) LOG log-prefix "a is defined: $a";
14         @if @defined($b) LOG log-prefix "b is not defined: $b";
15         @if @defined($c) LOG log-prefix "c has new value: $c";
16         @if @defined($d) LOG log-prefix "d is defined: $d";
18         @def &func($e) = LOG log-prefix $e;
19         @if @defined(&func) LOG log-prefix "func is defined";
21         dport http {
22         @if @defined($c) LOG log-prefix "c still has new value: $c";
23             @if @defined($d) LOG log-prefix "d is still defined: $d";
24             @if @defined(&func) LOG log-prefix "func is still defined";
25         }
26     }
28     @if @defined($c) LOG log-prefix "c is still defined: $c";
29     @if @defined($d) LOG log-prefix "d is gone: $d";
30     @if @defined(&func) LOG log-prefix "func is gone";