summaryrefslogtreecommitdiffstats
path: root/avahi-daemon
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-08-13 22:04:21 +0000
committerLennart Poettering <lennart@poettering.net>2005-08-13 22:04:21 +0000
commit8b5cd6ffd9137b14b7ed678f10a551e3911e4a40 (patch)
tree58574af05d4632561961d3df07cc0a3052211be8 /avahi-daemon
parent7f5fd7ab759d8881e04f9edf31decdb000498fd1 (diff)
Rename some server side objects/symbols so that they do not conflict with the same things on the client side. i.e. AvahiEntryGroup -> AvahiSEntryGroup
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@310 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-daemon')
-rw-r--r--avahi-daemon/dbus-protocol.c64
-rw-r--r--avahi-daemon/main.c20
-rw-r--r--avahi-daemon/simple-protocol.c45
-rw-r--r--avahi-daemon/static-services.c14
4 files changed, 76 insertions, 67 deletions
diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c
index 117f30f..c30873e 100644
--- a/avahi-daemon/dbus-protocol.c
+++ b/avahi-daemon/dbus-protocol.c
@@ -61,7 +61,7 @@ typedef struct ServiceResolverInfo ServiceResolverInfo;
struct EntryGroupInfo {
guint id;
Client *client;
- AvahiEntryGroup *entry_group;
+ AvahiSEntryGroup *entry_group;
gchar *path;
gint n_entries;
@@ -71,7 +71,7 @@ struct EntryGroupInfo {
struct HostNameResolverInfo {
Client *client;
- AvahiHostNameResolver *host_name_resolver;
+ AvahiSHostNameResolver *host_name_resolver;
DBusMessage *message;
AVAHI_LLIST_FIELDS(HostNameResolverInfo, host_name_resolvers);
@@ -79,7 +79,7 @@ struct HostNameResolverInfo {
struct AddressResolverInfo {
Client *client;
- AvahiAddressResolver *address_resolver;
+ AvahiSAddressResolver *address_resolver;
DBusMessage *message;
AVAHI_LLIST_FIELDS(AddressResolverInfo, address_resolvers);
@@ -88,7 +88,7 @@ struct AddressResolverInfo {
struct DomainBrowserInfo {
guint id;
Client *client;
- AvahiDomainBrowser *domain_browser;
+ AvahiSDomainBrowser *domain_browser;
gchar *path;
AVAHI_LLIST_FIELDS(DomainBrowserInfo, domain_browsers);
@@ -97,7 +97,7 @@ struct DomainBrowserInfo {
struct ServiceTypeBrowserInfo {
guint id;
Client *client;
- AvahiServiceTypeBrowser *service_type_browser;
+ AvahiSServiceTypeBrowser *service_type_browser;
gchar *path;
AVAHI_LLIST_FIELDS(ServiceTypeBrowserInfo, service_type_browsers);
@@ -106,7 +106,7 @@ struct ServiceTypeBrowserInfo {
struct ServiceBrowserInfo {
guint id;
Client *client;
- AvahiServiceBrowser *service_browser;
+ AvahiSServiceBrowser *service_browser;
gchar *path;
AVAHI_LLIST_FIELDS(ServiceBrowserInfo, service_browsers);
@@ -114,7 +114,7 @@ struct ServiceBrowserInfo {
struct ServiceResolverInfo {
Client *client;
- AvahiServiceResolver *service_resolver;
+ AvahiSServiceResolver *service_resolver;
DBusMessage *message;
AVAHI_LLIST_FIELDS(ServiceResolverInfo, service_resolvers);
@@ -149,7 +149,7 @@ static void entry_group_free(EntryGroupInfo *i) {
g_assert(i);
if (i->entry_group)
- avahi_entry_group_free(i->entry_group);
+ avahi_s_entry_group_free(i->entry_group);
dbus_connection_unregister_object_path(server->bus, i->path);
g_free(i->path);
AVAHI_LLIST_REMOVE(EntryGroupInfo, entry_groups, i->client->entry_groups, i);
@@ -164,7 +164,7 @@ static void host_name_resolver_free(HostNameResolverInfo *i) {
g_assert(i);
if (i->host_name_resolver)
- avahi_host_name_resolver_free(i->host_name_resolver);
+ avahi_s_host_name_resolver_free(i->host_name_resolver);
dbus_message_unref(i->message);
AVAHI_LLIST_REMOVE(HostNameResolverInfo, host_name_resolvers, i->client->host_name_resolvers, i);
@@ -178,7 +178,7 @@ static void address_resolver_free(AddressResolverInfo *i) {
g_assert(i);
if (i->address_resolver)
- avahi_address_resolver_free(i->address_resolver);
+ avahi_s_address_resolver_free(i->address_resolver);
dbus_message_unref(i->message);
AVAHI_LLIST_REMOVE(AddressResolverInfo, address_resolvers, i->client->address_resolvers, i);
@@ -192,7 +192,7 @@ static void domain_browser_free(DomainBrowserInfo *i) {
g_assert(i);
if (i->domain_browser)
- avahi_domain_browser_free(i->domain_browser);
+ avahi_s_domain_browser_free(i->domain_browser);
dbus_connection_unregister_object_path(server->bus, i->path);
g_free(i->path);
AVAHI_LLIST_REMOVE(DomainBrowserInfo, domain_browsers, i->client->domain_browsers, i);
@@ -207,7 +207,7 @@ static void service_type_browser_free(ServiceTypeBrowserInfo *i) {
g_assert(i);
if (i->service_type_browser)
- avahi_service_type_browser_free(i->service_type_browser);
+ avahi_s_service_type_browser_free(i->service_type_browser);
dbus_connection_unregister_object_path(server->bus, i->path);
g_free(i->path);
AVAHI_LLIST_REMOVE(ServiceTypeBrowserInfo, service_type_browsers, i->client->service_type_browsers, i);
@@ -222,7 +222,7 @@ static void service_browser_free(ServiceBrowserInfo *i) {
g_assert(i);
if (i->service_browser)
- avahi_service_browser_free(i->service_browser);
+ avahi_s_service_browser_free(i->service_browser);
dbus_connection_unregister_object_path(server->bus, i->path);
g_free(i->path);
AVAHI_LLIST_REMOVE(ServiceBrowserInfo, service_browsers, i->client->service_browsers, i);
@@ -237,7 +237,7 @@ static void service_resolver_free(ServiceResolverInfo *i) {
g_assert(i);
if (i->service_resolver)
- avahi_service_resolver_free(i->service_resolver);
+ avahi_s_service_resolver_free(i->service_resolver);
dbus_message_unref(i->message);
AVAHI_LLIST_REMOVE(ServiceResolverInfo, service_resolvers, i->client->service_resolvers, i);
@@ -500,7 +500,7 @@ fail:
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
-static void entry_group_callback(AvahiServer *s, AvahiEntryGroup *g, AvahiEntryGroupState state, gpointer userdata) {
+static void entry_group_callback(AvahiServer *s, AvahiSEntryGroup *g, AvahiEntryGroupState state, gpointer userdata) {
EntryGroupInfo *i = userdata;
DBusMessage *m;
gint32 t;
@@ -557,7 +557,7 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m,
goto fail;
}
- avahi_entry_group_commit(i->entry_group);
+ avahi_s_entry_group_commit(i->entry_group);
return respond_ok(c, m);
@@ -568,7 +568,7 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m,
goto fail;
}
- avahi_entry_group_reset(i->entry_group);
+ avahi_s_entry_group_reset(i->entry_group);
return respond_ok(c, m);
} else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "IsEmpty")) {
@@ -580,7 +580,7 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m,
goto fail;
}
- b = !!avahi_entry_group_is_empty(i->entry_group);
+ b = !!avahi_s_entry_group_is_empty(i->entry_group);
reply = dbus_message_new_method_return(m);
dbus_message_append_args(reply, DBUS_TYPE_BOOLEAN, &b, DBUS_TYPE_INVALID);
@@ -597,7 +597,7 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m,
goto fail;
}
- state = avahi_entry_group_get_state(i->entry_group);
+ state = avahi_s_entry_group_get_state(i->entry_group);
return respond_int32(c, m, (gint32) state);
} else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "AddService")) {
@@ -722,7 +722,7 @@ fail:
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
-static void host_name_resolver_callback(AvahiHostNameResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event, const gchar *host_name, const AvahiAddress *a, gpointer userdata) {
+static void host_name_resolver_callback(AvahiSHostNameResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event, const gchar *host_name, const AvahiAddress *a, gpointer userdata) {
HostNameResolverInfo *i = userdata;
g_assert(r);
@@ -762,7 +762,7 @@ static void host_name_resolver_callback(AvahiHostNameResolver *r, AvahiIfIndex i
host_name_resolver_free(i);
}
-static void address_resolver_callback(AvahiAddressResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event, const AvahiAddress *address, const gchar *host_name, gpointer userdata) {
+static void address_resolver_callback(AvahiSAddressResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event, const AvahiAddress *address, const gchar *host_name, gpointer userdata) {
AddressResolverInfo *i = userdata;
g_assert(r);
@@ -845,7 +845,7 @@ fail:
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
-static void domain_browser_callback(AvahiDomainBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const gchar *domain, gpointer userdata) {
+static void domain_browser_callback(AvahiSDomainBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const gchar *domain, gpointer userdata) {
DomainBrowserInfo *i = userdata;
DBusMessage *m;
gint32 i_interface, i_protocol;
@@ -913,7 +913,7 @@ fail:
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
-static void service_type_browser_callback(AvahiServiceTypeBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const gchar *type, const gchar *domain, gpointer userdata) {
+static void service_type_browser_callback(AvahiSServiceTypeBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const gchar *type, const gchar *domain, gpointer userdata) {
ServiceTypeBrowserInfo *i = userdata;
DBusMessage *m;
gint32 i_interface, i_protocol;
@@ -983,7 +983,7 @@ fail:
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
-static void service_browser_callback(AvahiServiceBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const gchar *name, const gchar *type, const gchar *domain, gpointer userdata) {
+static void service_browser_callback(AvahiSServiceBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const gchar *name, const gchar *type, const gchar *domain, gpointer userdata) {
ServiceBrowserInfo *i = userdata;
DBusMessage *m;
gint32 i_interface, i_protocol;
@@ -1012,7 +1012,7 @@ static void service_browser_callback(AvahiServiceBrowser *b, AvahiIfIndex interf
}
static void service_resolver_callback(
- AvahiServiceResolver *r,
+ AvahiSServiceResolver *r,
AvahiIfIndex interface,
AvahiProtocol protocol,
AvahiResolverEvent event,
@@ -1278,7 +1278,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
AVAHI_LLIST_PREPEND(EntryGroupInfo, entry_groups, client->entry_groups, i);
client->n_objects++;
- if (!(i->entry_group = avahi_entry_group_new(avahi_server, entry_group_callback, i))) {
+ if (!(i->entry_group = avahi_s_entry_group_new(avahi_server, entry_group_callback, i))) {
entry_group_free(i);
return respond_error(c, m, avahi_server_errno(avahi_server), NULL);
}
@@ -1319,7 +1319,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
AVAHI_LLIST_PREPEND(HostNameResolverInfo, host_name_resolvers, client->host_name_resolvers, i);
client->n_objects++;
- if (!(i->host_name_resolver = avahi_host_name_resolver_new(avahi_server, (AvahiIfIndex) interface, (AvahiProtocol) protocol, name, (AvahiProtocol) aprotocol, host_name_resolver_callback, i))) {
+ if (!(i->host_name_resolver = avahi_s_host_name_resolver_new(avahi_server, (AvahiIfIndex) interface, (AvahiProtocol) protocol, name, (AvahiProtocol) aprotocol, host_name_resolver_callback, i))) {
host_name_resolver_free(i);
return respond_error(c, m, avahi_server_errno(avahi_server), NULL);
}
@@ -1362,7 +1362,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
AVAHI_LLIST_PREPEND(AddressResolverInfo, address_resolvers, client->address_resolvers, i);
client->n_objects++;
- if (!(i->address_resolver = avahi_address_resolver_new(avahi_server, (AvahiIfIndex) interface, (AvahiProtocol) protocol, &a, address_resolver_callback, i))) {
+ if (!(i->address_resolver = avahi_s_address_resolver_new(avahi_server, (AvahiIfIndex) interface, (AvahiProtocol) protocol, &a, address_resolver_callback, i))) {
address_resolver_free(i);
return respond_error(c, m, avahi_server_errno(avahi_server), NULL);
}
@@ -1415,7 +1415,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
AVAHI_LLIST_PREPEND(DomainBrowserInfo, domain_browsers, client->domain_browsers, i);
client->n_objects++;
- if (!(i->domain_browser = avahi_domain_browser_new(avahi_server, (AvahiIfIndex) interface, (AvahiProtocol) protocol, domain, (AvahiDomainBrowserType) type, domain_browser_callback, i))) {
+ if (!(i->domain_browser = avahi_s_domain_browser_new(avahi_server, (AvahiIfIndex) interface, (AvahiProtocol) protocol, domain, (AvahiDomainBrowserType) type, domain_browser_callback, i))) {
domain_browser_free(i);
return respond_error(c, m, avahi_server_errno(avahi_server), NULL);
}
@@ -1468,7 +1468,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
AVAHI_LLIST_PREPEND(ServiceTypeBrowserInfo, service_type_browsers, client->service_type_browsers, i);
client->n_objects++;
- if (!(i->service_type_browser = avahi_service_type_browser_new(avahi_server, (AvahiIfIndex) interface, (AvahiProtocol) protocol, domain, service_type_browser_callback, i))) {
+ if (!(i->service_type_browser = avahi_s_service_type_browser_new(avahi_server, (AvahiIfIndex) interface, (AvahiProtocol) protocol, domain, service_type_browser_callback, i))) {
service_type_browser_free(i);
return respond_error(c, m, avahi_server_errno(avahi_server), NULL);
}
@@ -1522,7 +1522,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
AVAHI_LLIST_PREPEND(ServiceBrowserInfo, service_browsers, client->service_browsers, i);
client->n_objects++;
- if (!(i->service_browser = avahi_service_browser_new(avahi_server, (AvahiIfIndex) interface, (AvahiProtocol) protocol, type, domain, service_browser_callback, i))) {
+ if (!(i->service_browser = avahi_s_service_browser_new(avahi_server, (AvahiIfIndex) interface, (AvahiProtocol) protocol, type, domain, service_browser_callback, i))) {
service_browser_free(i);
return respond_error(c, m, avahi_server_errno(avahi_server), NULL);
}
@@ -1568,7 +1568,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void
AVAHI_LLIST_PREPEND(ServiceResolverInfo, service_resolvers, client->service_resolvers, i);
client->n_objects++;
- if (!(i->service_resolver = avahi_service_resolver_new(avahi_server, (AvahiIfIndex) interface, (AvahiProtocol) protocol, name, type, domain, (AvahiProtocol) aprotocol, service_resolver_callback, i))) {
+ if (!(i->service_resolver = avahi_s_service_resolver_new(avahi_server, (AvahiIfIndex) interface, (AvahiProtocol) protocol, name, type, domain, (AvahiProtocol) aprotocol, service_resolver_callback, i))) {
service_resolver_free(i);
return respond_error(c, m, avahi_server_errno(avahi_server), NULL);
}
diff --git a/avahi-daemon/main.c b/avahi-daemon/main.c
index 94f89b3..a29ad9f 100644
--- a/avahi-daemon/main.c
+++ b/avahi-daemon/main.c
@@ -76,8 +76,8 @@ typedef struct {
#define RESOLV_CONF "/etc/resolv.conf"
-static AvahiEntryGroup *dns_servers_entry_group = NULL;
-static AvahiEntryGroup *resolv_conf_entry_group = NULL;
+static AvahiSEntryGroup *dns_servers_entry_group = NULL;
+static AvahiSEntryGroup *resolv_conf_entry_group = NULL;
static gchar **resolv_conf = NULL;
@@ -136,16 +136,16 @@ finish:
return ret;
}
-static AvahiEntryGroup* add_dns_servers(AvahiServer *s, AvahiEntryGroup* g, gchar **l) {
+static AvahiSEntryGroup* add_dns_servers(AvahiServer *s, AvahiSEntryGroup* g, gchar **l) {
gchar **p;
g_assert(s);
g_assert(l);
if (!g)
- g = avahi_entry_group_new(s, NULL, NULL);
+ g = avahi_s_entry_group_new(s, NULL, NULL);
- g_assert(avahi_entry_group_is_empty(g));
+ g_assert(avahi_s_entry_group_is_empty(g));
for (p = l; *p; p++) {
AvahiAddress a;
@@ -154,13 +154,13 @@ static AvahiEntryGroup* add_dns_servers(AvahiServer *s, AvahiEntryGroup* g, gcha
avahi_log_warn("Failed to parse address '%s', ignoring.", *p);
else
if (avahi_server_add_dns_server_address(s, g, -1, AF_UNSPEC, NULL, AVAHI_DNS_SERVER_RESOLVE, &a, 53) < 0) {
- avahi_entry_group_free(g);
+ avahi_s_entry_group_free(g);
avahi_log_error("Failed to add DNS server address: %s", avahi_strerror(avahi_server_errno(s)));
return NULL;
}
}
- avahi_entry_group_commit(g);
+ avahi_s_entry_group_commit(g);
return g;
}
@@ -168,10 +168,10 @@ static AvahiEntryGroup* add_dns_servers(AvahiServer *s, AvahiEntryGroup* g, gcha
static void remove_dns_server_entry_groups(void) {
if (resolv_conf_entry_group)
- avahi_entry_group_reset(resolv_conf_entry_group);
+ avahi_s_entry_group_reset(resolv_conf_entry_group);
if (dns_servers_entry_group)
- avahi_entry_group_reset(dns_servers_entry_group);
+ avahi_s_entry_group_reset(dns_servers_entry_group);
}
static void server_callback(AvahiServer *s, AvahiServerState state, void *userdata) {
@@ -479,7 +479,7 @@ static gboolean signal_callback(GIOChannel *source, GIOCondition condition, gpoi
static_service_add_to_server();
if (resolv_conf_entry_group)
- avahi_entry_group_reset(resolv_conf_entry_group);
+ avahi_s_entry_group_reset(resolv_conf_entry_group);
load_resolv_conf(&config);
diff --git a/avahi-daemon/simple-protocol.c b/avahi-daemon/simple-protocol.c
index 12d8adb..ec43049 100644
--- a/avahi-daemon/simple-protocol.c
+++ b/avahi-daemon/simple-protocol.c
@@ -65,9 +65,9 @@ struct Client {
gchar inbuf[BUFFER_SIZE], outbuf[BUFFER_SIZE];
guint inbuf_length, outbuf_length;
- AvahiHostNameResolver *host_name_resolver;
- AvahiAddressResolver *address_resolver;
- AvahiDNSServerBrowser *dns_server_browser;
+ AvahiSHostNameResolver *host_name_resolver;
+ AvahiSAddressResolver *address_resolver;
+ AvahiSDNSServerBrowser *dns_server_browser;
AvahiProtocol afquery;
@@ -94,13 +94,13 @@ static void client_free(Client *c) {
c->server->n_clients--;
if (c->host_name_resolver)
- avahi_host_name_resolver_free(c->host_name_resolver);
+ avahi_s_host_name_resolver_free(c->host_name_resolver);
if (c->address_resolver)
- avahi_address_resolver_free(c->address_resolver);
+ avahi_s_address_resolver_free(c->address_resolver);
if (c->dns_server_browser)
- avahi_dns_server_browser_free(c->dns_server_browser);
+ avahi_s_dns_server_browser_free(c->dns_server_browser);
g_source_remove_poll(&c->server->source, &c->poll_fd);
close(c->fd);
@@ -165,7 +165,7 @@ static void client_output_printf(Client *c, const gchar *format, ...) {
static void host_name_resolver_callback(
- AvahiHostNameResolver *r,
+ AvahiSHostNameResolver *r,
AvahiIfIndex iface,
AvahiProtocol protocol,
AvahiResolverEvent event,
@@ -189,7 +189,7 @@ static void host_name_resolver_callback(
}
static void address_resolver_callback(
- AvahiAddressResolver *r,
+ AvahiSAddressResolver *r,
AvahiIfIndex iface,
AvahiProtocol protocol,
AvahiResolverEvent event,
@@ -209,7 +209,16 @@ static void address_resolver_callback(
c->state = CLIENT_DEAD;
}
-static void dns_server_browser_callback(AvahiDNSServerBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *host_name, const AvahiAddress *a, uint16_t port, void* userdata) {
+static void dns_server_browser_callback(
+ AvahiSDNSServerBrowser *b,
+ AvahiIfIndex interface,
+ AvahiProtocol protocol,
+ AvahiBrowserEvent event,
+ const char *host_name,
+ const AvahiAddress *a,
+ uint16_t port,
+ void* userdata) {
+
Client *c = userdata;
gchar t[64];
@@ -254,15 +263,15 @@ static void handle_line(Client *c, const gchar *s) {
c->state = CLIENT_DEAD;
} else if (strcmp(cmd, "RESOLVE-HOSTNAME-IPV4") == 0 && n_args == 2) {
c->state = CLIENT_RESOLVE_HOSTNAME;
- if (!(c->host_name_resolver = avahi_host_name_resolver_new(avahi_server, -1, AF_UNSPEC, arg, c->afquery = AF_INET, host_name_resolver_callback, c)))
+ if (!(c->host_name_resolver = avahi_s_host_name_resolver_new(avahi_server, -1, AF_UNSPEC, arg, c->afquery = AF_INET, host_name_resolver_callback, c)))
goto fail;
} else if (strcmp(cmd, "RESOLVE-HOSTNAME-IPV6") == 0 && n_args == 2) {
c->state = CLIENT_RESOLVE_HOSTNAME;
- if (!(c->host_name_resolver = avahi_host_name_resolver_new(avahi_server, -1, AF_UNSPEC, arg, c->afquery = AF_INET6, host_name_resolver_callback, c)))
+ if (!(c->host_name_resolver = avahi_s_host_name_resolver_new(avahi_server, -1, AF_UNSPEC, arg, c->afquery = AF_INET6, host_name_resolver_callback, c)))
goto fail;
} else if (strcmp(cmd, "RESOLVE-HOSTNAME") == 0 && n_args == 2) {
c->state = CLIENT_RESOLVE_HOSTNAME;
- if (!(c->host_name_resolver = avahi_host_name_resolver_new(avahi_server, -1, AF_UNSPEC, arg, c->afquery = AF_UNSPEC, host_name_resolver_callback, c)))
+ if (!(c->host_name_resolver = avahi_s_host_name_resolver_new(avahi_server, -1, AF_UNSPEC, arg, c->afquery = AF_UNSPEC, host_name_resolver_callback, c)))
goto fail;
} else if (strcmp(cmd, "RESOLVE-ADDRESS") == 0 && n_args == 2) {
AvahiAddress addr;
@@ -272,22 +281,22 @@ static void handle_line(Client *c, const gchar *s) {
c->state = CLIENT_DEAD;
} else {
c->state = CLIENT_RESOLVE_ADDRESS;
- if (!(c->address_resolver = avahi_address_resolver_new(avahi_server, -1, AF_UNSPEC, &addr, address_resolver_callback, c)))
+ if (!(c->address_resolver = avahi_s_address_resolver_new(avahi_server, -1, AF_UNSPEC, &addr, address_resolver_callback, c)))
goto fail;
}
} else if (strcmp(cmd, "BROWSE-DNS-SERVERS-IPV4") == 0 && n_args == 1) {
c->state = CLIENT_BROWSE_DNS_SERVERS;
- if (!(c->dns_server_browser = avahi_dns_server_browser_new(avahi_server, -1, AF_UNSPEC, NULL, AVAHI_DNS_SERVER_RESOLVE, c->afquery = AF_INET, dns_server_browser_callback, c)))
+ if (!(c->dns_server_browser = avahi_s_dns_server_browser_new(avahi_server, -1, AF_UNSPEC, NULL, AVAHI_DNS_SERVER_RESOLVE, c->afquery = AF_INET, dns_server_browser_callback, c)))
goto fail;
client_output_printf(c, "+ Browsing ...\n");
} else if (strcmp(cmd, "BROWSE-DNS-SERVERS-IPV6") == 0 && n_args == 1) {
c->state = CLIENT_BROWSE_DNS_SERVERS;
- if (!(c->dns_server_browser = avahi_dns_server_browser_new(avahi_server, -1, AF_UNSPEC, NULL, AVAHI_DNS_SERVER_RESOLVE, c->afquery = AF_INET6, dns_server_browser_callback, c)))
+ if (!(c->dns_server_browser = avahi_s_dns_server_browser_new(avahi_server, -1, AF_UNSPEC, NULL, AVAHI_DNS_SERVER_RESOLVE, c->afquery = AF_INET6, dns_server_browser_callback, c)))
goto fail;
client_output_printf(c, "+ Browsing ...\n");
} else if (strcmp(cmd, "BROWSE-DNS-SERVERS") == 0 && n_args == 1) {
c->state = CLIENT_BROWSE_DNS_SERVERS;
- if (!(c->dns_server_browser = avahi_dns_server_browser_new(avahi_server, -1, AF_UNSPEC, NULL, AVAHI_DNS_SERVER_RESOLVE, c->afquery = AF_UNSPEC, dns_server_browser_callback, c)))
+ if (!(c->dns_server_browser = avahi_s_dns_server_browser_new(avahi_server, -1, AF_UNSPEC, NULL, AVAHI_DNS_SERVER_RESOLVE, c->afquery = AF_UNSPEC, dns_server_browser_callback, c)))
goto fail;
client_output_printf(c, "+ Browsing ...\n");
} else {
@@ -519,8 +528,8 @@ void simple_protocol_restart_queries(void) {
for (c = server->clients; c; c = c->clients_next)
if (c->state == CLIENT_BROWSE_DNS_SERVERS && c->dns_server_browser) {
- avahi_dns_server_browser_free(c->dns_server_browser);
- c->dns_server_browser = avahi_dns_server_browser_new(avahi_server, -1, AF_UNSPEC, NULL, AVAHI_DNS_SERVER_RESOLVE, c->afquery, dns_server_browser_callback, c);
+ avahi_s_dns_server_browser_free(c->dns_server_browser);
+ c->dns_server_browser = avahi_s_dns_server_browser_new(avahi_server, -1, AF_UNSPEC, NULL, AVAHI_DNS_SERVER_RESOLVE, c->afquery, dns_server_browser_callback, c);
}
}
diff --git a/avahi-daemon/static-services.c b/avahi-daemon/static-services.c
index 659d007..ff2602f 100644
--- a/avahi-daemon/static-services.c
+++ b/avahi-daemon/static-services.c
@@ -63,7 +63,7 @@ struct StaticServiceGroup {
gchar *name, *chosen_name;
gboolean replace_wildcards;
- AvahiEntryGroup *entry_group;
+ AvahiSEntryGroup *entry_group;
AVAHI_LLIST_HEAD(StaticService, services);
AVAHI_LLIST_FIELDS(StaticServiceGroup, groups);
};
@@ -153,7 +153,7 @@ static void static_service_group_free(StaticServiceGroup *g) {
g_assert(g);
if (g->entry_group)
- avahi_entry_group_free(g->entry_group);
+ avahi_s_entry_group_free(g->entry_group);
while (g->services)
static_service_free(g->services);
@@ -166,7 +166,7 @@ static void static_service_group_free(StaticServiceGroup *g) {
g_free(g);
}
-static void entry_group_callback(AvahiServer *s, AvahiEntryGroup *eg, AvahiEntryGroupState state, gpointer userdata) {
+static void entry_group_callback(AvahiServer *s, AvahiSEntryGroup *eg, AvahiEntryGroupState state, gpointer userdata) {
StaticServiceGroup *g = userdata;
g_assert(s);
@@ -202,9 +202,9 @@ static void add_static_service_group_to_server(StaticServiceGroup *g) {
g->chosen_name = g_strdup(g->name);
if (!g->entry_group)
- g->entry_group = avahi_entry_group_new(avahi_server, entry_group_callback, g);
+ g->entry_group = avahi_s_entry_group_new(avahi_server, entry_group_callback, g);
- g_assert(avahi_entry_group_is_empty(g->entry_group));
+ g_assert(avahi_s_entry_group_is_empty(g->entry_group));
for (s = g->services; s; s = s->services_next) {
@@ -223,14 +223,14 @@ static void add_static_service_group_to_server(StaticServiceGroup *g) {
}
}
- avahi_entry_group_commit(g->entry_group);
+ avahi_s_entry_group_commit(g->entry_group);
}
static void remove_static_service_group_from_server(StaticServiceGroup *g) {
g_assert(g);
if (g->entry_group)
- avahi_entry_group_reset(g->entry_group);
+ avahi_s_entry_group_reset(g->entry_group);
}
typedef enum {