chiark / gitweb /
fileio: add 'enforce_newline' argument to write_string_stream()
[elogind.git] / src / shared / verbs.h
index d59e4d59b8f0b79e611ec82fcadccd8bc124f5e7..03013beb8292944c2fa2718bbb4d6632842803a9 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#define VERB_ANY ((unsigned) -1)
-#define VERB_DEFAULT 1
+#include "in-addr-util.h"
 
-typedef struct {
-        const char *verb;
-        unsigned min_args, max_args;
-        unsigned flags;
-        int (* const dispatch)(int argc, char *argv[], void *userdata);
-} Verb;
+typedef struct DnsServer DnsServer;
+typedef enum DnsServerSource DnsServerSource;
 
-int dispatch_verb(int argc, char *argv[], const Verb verbs[], void *userdata);
+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);
+
+DnsServer* dns_server_ref(DnsServer *s);
+DnsServer* dns_server_unref(DnsServer *s);
+
+extern const struct hash_ops dns_server_hash_ops;