looked around some more and found an alternative which will do the trick i believe, would this be acceptable code or is there something to change / make better?
please dont focus on the specifics, used variables might not make sense, it is the general idea.
class all_app_classes {
class_app1
class_app2
}
class class_app1 {
"ip" {"192.168.34.23"}
"port" {"45"}
"pool" {"pool_1"}
}
class class_app2 {
{
"ip" {"192.145.224.23"}
"port" {"55"}
"pool" {"pool_2"}
}
set id [class startsearch all_app_classes]
while { [class anymore all_app_classes $id] } {
set x [class nextelement all_app_classes $id]
set app_class [lindex $x 0]
log local0. "$app_class"
if { [TCP::local_port] == [class match -value port equals $app_class] and [IP::client_addr] == [class match -value ip equals $app_class] } {
log local0. "$app_class is the right class"
set saved_class $app_class
}
}
pool [class match -value pool equals $saved_class]