Skip to content

Add DNS-SD service discovery - #21

Merged
tillkamppeter merged 1 commit into
OpenPrinting:mainfrom
Abd002:add-cupsdnssd-feature
Sep 17, 2026
Merged

tillkamppeter merged 1 commit into
OpenPrinting:mainfrom
Abd002:add-cupsdnssd-feature

Conversation

@Abd002

@Abd002 Abd002 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Description

Adds DNS-SD using cups/dnssd.h.

This is a CUPS 3-only API with no CUPS 2 equivalent, so the module is available only with #[cfg(cups3)].

API

Dnssd

  • new(error_sender: Sender<String>) -> Result<Self>
  • browse(...) -> Result<DnssdBrowser>
  • resolve(...) -> Result<DnssdResolver>
  • resolve_service(...) -> Result<DnssdServiceResolver>

Events and results

  • DnssdBrowseEvent -> discovered service information.
  • DnssdResolveEvent -> resolved service information.
  • DnssdResolvedService -> resolved service information including its current addresses.

These types expose the relevant data reported by libcups, including service identity, host, port, TXT records, and addresses.

DnssdServiceResolver

try_recv(&mut self) -> Result<Option<DnssdResolvedService>>

Resolves a service's SRV/TXT records and its A/AAAA addresses, returning a combined result. A new result is emitted whenever the service's address set changes.

Example

examples/discover_system_services.rs demonstrates browsing and resolving _ipp-system._tcp and _ipps-system._tcp services.

When building against CUPS 2, the example provides a #[cfg(not(cups3))] stub so that cargo build --examples continues to succeed.

@Abd002
Abd002 force-pushed the add-cupsdnssd-feature branch from 59fea7d to 70018b2 Compare September 16, 2026 16:39
@tillkamppeter
tillkamppeter merged commit 6f9863b into OpenPrinting:main Sep 17, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants