Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mdns] add PublishKey() & UnpublishKey() methods #2022

Merged
merged 1 commit into from
Jan 19, 2024

Commits on Jan 19, 2024

  1. [mdns] add PublishKey() & UnpublishKey() methods

    This commit adds new methods in `Mdns::Publisher` to publish or
    unpublish a key record for a given (host or service instance) name.
    New methods are implemented for both MDNSResponder and Avahi
    sub-classes.
    
    In the MDNSResponder implementation, if a key registration is for a
    service instance name matching a service registration,
    `DNSServiceAddRecord()` is used to associate the new record with the
    service. Otherwise, `DNSServiceRegisterRecord()` is used to register
    the KEY record on its own. The implementation handles cases when
    related service and key registrations are updated or unregistered.
    
    This commit also simplifies and updates the `test/mdns/main.cpp`
    tests, adding a common `Test()` function that takes a function pointer
    to run the test and handles all common boilerplate code, as well as
    adding a common callback to check the registration result. New test
    cases are also added to check key registration, registering keys on
    their own, and registering keys and services in different orders.
    abtink committed Jan 19, 2024
    Configuration menu
    Copy the full SHA
    d1a8858 View commit details
    Browse the repository at this point in the history