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

feat: support name probing and conflict resolution #265

Merged
merged 18 commits into from
Nov 4, 2024
Merged

Conversation

keepsimple1
Copy link
Owner

@keepsimple1 keepsimple1 commented Oct 19, 2024

This is to resolve issue #264 . The main changes are:

Public API changes:

  • By default, name probing is enabled for publishing a service. Hence there will be around 1 second delay of successful service publishing.

  • A new API ServiceInfo::set_requires_probe() to allow users to disable probing (at the service level) if they are sure there are no conflicts. This could be used if the service publisher does not want any delay due to probing.

  • A new DaemonEvent::NameChange(DnsNameChange) is added to send notification about conflict resolution. DnsNameChange is like this:

#[derive(Clone, Debug)]
pub struct DnsNameChange {
    pub original: String,
    pub new_name: String,
    pub rr_type: u16,
    pub intf_name: String,
}
  • Standard DNS resource record types are exported as RR_TYPE_A, etc. It makes it easier to check the value of DnsNameChange.rr_type.

Minimum Rust version changed from 1.63.0 to 1.65.0 to allow usage of let ... else statement.

The example code register.rs now requires to specify a hostname to allow easier testing conflict resolution.

@keepsimple1 keepsimple1 merged commit 8b63fd7 into main Nov 4, 2024
3 checks passed
@keepsimple1 keepsimple1 deleted the probing branch November 4, 2024 05:27
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.

1 participant