It returns all adresses starting with 172.
I couldnt find a way o do it in the PHP API, this is one of the commands i tried:
$API->write(‘/ppp/active/print’,false);
$API->write(‘=where=’,false);
$API->write(‘?address=~172.’);
$READ = $API->read(false);
$ARRAY = $API->parse_response($READ);
I also tried:
‘?address~“^172”’
‘?address~“172.”’
‘~address~“^172”’
everything with and without the " (double slashes)
No luck, it always returns 0 matches, but if i do:
‘?address=some.ip.adress’
It works.
No, because this is a problem with the protocol itself, not the client.
You can always do the filtering on the client side, with this being easier with some clients than with others, but either way - all responses will have to travel between the router and the web server. With some clients (such as the one from my signature), there is also a way to process responses one by one, rather than together, but that only helps your web server’s memory, not your network bandwidth.
If keeping your web server’s memory consumption low is exactly what you’re worried about, using my client, you can keep it low like this:
$printRequest = new Request('/ppp/active/print');
$printRequest->setTag('p');
$client->sendAsync($printRequest, function($response) {
if (preg_match('/^172\./', $response->getArgument('address')) {
//Match
}
});
$client->loop();
[edit]Yeah, my bad… Although router-side regex filtering is not possible with the protocol, there is some other filtering with queries. You can check out this tutorial for details on how they’re done with my client.[/edit]