I have an Ubiquiti Access Point in my network and via wireshark i can see that it sends a broadcast via ARP (as you can see in the image below):
Now I wanted to filter for this fixed Prefix "Ubiquiti_" to get the devices MAC and IP adress dynamically (without knowing them beforehand). I have searched for broadcast / arp node js packages but most of them are programmed in a way, where you need to know the IP of the device you want to listen to - and in this case I would like to do that dynamically.
If I could somehow get the same result via a nodejs package / code that I get currently via Wireshark at the moment, it would solve my problem.
Any tips or hints appreciated!
I found two solutions by now. If anyone has a similar problem, please try these:
the npm package "local-devices" accesses the ARP table and returns all the IPs and MAC adresses. That combined with an vendor oui (Organizationally unique identifier) database allows to filter for the ubiquiti device.
with the dgram dependency i start a server that listens on a configured port. in my case i needed to listen on port 10001 for the message that gets send by the ubiquiti. With dgrams on('message', ..) i can get the message aswell as the IP adress of the ubiquiti and work with that