Skip to content

Commit cee25a8

Browse files
committed
DNS-SD support for multiple KISS ports and AGWPE
Dire Wolf 1.7 introduced the ability to configure multiple KISS TCP ports, each for a single radio channel. However, DNS Service Discovery announced only the first configured port. This set of changes expands DNS-SD support to announce all configured KISS TCP ports, and adds support for announcing the AGWPE port if configured. The functionality is available on both Linux and Mac. (Dire Wolf does not currently support DNS Service Discovery on Windows.) Details of these changes follow. On both Linux and Mac: * All configured KISS TCP and AGWPE ports are announced via DNS-SD. * Announcement messages include radio channel where appropriate. * Cleanup code added to gracefully shut down and de-register from DNS-SD on exit or error. * DNS-SD code now checks for services to publish, so that the caller doesn't need to do this. * Standard Dire Wolf style comments added for all functions. On Linux only: * Handling of service name collisions is now iterative rather than recursive. * No more gotos. On Mac only: * Now-complete implementation includes event loop for handling notifications from the DNS-SD daemon, which were previously lost. * As a consequence of the above, successful announcement message now appears in the console (as it did before only for Linux). * Text color set properly for console messages. These changes have been tested with as many combinations of config settings as possible, on Linux Mint 22.1 and macOS Sequoia 15.6.1.
1 parent 81ed8d0 commit cee25a8

File tree

6 files changed

+777
-142
lines changed

6 files changed

+777
-142
lines changed

src/direwolf.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@ int main (int argc, char *argv[])
11371137
kissnet_init (&misc_config);
11381138

11391139
#if (USE_AVAHI_CLIENT|USE_MACOS_DNSSD)
1140-
if (misc_config.kiss_port[0] > 0 && misc_config.dns_sd_enabled)
1140+
if (misc_config.dns_sd_enabled)
11411141
dns_sd_announce(&misc_config);
11421142
#endif
11431143

@@ -1692,6 +1692,10 @@ static void cleanup_linux (int x)
16921692
{
16931693
text_color_set(DW_COLOR_INFO);
16941694
dw_printf ("\nQRT\n");
1695+
#if (USE_AVAHI_CLIENT|USE_MACOS_DNSSD)
1696+
if (misc_config.dns_sd_enabled)
1697+
dns_sd_term ();
1698+
#endif
16951699
log_term ();
16961700
ptt_term ();
16971701
dwgps_term ();

0 commit comments

Comments
 (0)