#include <errno.h>
#include <stdio.h>
+#include <avahi-common/domain.h>
+
#include "server.h"
-#include "util.h"
+#include "timeval.h"
#include "iface.h"
#include "socket.h"
#include "browse.h"
if (g->state == state)
return;
- g_assert(state >= AVAHI_ENTRY_GROUP_UNCOMMITED && state <= AVAHI_ENTRY_GROUP_COLLISION);
+ g_assert(state <= AVAHI_ENTRY_GROUP_COLLISION);
g->state = state;
static void entry_group_commit_real(AvahiEntryGroup *g) {
g_assert(g);
- g_get_current_time(&g->register_time);
+ gettimeofday(&g->register_time, NULL);
avahi_entry_group_change_state(g, AVAHI_ENTRY_GROUP_REGISTERING);
}
gint avahi_entry_group_commit(AvahiEntryGroup *g) {
- GTimeVal now;
+ struct timeval now;
g_assert(g);
g_assert(!g->dead);
AVAHI_RR_HOLDOFF_MSEC_RATE_LIMIT :
AVAHI_RR_HOLDOFF_MSEC));
- g_get_current_time(&now);
+ gettimeofday(&now, NULL);
if (avahi_timeval_compare(&g->register_time, &now) <= 0) {
/* Holdoff time passed, so let's start probing */
return ret;
}
-const gchar *avahi_strerror(gint error) {
- g_assert(-error >= 0 && -error < -AVAHI_ERR_MAX);
-
- const gchar * const msg[- AVAHI_ERR_MAX] = {
- "OK",
- "Operation failed",
- "Bad state",
- "Invalid host name",
- "Invalid domain name",
- "No suitable network protocol available",
- "Invalid DNS TTL",
- "Resource record key is pattern",
- "Local name collision",
- "Invalid record",
- "Invalid service name",
- "Invalid service type",
- "Invalid port number",
- "Invalid record key",
- "Invalid address",
- "Timeout reached",
- "Too many clients",
- "Too many objects",
- "Too many entries",
- "OS Error",
- "Access denied",
- "Invalid operation"
- };
-
- return msg[-error];
-}
-
gint avahi_server_errno(AvahiServer *s) {
g_assert(s);