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: expose more Avahi configuration settings #678

Closed
troglobit opened this issue Oct 1, 2024 · 7 comments · Fixed by #833
Closed

mdns: expose more Avahi configuration settings #678

troglobit opened this issue Oct 1, 2024 · 7 comments · Fixed by #833
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@troglobit
Copy link
Contributor

troglobit commented Oct 1, 2024

Model proposal

Currently only possible to enable/disable the mDNS responder. Here are a few proposed updates to mDNS configuration support:

  container mdns {
    description "Advertise system and services over mDNS-SD, IPv4 and IPv6.";

    leaf enabled {
      description "Globally enable or disable mDNS/SD on all interfaces.";
      type boolean;
    }

    leaf domain {
      description "LAN domain name to register host name and services in.

                   Most common is .local, but some also use .lan, or .office,
                   usually this setting can be left as-is.";
      default "local";
      type inet:domain-name;
    }

    leaf-list allow-interfaces {
      description "Interfaces to act on, can be combined with deny-interfaces.

                   By defaullt all, except loopback and point-to-pint links.";
      type if:interface-ref;
    }

    leaf-list deny-interfaces {
      description "Interfaces to ignore.

                   Other not specified interfaces will be used, except loopback
                   and point-to-point, unless combined with allow-interfaces.

                   This option takes precedence over allow-interfaces.";
      type if:interface-ref;
    }

    leaf reflector {
      description "Reflect incoming mDNS requests to local interfaces.";
      type boolean;
    }

    leaf-list reflect-filter {
      description "Filter mDNS service names to reflect.

                   Example, for AirPlay and AirTunes, use:

                     - _airplay._tcp.local
                     - _raop._tcp.local

                   For AirPrint use:

                     - _printer._tcp.local
                     - _ipp._tcp.local
                     - _pdl-datastream._tcp.local

                   By defaullt all services are reflected.";
      type string;
    }
  }

Tree view

$ yanglint -f tree ietf-inet-types@2013-07-15.yang infix-services.yang 
module: ietf-inet-types

module: infix-services
  +--rw mdns
  |  +--rw enabled?            boolean
  |  +--rw domain?             inet:domain-name
  |  +--rw allow-interfaces*   if:interface-ref
  |  +--rw deny-interfaces*    if:interface-ref
  |  +--rw reflector?          boolean
  |  +--rw reflect-filter*     string
  +--rw web
     +--rw enabled?     boolean
     +--rw console
     |  +--rw enabled?   boolean
     +--rw netbrowse
     |  +--rw enabled?   boolean
     +--rw restconf
        +--rw enabled?   boolean
@troglobit troglobit added enhancement New feature or request feature triage Pending investigation & classification (CCB) labels Oct 1, 2024
@troglobit troglobit moved this to Todo in Infix & C:o Oct 7, 2024
@troglobit troglobit modified the milestones: Infix v24.10, Infix v24.11 Oct 7, 2024
@troglobit troglobit removed the triage Pending investigation & classification (CCB) label Oct 31, 2024
@troglobit troglobit modified the milestones: Infix v24.11, Infix v24.12 Nov 12, 2024
@troglobit troglobit modified the milestones: Infix v24.12, Infix v24.11 Nov 20, 2024
@troglobit
Copy link
Contributor Author

Stretch goal for v24.11.1

@troglobit troglobit changed the title mdns: add support for deny-interfaces mdns: expose more Avahi configuration settings Nov 20, 2024
@troglobit
Copy link
Contributor Author

Discuss

Plural vs singular form of allow-interfaces, deny-interfaces, reflect-filters, vs s: allow-interface, deny-interface, reflect-filter. I've used different styles in the proposal above to see if anyone picks up on it.

Consider the following CLI input:

admin@example:/config/mdns/> set allow-interfaces e1
admin@example:/config/mdns/> set allow-interfaces e2
admin@example:/config/mdns/> set allow-interfaces e3

vs the more concise:

admin@example:/config/mdns/> set allow-interface e1
admin@example:/config/mdns/> set allow-interface e2
admin@example:/config/mdns/> set allow-interface e3

troglobit added a commit that referenced this issue Nov 24, 2024
Fix #678

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
@troglobit troglobit mentioned this issue Nov 24, 2024
17 tasks
@jovatn
Copy link
Contributor

jovatn commented Nov 25, 2024

I spot "defaullt" in 'leaf domain' and 'leaf-list reflect-filter'.
@troglobit, is there a default for 'leaf reflector'? true or false?

@jovatn
Copy link
Contributor

jovatn commented Nov 25, 2024

I have no strong opinion on the plural or singular question. Do we have some similar setting to compare with? Perhaps "set client-if eth0" for DHCP client?

@troglobit
Copy link
Contributor Author

I spot "defaullt" in 'leaf domain' and 'leaf-list reflect-filter', is there a default for 'leaf reflector'? true or false?

The default is false, similar to the enabled leaf. But I get what you're going for, in the case of our products maybe true would be a better default?

@troglobit
Copy link
Contributor Author

troglobit commented Nov 25, 2024

I have no strong opinion on the plural or singular question. Do we have some similar setting to compare with? Perhaps "set client-if eth0" for DHCP client?

True, also a homegrown model, although loosely based on the IETF DHCPv6 model(s). Maybe the DHCP option list is also worth mentioning here as an example.

Let's bring it up with the rest of the team today!

@troglobit
Copy link
Contributor Author

troglobit commented Nov 25, 2024

After taking inventory of other (IETF) models, as well as looking at the YANG 1.1 RFC, it seems singular is the way to go. However, we'll side step the issue tough and go for a container interface { allow, deny } and a presence container for the reflector.

@troglobit troglobit linked a pull request Nov 25, 2024 that will close this issue
17 tasks
troglobit added a commit that referenced this issue Dec 3, 2024
Use container for interface allow/deny and for reflector settings.
Hopefully there will be more settings in the future, e.g., control
reflector interfaces independently.

Fix #678

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
troglobit added a commit that referenced this issue Dec 3, 2024
Use container for interface allow/deny and for reflector settings.
Hopefully there will be more settings in the future, e.g., control
reflector interfaces independently.

Fix #678

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
troglobit added a commit that referenced this issue Dec 4, 2024
Use container for interface allow/deny and for reflector settings.
Hopefully there will be more settings in the future, e.g., control
reflector interfaces independently.

Fix #678

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
troglobit added a commit that referenced this issue Dec 4, 2024
Use container for interface allow/deny and for reflector settings.
Hopefully there will be more settings in the future, e.g., control
reflector interfaces independently.

Fix #678

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
troglobit added a commit that referenced this issue Dec 4, 2024
Use container for interface allow/deny and for reflector settings.
Hopefully there will be more settings in the future, e.g., control
reflector interfaces independently.

Fix #678

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
@wkz wkz closed this as completed in #833 Dec 4, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Infix & C:o Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants