The code is in c++ with winpcap (libpcap), and heavily extend with netcut needs. we need to have some free time to repackage it to smaller class so it can be useful to public.
however, for study purpose, here is the main idea, where you can try to build.
you can send probe packet per IP range base on your local IP or any new appear IP address from sniffer process. then have an process within sniff process to extract all the reponse to query. how does it sounds ?