mDNS service based on tinysvcmdns (https://bitbucket.org/geekman/tinysvcmdns) and its forks, adapted for use with the Humax HD/HDR-Fox T2 Custom Firmware https://hummy.tv/forum/forums/hd-hdr-fox-t2-customised-firmware.28/
Go to file
2020-10-16 15:10:50 +01:00
etc Fix service-control always shows not running. 2020-10-16 15:10:50 +01:00
opkg
.gitignore
LICENSE.txt
Makefile
mdns.c
mdns.h
mdnsd.c
mdnsd.h
README.markdown
testmdnsd.c

NOTICE FROM THE ORIGINAL AUTHOR

This project is un-maintained, and has been since 2013.

There are known vulnerabilities that have been disclosed, and quite possibly others that have yet to be disclosed. Refer to the issue tracker.

You are advised to NOT use this library for any new projects / products.

tinysvcmdns

tinysvcmdns is a tiny MDNS responder implementation for publishing services.

This implementation is only concerned with publishing services, without a system-wide daemon like Bonjour or Avahi. Its other goal is to be extremely small, embeddable, and have no external dependencies.

It only answers queries related to its own hostname (the A record), the service PTRs, and the "_services.dns-sd._udp.local" name, which advertises all services on a particular host.

Services consist of a single SRV and TXT record.

Decoding of MDNS packets is only done to retrieve the questions and answer RRs. The purpose for decoding answer RRs is to make sure the service PTR is not sent out if it is already included in the answer RRs.

Unicast queries are accepted but only legacy queries (non-mDNS source port) get a unicast response (think dig).

FILES

  • mdns.c - provides data structures, parsing & encoding of MDNS packets
  • mdns.h - interface to the above
  • mdnsd.c - implements the server socket, communication and thread
  • mdnsd.h - interface to the above
  • testmdnsd.c - an example that creates an instance until terminated

HISTORY

Darell Tan is the original author. His version, to which the Notice above refers, can be found at https://bitbucket.org/geekman/tinysvcmdns, and in a branch of this repository. Several forked versions can be found across the Internet. The version at https://github.com/philippe44/TinySVCmDNS is adapted for more platforms and addresses some of the issues in the original version. Meanwhile, the code was adopted as part of Samsung's TizenRT IOT framework, but without maintaining the change history between that version and the original. The TizenRT version implemented most of the RFC 6762/6763 features missing from the original version, and also fixed the known vulnerabilities mentioned in the Notice.

In 2012 the original version was adapted as a package for the Custom Firmware on the Humax HD/R-Fox T2 TV set-top boxes. This fork (let's call it HummyPkg) differed mostly in the testmdnsd.c program which was specialised for the package. However it did not track the changes in the original version. The branch named HummyPkg does so.

The HummyPkg version enabled other LAN devices to find the tinysvcmdns host, but only if they were able to resolve names by querying the mDNS service; this excluded other Humax CF boxes as they rely on a hosts file for name resolution. It also had to be restarted if the LAN IP address of the tinysvcmdns host changed, as would happen at startup using a WiFi dongle.

By reabsorbing the changes from the TizenRT version into the HummyPkg version and making some further enhancements, it has been possible to create a version named HummyNew that addresses those issues. This comprises a highly modified testmdnsd.c that can parse and write hosts files together with an almost fully featured mDNS implementation.

LICENSE

tinysvcmdns is licensed under the 3-clause ("modified") BSD License.

Copyright (C) 2011 Darell Tan

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.