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) {
- fprintf(f,
- "%s [options] <service type>\n"
- "%s [options] -a\n"
- "%s [options] -D\n\n"
+ if (strstr(argv0, "domain"))
+ fprintf(f, "%s [options] \n\n", argv0);
+ else
+ fprintf(f,
+ "%s [options] <service type>\n"
+ "%s [options] -a\n"
+ "%s [options] -D\n"
+#if defined(HAVE_GDBM) || defined(HAVE_DBM)
+ "%s [options] -b\n",
+#endif
+ "\n",
+ argv0, argv0, argv0);
+
+ fprintf(f,
" -h --help Show this help\n"
" -V --version Show version\n"
" -D --browse-domains Browse for browsing domains instead of services\n"
" -h --help Show this help\n"
" -V --version Show version\n"
" -D --browse-domains Browse for browsing domains instead of services\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"
" -c --cache Terminate after dumping all entries from the cache\n"
" -l --ignore-local Ignore local services\n"
" -r --resolve Resolve services found\n"
-static int parse_command_line(Config *c, 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 (parse_command_line(&config, argc, argv) < 0)
+ if (parse_command_line(&config, argv0, argc, argv) < 0)
+
+#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