Systemd/src/resolve/resolve-tool.h
Lennart Poettering 088c136384 resolve-tool: provide resolvconf(8) compatibility
This turns resolve-tool into a multi-call binary. When invoked as
"resolvconf" it provides minimal compatibility with the resolvconf(8)
tool of various distributions (and FreeBSD as it appears).

This new interface understands to varying degrees features of the two
major implementations of resolvconf(8): Debian's original one and
"openresolv". Specifically:

Fully supported:

        -a -d (supported by all implementations)
        -f    (introduced by openresolv)

Somewhat supported:

        -x    (introduced by openresolv, mapped to a '~.' domain entry)

Unsupported and ignored:

        -m -p (introduced by openresolv, not really necessary for us)

Unsupported and resulting in failure:
        -u    (supported by all other implementations)
        -I -i -l -R -r -v -V
              (all introduced by openresolv)
        --enable-updates --disable-updates --updates-are-enabled
              (specific to Debian's implementation)

Of course, resolvconf(8) is a tool with multiple backends, in our
implementation systemd-resolved is the only backend.

Fixes: #7202
2018-03-02 15:48:46 +01:00

31 lines
713 B
C

/* SPDX-License-Identifier: LGPL-2.1+ */
#include <in-addr-util.h>
#include <stdbool.h>
#include <sys/types.h>
extern int arg_ifindex;
extern bool arg_ifindex_permissive;
typedef enum ExecutionMode {
MODE_RESOLVE_HOST,
MODE_RESOLVE_RECORD,
MODE_RESOLVE_SERVICE,
MODE_RESOLVE_OPENPGP,
MODE_RESOLVE_TLSA,
MODE_STATISTICS,
MODE_RESET_STATISTICS,
MODE_FLUSH_CACHES,
MODE_RESET_SERVER_FEATURES,
MODE_STATUS,
MODE_SET_LINK,
MODE_REVERT_LINK,
_MODE_INVALID = -1,
} ExecutionMode;
extern ExecutionMode arg_mode;
extern struct in_addr_data *arg_set_dns;
extern size_t arg_n_set_dns;
extern char **arg_set_domain;