Ticket #198 (new enhancement)

Opened 4 years ago

Last modified 2 weeks ago

Local only services

Reported by: yavor Owned by: lennart
Milestone: Component: avahi-core
Keywords: Cc: andrew@…

Description

This is a feature that is implemented in Bonjour, but it is missing from Avahi. When using Bonjour, one can call DNSServiceRegister with parameter kDNSServiceInterfaceIndexLocalOnly (defined as -1). This registration will result in local only service.

This feature is really powerful on the Desktop. For example you can publishing DAAP services, which can be picked up by music players like Rhythmbox, Banshee, Amarok etc. Anyone that knows DAAP. Only processes on same machine can see those services.

I made a patch attempting to implement the feature.

Basically I was able to transfer registered local services into the cache without receiving messages on the network. Of course that is just one step. The cache needs to be kept up to date. I used the following call to test:

avahi_server_add_service(server, group, 1, AVAHI_PROTO_UNSPEC,

AVAHI_PUBLISH_NO_ANNOUNCE, "My Service Name", "_daap._tcp", NULL, NULL, 7777, "foo", NULL);

I used avahi-0.6.21 source.

Attachments

patch.txt (2.1 kB) - added by yavor 4 years ago.
patch
avahi-core.patch (1.8 kB) - added by Arthur_van_Hoff@… 4 years ago.
Patch to enable LOOPBACK interface.
avahi-utils.patch (9.4 kB) - added by Arthur_van_Hoff@… 4 years ago.
Patch to add -i option to specify an interface to avahi command line tools.
avahi-man.patch (1.7 kB) - added by Arthur_van_Hoff@… 4 years ago.
Patch to document -i option in for avahi tools.

Change History

Changed 4 years ago by yavor

patch

Changed 4 years ago by Arthur_van_Hoff@…

This is a feature that we would love to see in the general distribution. I applied the suggested patch and verified that it worked on svn revision 1746.

It would be nice to add a AVAHI_IF_LOCALONLY constant with value 1.

Specifying an invalid interface index currently does not result in an error, but it really should. You can check if an interface is valid using if_indextoname from net/if.h.

The avahi-publish command should have an optional -i argument to specify the interface index on which to publish.

Changed 4 years ago by Arthur_van_Hoff@…

There are some problems with this patch. After a while (presumably when the service is reregistered) duplicates start showing up. I'm looking for an alternative solution.

Changed 4 years ago by Arthur_van_Hoff@…

Patch to enable LOOPBACK interface.

Changed 4 years ago by Arthur_van_Hoff@…

Patch to add -i option to specify an interface to avahi command line tools.

Changed 4 years ago by Arthur_van_Hoff@…

Patch to document -i option in for avahi tools.

Changed 4 years ago by Arthur_van_Hoff@…

I've attached a patch to enable the LOOPBACK interface. This allows for the registration of services that are only locally accessible.

I've also attached a patch for avahi-publish, avahi-browse, and avahi-resolve which adds a -i argument to each command to specify an interface. This is useful for testing this change.

Changed 2 weeks ago by andrewtj

  • cc andrew@… added
Note: See TracTickets for help on using tickets.