vfs_fruit: Time Machine/FULLSYNC: add mDNS/DNS-SD advertisement

Omri Mor omri50 at gmail.com
Fri Jul 21 07:22:08 UTC 2017


> On Jul 20, 2017, at 23:29, Volker Lendecke <Volker.Lendecke at SerNet.DE> wrote:
>> On Wed, Jul 19, 2017 at 05:47:09PM -0700, Omri Mor wrote:
>> Is there a way to iterate over all service numbers?
> 
> num = lp_numservices();
> for (snum=0; snum<num; snum++) {
> };
> 
> Look at init_srv_share_info_ctr() for an example.

So something along the lines of the following should work:

int num_services = 0;
int snum;

num_services = lp_numservices();
for (snum = 0; snum < num_services; snum++) {
	if (lp_snum_ok(snum) && lp_parm_bool(snum, “fruit”, “time machine”, false)) {
		/* Set up _adisk._tcp */
	}
}

This would be have to be in the Avahi / dns_sd files.
But if we’re OK with a tight coupling like this (which I really would prefer to avoid, but can’t see any way around), I think it should work.
We could add in a check for lp_browseable(snum), but I don’t know if it’s necessary.

Thoughts, comments, objections, alternatives?

Omri


More information about the samba-technical mailing list