| 1 |
# |
| 2 |
# PRE: update array |
| 3 |
# |
| 4 |
|
| 5 |
update request { |
| 6 |
reply:Filter-Id := "filter" |
| 7 |
request:Tunnel-Server-Endpoint += '192.0.1.1' |
| 8 |
request:Tunnel-Server-Endpoint += '192.0.1.2' |
| 9 |
request:Tunnel-Server-Endpoint:1 += '192.0.1.1' |
| 10 |
request:Tunnel-Server-Endpoint:2 += '192.0.2.1' |
| 11 |
request:Tunnel-Server-Endpoint:2 += '192.0.2.2' |
| 12 |
request:Tunnel-Server-Endpoint:3 += '192.0.3.1' |
| 13 |
} |
| 14 |
|
| 15 |
# |
| 16 |
# Copy all Tunnel-Server-Endpoint attributes |
| 17 |
# |
| 18 |
update request { |
| 19 |
control:Tunnel-Server-Endpoint += &Tunnel-Server-Endpoint[*] |
| 20 |
} |
| 21 |
|
| 22 |
if ((&control:Tunnel-Server-Endpoint[0] != '192.0.1.1') || \ |
| 23 |
(&control:Tunnel-Server-Endpoint[1] != '192.0.1.2') || \ |
| 24 |
(&control:Tunnel-Server-Endpoint[2] != '192.0.1.1') || \ |
| 25 |
(&control:Tunnel-Server-Endpoint[3] != '192.0.2.1') || \ |
| 26 |
(&control:Tunnel-Server-Endpoint[4] != '192.0.2.2') || \ |
| 27 |
(&control:Tunnel-Server-Endpoint[5] != '192.0.3.1') || \ |
| 28 |
&control:Tunnel-Server-Endpoint[6]) { |
| 29 |
update reply { |
| 30 |
Filter-Id := "fail 0" |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
# |
| 35 |
# Clear out control attributes... |
| 36 |
# |
| 37 |
update control { |
| 38 |
Tunnel-Server-Endpoint !* ANY |
| 39 |
} |
| 40 |
|
| 41 |
# |
| 42 |
# Copy all Tunnel-Server-Endpoint attributes with tag 2 |
| 43 |
# |
| 44 |
update request { |
| 45 |
control:Tunnel-Server-Endpoint += &Tunnel-Server-Endpoint:2[*] |
| 46 |
} |
| 47 |
|
| 48 |
if ((&control:Tunnel-Server-Endpoint[0] != '192.0.2.1') || \ |
| 49 |
(&control:Tunnel-Server-Endpoint[1] != '192.0.2.2') || \ |
| 50 |
&control:Tunnel-Server-Endpoint[2]) { |
| 51 |
update reply { |
| 52 |
Filter-Id := "fail 1" |
| 53 |
} |
| 54 |
} |
| 55 |
|
| 56 |
# |
| 57 |
# Clear out control attributes... |
| 58 |
# |
| 59 |
update control { |
| 60 |
Tunnel-Server-Endpoint !* ANY |
| 61 |
} |
| 62 |
|
| 63 |
# |
| 64 |
# Copy all Tunnel-Server-Endpoint attributes with no tag |
| 65 |
# |
| 66 |
update request { |
| 67 |
control:Tunnel-Server-Endpoint += &Tunnel-Server-Endpoint:0[*] |
| 68 |
} |
| 69 |
|
| 70 |
if ((&control:Tunnel-Server-Endpoint[0] != '192.0.1.1') || \ |
| 71 |
(&control:Tunnel-Server-Endpoint[1] != '192.0.1.2') || \ |
| 72 |
&control:Tunnel-Server-Endpoint[2]) { |
| 73 |
update reply { |
| 74 |
Filter-Id := "fail 2" |
| 75 |
} |
| 76 |
} |
| 77 |
|
| 78 |
# |
| 79 |
# Clear out control attributes... |
| 80 |
# |
| 81 |
update control { |
| 82 |
Tunnel-Server-Endpoint !* ANY |
| 83 |
} |
| 84 |
|
| 85 |
# |
| 86 |
# Copy the first attribute with tag 2 (implicit) |
| 87 |
# |
| 88 |
update request { |
| 89 |
control:Tunnel-Server-Endpoint += &Tunnel-Server-Endpoint:2 |
| 90 |
} |
| 91 |
|
| 92 |
if ((&control:Tunnel-Server-Endpoint[0] != '192.0.2.1') || \ |
| 93 |
&control:Tunnel-Server-Endpoint[1]) { |
| 94 |
update reply { |
| 95 |
Filter-Id := "fail 3" |
| 96 |
} |
| 97 |
} |
| 98 |
|
| 99 |
# |
| 100 |
# Clear out control attributes... |
| 101 |
# |
| 102 |
update control { |
| 103 |
Tunnel-Server-Endpoint !* ANY |
| 104 |
} |
| 105 |
|
| 106 |
# |
| 107 |
# Copy the first attribute with tag 2 (explicit) |
| 108 |
# |
| 109 |
update request { |
| 110 |
control:Tunnel-Server-Endpoint += &Tunnel-Server-Endpoint:2[0] |
| 111 |
} |
| 112 |
|
| 113 |
if ((&control:Tunnel-Server-Endpoint[0] != '192.0.2.1') || \ |
| 114 |
&control:Tunnel-Server-Endpoint[1]) { |
| 115 |
update reply { |
| 116 |
Filter-Id := "fail 4" |
| 117 |
} |
| 118 |
} |