chiark / gitweb /
Prep v232: Do not listen to SYSTEMD_* environment variables to override things.
[elogind.git] / src / basic / verbs.h
index 03013beb8292944c2fa2718bbb4d6632842803a9..7b5e18510f1099001daeea1fc7055dec0ebe18cb 100644 (file)
@@ -1,5 +1,3 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
 #pragma once
 
 /***
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include "in-addr-util.h"
-
-typedef struct DnsServer DnsServer;
-typedef enum DnsServerSource DnsServerSource;
-
-typedef enum DnsServerType {
-        DNS_SERVER_SYSTEM,
-        DNS_SERVER_FALLBACK,
-        DNS_SERVER_LINK,
-} DnsServerType;
-
-#include "resolved-link.h"
-
-struct DnsServer {
-        Manager *manager;
-
-        unsigned n_ref;
-
-        DnsServerType type;
-
-        Link *link;
-
-        int family;
-        union in_addr_union address;
-
-        bool marked:1;
-
-        LIST_FIELDS(DnsServer, servers);
-};
-
-int dns_server_new(
-                Manager *m,
-                DnsServer **s,
-                DnsServerType type,
-                Link *l,
-                int family,
-                const union in_addr_union *address);
+#define VERB_ANY ((unsigned) -1)
+#define VERB_DEFAULT 1U
+#define VERB_NOCHROOT 2U
 
-DnsServer* dns_server_ref(DnsServer *s);
-DnsServer* dns_server_unref(DnsServer *s);
+typedef struct {
+        const char *verb;
+        unsigned min_args, max_args;
+        unsigned flags;
+        int (* const dispatch)(int argc, char *argv[], void *userdata);
+} Verb;
 
-extern const struct hash_ops dns_server_hash_ops;
+int dispatch_verb(int argc, char *argv[], const Verb verbs[], void *userdata);