| 1 |
# |
| 2 |
# PRE: switch switch-attr-cmp |
| 3 |
# |
| 4 |
|
| 5 |
update request { |
| 6 |
Service-Type := Login-User |
| 7 |
Filter-Id := "Login-User" |
| 8 |
} |
| 9 |
|
| 10 |
switch &Service-Type { |
| 11 |
case "%{expr: 1 + 2}" { |
| 12 |
update reply { |
| 13 |
Filter-Id := "3" |
| 14 |
} |
| 15 |
} |
| 16 |
|
| 17 |
# |
| 18 |
# The Filter-Id will get printed to a string, |
| 19 |
# have the string parsed as a Service-Type attr, |
| 20 |
# and then that compared to the input Service-Type |
| 21 |
# |
| 22 |
case &Filter-Id { |
| 23 |
update reply { |
| 24 |
Filter-Id := "filter" |
| 25 |
} |
| 26 |
} |
| 27 |
|
| 28 |
case { |
| 29 |
update reply { |
| 30 |
Filter-Id := "default" |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
} |