How to develope PHP API to sniff packet from Mikrotik port

I wish to develop PHP API code for capturing streaming packet from Mikrotik port to PC.
Network Diagram is Mikrotik 192.168.88.98 (port 1)–> PC 192.168.88.1
I notice that there is a command " tool sniffer set interface=ether1 streaming-server=192.168.88.1
1.How do we develop the code? Can I use your api client with synchronous request?
2. How do we provide the configuration environment for PC? (setup FTP server or other?)

Thank you very much
Banatus S

The manual page for the packet sniffer command shows that the streaming server must implement the “Tazmen Sniffer Protocol (TZSP)”, so no. You can’t use an API client as the receiver for that. You can use Wireshark for that… or perhaps another program implementing that protocol.

The way in which you could use the sniffer from the API is by starting the sniffing, eventually stop it, and then “print” the results… or use the “quick” command. In both cases, we’re talking about doing it the same way as you’d do it from the command line, but automated.

Thank you Boen_robot :smiley:
I put sniffer command as show in mtik_sniff.jpg correctly.
The result are in wireshark program as show in wireshark.jpg properly.
I saw TZSP protocol in content of wireshark.
Question
1.How do I get test.pcap to PC or server whereas I run sniffer command or stopping sniffer command?
2. Do I need FTP server for question 1?
wireshare.jpg
mtik_sniff.jpg

1.How do I get test.pcap to PC or server whereas I run sniffer command or stopping sniffer command?
2. Do I need FTP server for question 1?

You get it in the same way as you’d get any other file out of RouterOS. (T)FTP is just one way… the best one in fact. You could also use Winbox, SSH (via clients that support SFTP), or even this function in my API client (which is a shortcut for an otherwise long workaround; the protocol itself does not intend for file contents to be readable over it).