if (i->interface == interface &&
i->protocol == protocol &&
strcasecmp(i->name, name) == 0 &&
if (i->interface == interface &&
i->protocol == protocol &&
strcasecmp(i->name, name) == 0 &&
- avahi_domain_equal(i->type, type) == 0 &&
- avahi_domain_equal(i->domain, domain) == 0)
+ avahi_domain_equal(i->type, type) &&
+ avahi_domain_equal(i->domain, domain))
static void print_service_line(Config *config, char c, AvahiIfIndex interface, AvahiProtocol protocol, const char *name, const char *type, const char *domain) {
char ifname[IF_NAMESIZE];
static void print_service_line(Config *config, char c, AvahiIfIndex interface, AvahiProtocol protocol, const char *name, const char *type, const char *domain) {
char ifname[IF_NAMESIZE];
interface != AVAHI_IF_UNSPEC ? if_indextoname(interface, ifname) : "n/a",
protocol != AVAHI_PROTO_UNSPEC ? avahi_proto_to_string(protocol) : "n/a",
n_columns-35, name, type, domain);
interface != AVAHI_IF_UNSPEC ? if_indextoname(interface, ifname) : "n/a",
protocol != AVAHI_PROTO_UNSPEC ? avahi_proto_to_string(protocol) : "n/a",
n_columns-35, name, type, domain);
}
static ServiceInfo *add_service(Config *c, AvahiIfIndex interface, AvahiProtocol protocol, const char *name, const char *type, const char *domain) {
}
static ServiceInfo *add_service(Config *c, AvahiIfIndex interface, AvahiProtocol protocol, const char *name, const char *type, const char *domain) {
" -c --cache Terminate after dumping all entries from the cache\n"
" -l --ignore-local Ignore local services\n"
" -r --resolve Resolve services found\n"
" -c --cache Terminate after dumping all entries from the cache\n"
" -l --ignore-local Ignore local services\n"
" -r --resolve Resolve services found\n"
- " -f --no-fail Don't fail if the server is not available\n"
-#ifdef HAVE_GDBM
- " -k --no-db-lookup Don't lookup service types\n");
+ " -f --no-fail Don't fail if the daemon is not available\n"
+#if defined(HAVE_GDBM) || defined(HAVE_DBM)
+ " -k --no-db-lookup Don't lookup service types\n"
+ " -b --dump-db Dump service type database\n"
}
static int parse_command_line(Config *c, const char *argv0, int argc, char *argv[]) {
}
static int parse_command_line(Config *c, const char *argv0, int argc, char *argv[]) {
{ "ignore-local", no_argument, NULL, 'l' },
{ "resolve", no_argument, NULL, 'r' },
{ "no-fail", no_argument, NULL, 'f' },
{ "ignore-local", no_argument, NULL, 'l' },
{ "resolve", no_argument, NULL, 'r' },
{ "no-fail", no_argument, NULL, 'f' },
{ "no-db-lookup", no_argument, NULL, 'k' },
{ "no-db-lookup", no_argument, NULL, 'k' },
+
+#if defined(HAVE_GDBM) || defined(HAVE_DBM)
+ case COMMAND_DUMP_STDB: {
+ char *t;
+ stdb_setent();
+
+ while ((t = stdb_getent())) {
+ if (config.no_db_lookup)
+ printf("%s\n", t);
+ else
+ printf("%s\n", stdb_lookup(t));
+ }
+
+ ret = 0;
+ break;
+ }
+#endif