Bonjour services sniffer code - objective-c

Is there a library or open sourced Obj C code that will let me sniff for all advertised Bonjour services on a network? Best if it works on Mac OS X or iOS.
Thx all.

You're spoilt for choice.
OS X ships with the mdns command for registering and browsing services on the link-local network. To browse for advertised websites (normally services of type _http._tcp.) you'd do this:
mdns -B _http._tcp
And a list will return and update pretty much instantly as things appear/disappear. Yes, it's open-sourced. Apple's C-based implementation of multicast DNS (both library and tools) compiles without much hassle on most *NIXes.
If you're looking for a GUI tool, I find the bonjour browser app from Tildesoft pretty useful.
If you don't want to use mdns to advertise your own services try the network beacon.

Related

Can I run a LabVIEW webservice from Raspberry Pi?

I noticed that there's a recent released apps that enables Raspberry Pi to run a deployed LabVIEW program all by itself and to set the program run as RPi boots. Since I was planning to remotely control the LabVIEW program through the internet using a Web UI, is it possible to setup a webservice of the program on the RPi? By the way, I'm currently planning to use RPi 2 for my project.
If I am getting you right you are about LINX at Makers hub: https://www.labviewmakerhub.com/doku.php?id=blog:users:makerhub:2016-04-07-linx-3
It is open source, free tool. You are free to modify and it and add custom command on LINX Firmware as I understand. After that, you can call LabVIEW Custom Command vi which is part of the API.
You can have a look on all API VIs here: https://www.labviewmakerhub.com/doku.php?id=learn:libraries:linx:reference:labview:start
From the discussion thread here:
We're running the LabVIEW Runtime on the target just like we do on our Linux based RIO devices. The great thing about using the full runtime is that you get the standard LabVIEW expereince with interactive mode, highlight execute, probes, startup executables, etc. This also means that all of the core LabVIEW functionality will work. One way to think about it is anything that works without explicitly installing it on the target from MAX should work on BBB/RPI. We actually don't plug into MAX at all. We currently do not support any toolkits or modules, but we've been experimenting with a couple to see what it would take to support things like web services.
So native LabVIEW web services aren't available yet, but may be coming soon - I'm sure development is responsive to what people ask for, so go to that discussion thread and let them know your interest.
You might be able to 'roll your own' simple web service using the TCP VI's, which as far as I can see should be available on the Raspberry Pi.
Note that deployment to Raspberry Pi or (BeagleBone Black) is only licensed for noncommercial use, as stated in the same thread.

Standard mDNS service on Windows

Does Windows (some modern flavour) have an mDNS server installed and/or running by default? If so then how does one tell it, preferably dynamically, to start/stop advertising a new service?
If there is no standard then how does one deal with the problem of conflicts trying to run multiple mDNS servers in that environment?
Basically, I want to implement a service that will run on Linux, Windows and Mac OS X and which needs to advertise its zeroconf webserver location using mDNS. On Linux I just use avahi-publish (or install a config file). I'm guessing that the answer will be straightforward for OS X. I'm struggling to find information for Windows.
Starting with Windows 10, Microsoft made strides towards a native Windows implementation of mDNS and DNS-SD.
While earlier iterations have been limited to UWP apps, a general Win32 API has been exposed from at least SDK version 10.0.18362.0 (1903/19H1, May 2019).
Note: This implementation is currently confirmed working only for 64bit build targets, there is an open issue preventing compilation for 32bit targets.
Outdated note from a previous version of this answer:
Early iterations resulted in mDNS network flooding:
Windows 10, in its default configuration, will spam its local networks
by responding to all mDNS requests with null response packets.
This issue was fixed in Windows 10 1511 (10586) and above
Last time I needed one, Apple's Bonjour Print Services for Windows was the most convenient mDNS client for Windows I could find. Only 5MB.
No, Microsoft doesn't directly support Multicast-DNS.
However, there appear to be several 3rd-party alternatives:
http://bens.me.uk/2013/multicast-dns-and-development-virtual-machines
http://en.wikipedia.org/wiki/Bonjour_%28software%29
http://www.icir.org/gregor/tools/autoconf-protocols.html
http://www.zeroconf.org/
... and ...
http://blogs.technet.com/b/networking/archive/2008/04/01/how-to-benefit-from-link-local-multicast-name-resolution.aspx
Have also successfully used C++/WinRT for dnssd discovery directly from C++ now. It appears from our perspective to be quicker and more reliable to query services and will let you easily install a watcher to get notifications when devices arrive etc. Of course, this is limited to versions of Windows 10 with support for C++/WinRT, which starts with 10.0.17134.0 (Windows 10, version 1803).
One caveat: We've noticed that it does not provide, nor recognise, a FQDN (trailing dot). So for a device that Bonjour OR Avahi would give an address of mydevice.local., Windows instead gives mydevice.local. Attempting to ping mydevice.local. under Windows 10 (1809) fails.
Windows 10 supports natively mDNS/Zeroconf, but only for modern APIs, not for Win32 applications.
If you have such an application, a third party service is required.
Source: https://social.technet.microsoft.com/Forums/en-US/8a0346de-2296-4f46-bc36-ff3fb13e283b/builtin-mdnsdnssd-zeroconf-support-in-windows-10
The short answer is to support both Avahi and Bonjour. You'll need Bonjour support to run on OSX anyway, and if a Windows user has installed iTunes they'll already be running it.
As a fallback for Windows users not running iTunes, you can compile Avahi as a library for Windows (with a bit of effort) and bundle it. This is a non-trivial bit of packaging, but the alternative is requiring your Windows users to install iTunes in order to use your application.

Can I determine whether the OS is run in a virtual machine in cocoa?

Maybe this is a cross-system issue, and maybe not. But I am just working on Mac OS X, therefore I focus on Cocoa.
As my title described, can I detect whether my application is run in an virtual environment programmatically? (not only vmware, but also some other virtual environment like Sandboxie in Windows)
There won't be any native Cocoa API's to specifically ask if you are running in a virtual machine vs real hardware.
However, if you know the potential environments you are running under you should be able to use IOKit to query the hardware of the virtual machine.
Virtual Machines will have considerably different hardware than a real Mac so you should be able to detect a real Mac vs a VM based on hardware configuration.
I can not give you any direct code, however, there is a section on Apple's site that discusses accessing hardware with IOKit in general:
https://developer.apple.com/library/mac/documentation/DeviceDrivers/Conceptual/AccessingHardware/AH_IOKitLib_API/AH_IOKitLib_API.html
IOKit is an advanced subject so if you do not have a lot of experience with the lower-level APIs you may find it a bit confusing as compared to Cocoa.
Maybe you can cross-compile virt-what and make use of it.
In addition to I/O Kit you could use C POSIX functions. Check the man pages.

board with webserver, email, snmp

I am looking for board, module, kit for our new project.
requierments:
necessary:
IP interface IPv4/IPv6
DHCP, StaticIp, ICMP(Ping)
SNMP V2, V3
HTTP, Webserver
Email
good to have:
Telnet
SSH
SysLog
There are two ways:
complete controlled modul + master(some 8-bit with rs232, spi, ..)
I've found this http://www.connectone.com/products.asp?did=73&pid=92
But there is probably problem with SMTP, it isnt direct supported. Only UDP.
some board with linux
Thanks for your advices and recommendation.
with such heavy requirements, i would definitely go for an embedded computer running linux or a lighter unix based kernel. it will give you some flexibility over the software package, and you will easily find some support.
(there are plenty of embedded computers on the market, i can't chose one...)
I've found this XPORT PRO from LANTRONIX.
http://www.lantronix.com/device-networking/embedded-device-servers/xport-pro.html
There is Linux, so all 'net' stuffs should be supported.
8MB SDRAM/16MB Flash
small, cheap
Do you have some experience with that?
The second tip is http://www.rabbit.com/
Very powerfull modules with C libraries.

Deploying a networked browser compatibility testing system

I need to provide our web developers an easy and quick way to test their code on multiple browsers. Here's my current plan:
Get a Mac
Install Windows XP and Linux over VMWare
Install all possible major browsers on these OSes, including on the Mac and the god-forsaken IE6.
This will allow developers to use the system to test their applications.
But is it possible to give them some sort of desktop sharing tool, so they can test remotely... keeping in mind that the their systems can be windows, linux(linus?) or macs.
Or am I doing it all wrong?
There are a few viable options I have used:
Get hardware. If you develop on Macs and have an old Windows box laying around, you might as well use it. You then need to figure out how you are going to connect to it. I have used:
(a) remote control tool (like VNC) to
a shared box. At one company we had a
IE6 testing box we all VNCed into
(b) Synergy on my desktop (which
allows sharing keyboard and mouse)
(c) Walking
VMs. Some developers like this because they have everything on one box, and can take it with them. You'll probably need multiple VMs for different versions of Windows. I've done this with both Parallels and VMWare.
External service. #chotchki mentioned one, but there are many others.
My current favorite is 1b, but they are all workable.
To answer your question: VMs are a reasonable solution.
There a web service that already does this Browser Shots. You can also install the software on your own systems if you want to host your own.