Skip to content

Commit

Permalink
Displaying mDNS entries individually
Browse files Browse the repository at this point in the history
  • Loading branch information
wberube committed Aug 5, 2024
1 parent dd07937 commit 5281abc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This project strives to adopt a KISS "keep it simple, stupid!" structure while b

Compared to most streamer software solutions available to this day, it attaches to the application-specific peripherals of a system-on-a-chip using an easy to understand HAL platform (hardware abstraction layer) proper to each chip series it supports.

Since it is exclusively using dynamic linking, its executable remains particularly compact and can be run on a multitude of environments, including in a tethered context (e.g. running from a temporary filesystem on read-only systems).
Since it is using runtime dynamic linking, its executable remains particularly compact and can be run on a multitude of environments, including in a tethered context (e.g. running from a temporary filesystem on read-only systems).

In spite of these design choices, Divinus boasts numerous features that cater to a wide range of uses you will be able to make of it.

Expand Down
2 changes: 1 addition & 1 deletion src/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

---

The following software is included in this product under lib/shine: @toots/shine.
The following software is included in this product under src/lib/shine: @toots/shine.
A copy of the original source code may be downloaded from git+https://github.com/toots/shine
It is accompanied by following license and notice below:

Expand Down
8 changes: 5 additions & 3 deletions src/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,18 @@ int start_mdns() {
for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
if (!ifa->ifa_addr || ifa->ifa_addr->sa_family != AF_INET) continue;
if (ifa->ifa_flags & IFF_LOOPBACK) continue;

struct sockaddr_in *addr = (struct sockaddr_in *)ifa->ifa_addr;

if (!configured) {
inet_ntop(AF_INET, &addr->sin_addr.s_addr, ipaddr, sizeof(ipaddr));
HAL_INFO("mdns", "Setting hostname %s for host %s...\n", hostname, ipaddr);

HAL_INFO("mdns", "Setting hostname %s...\n", hostname);
mdnsd_set_hostname(mdns, uts.nodename, addr->sin_addr.s_addr);
configured = 1;
}

struct rr_entry *entry = NULL;
inet_ntop(AF_INET, &addr->sin_addr.s_addr, ipaddr, sizeof(ipaddr));
HAL_INFO("mdns", "Adding an A entry for IP %s...\n", ipaddr);
entry = rr_create_a(create_nlabel(hostname), addr->sin_addr.s_addr);
mdnsd_add_rr(mdns, entry);
}
Expand Down

0 comments on commit 5281abc

Please sign in to comment.