<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Courier New, monospace" size="2">
<div>Hi all,</div>
<div> </div>
<div>I have an issue when registering a service via the Avahi API. Below is a small code file that produces the issue. In the code file I put a comment where the error code -49 ("Not supported") is returned by the library. What am I doing wrong??</div>
<div> </div>
<div>I have Avahi 0.6.25 running on Fedora 13. Due to other restrictions I cannot upgrade to a higher version of Fedora and thus am "confined" to using Avahi 0.6.25 which is the highest version available in a binary version for this OS.</div>
<div>The configuration of Avahi (avahi-daemon.conf) is default and was not changed. The Avahi-daemon is running.</div>
<div> </div>
<div>In the code file I removed all other error detection and handling to prevent a large code file which might be harder to understand. The service is registered on another domain than .local which is where it goes wrong. If I change the code below and replace
AVAHI_PUBLISH_USE_WIDE_AREA with 0 (a zero) and "mydomain.com" with NULL, the service myservice._mytype._tcp.local can be found and resolved on another computer running Apple's Bonjour service.</div>
<div> </div>
<div>--------------- CODE START -------------------</div>
<div> </div>
<div>#include <avahi-client/publish.h></div>
<div>#include <avahi-common/error.h></div>
<div>#include <avahi-common/thread-watch.h></div>
<div> </div>
<div>static AvahiThreadedPoll* g_poll = NULL;</div>
<div>static AvahiClient* g_client = NULL;</div>
<div>static AvahiEntryGroup* g_group = NULL;</div>
<div> </div>
<div>void OnAvahiClientState(AvahiClient* client, AvahiClientState state, void* userdata)</div>
<div>{</div>
<div> switch (state)</div>
<div> {</div>
<div> case AVAHI_CLIENT_S_RUNNING:</div>
<div> if (NULL == group)</div>
<div> {</div>
<div> g_group = avahi_entry_group_new(client, OnAvahiEntryGroupState, userdata);</div>
<div> }</div>
<div> if ((NULL != group) && avahi_entry_group_is_empty(g_group))</div>
<div> {</div>
<div> int avahiError = avahi_entry_group_add_service(g_group,</div>
<div> AVAHI_IF_UNSPEC,</div>
<div> AVAHI_PUBLISH_USE_WIDE_AREA,</div>
<div> "myservice",</div>
<div> "_mytype._tcp",</div>
<div> "mydomain.com",</div>
<div> NULL,</div>
<div> 9999,</div>
<div> "txt=value",</div>
<div> NULL);</div>
<div> /* THIS IS WHERE avahiError IS -49 (AVAHI_ERR_NOT_SUPPORTED) */</div>
<div> }</div>
<div> }</div>
<div>}</div>
<div> </div>
<div>void OnAvahiEntryGroupState(AvahiEntryGroup* group, AvahiEntryGroupState state, void* userdata)</div>
<div>{</div>
<div> /* NOT RELEVANT FOR THIS EXAMPLE, JUST NEEDED FOR COMPILATION ;) */</div>
<div>}</div>
<div> </div>
<div>void main()</div>
<div>{</div>
<div> int avahiError = AVAHI_OK;</div>
<div> </div>
<div> g_poll = avahi_threaded_poll_new();</div>
<div> g_client = avahi_client_new(avahi_threaded_poll_get(g_poll,</div>
<div> AVAHI_CLIENT_NO_FAIL,</div>
<div> OnAvahiClientState,</div>
<div> NULL,</div>
<div> &avahiError);</div>
<div> avahiError = avahi_threaded_poll_start(g_poll);</div>
<div>}</div>
<div> </div>
<div>--------------- CODE END -------------------</div>
<div> </div>
<div>Marcel Versteeg</div>
<div>Bosch Security System BV</div>
<div>LOB Communication Systems, Software Competence Team (ST-CO/ENG1.4)</div>
<div><font face="Calibri, sans-serif" size="2"> </font></div>
</font>
</body>
</html>