I recently became aware that you can use a “in” operator in a command line query, for example:
/ip address print where address in 192.168.1.0/24
Is there a way to do this in the RouterOS API? I’ve read the API wiki page, but I can’t see it, and haven’t been able to figure it out with experimentation.
But could we hope to eventually get such support, or does this fall in the vain of regex in API queries (i.e. “No!”)?
Unlike regex, this check isn’t trivial on the client side (you have to parse the network address into a mask integer, then bitwise it against the address, also converted to an integer… not a trivial task in many languages), while it is such for the router (it does that pretty much all the time…), so I would hope that the (IMHO silly) excuse of “it’s more efficient for the router to send the reply” does not apply here.
(As far as syntax goes, I think “?@address=192.168.1.0/24” would be best, and is consistent in form with other query operators; But I’d like any other syntax just as well)