1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

tree-wide: use -EINVAL for enum invalid values

As suggested in https://github.com/systemd/systemd/pull/11484#issuecomment-775288617.

This does not touch anything exposed in src/systemd. Changing the defines there
would be a compatibility break.

Note that tests are broken after this commit. They will be fixed in the next one.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-02-09 17:17:47 +01:00
parent 71c163c9fa
commit 2d93c20e5f
139 changed files with 255 additions and 245 deletions

View File

@ -45,7 +45,7 @@ enum {
ARCHITECTURE_ARC,
ARCHITECTURE_ARC_BE,
_ARCHITECTURE_MAX,
_ARCHITECTURE_INVALID = -1
_ARCHITECTURE_INVALID = -EINVAL,
};
int uname_architecture(void);

View File

@ -32,7 +32,7 @@ typedef enum CGroupController {
CGROUP_CONTROLLER_BPF_DEVICES,
_CGROUP_CONTROLLER_MAX,
_CGROUP_CONTROLLER_INVALID = -1,
_CGROUP_CONTROLLER_INVALID = -EINVAL,
} CGroupController;
#define CGROUP_CONTROLLER_TO_MASK(c) (1U << (c))
@ -97,7 +97,7 @@ typedef enum CGroupIOLimitType {
CGROUP_IO_WIOPS_MAX,
_CGROUP_IO_LIMIT_TYPE_MAX,
_CGROUP_IO_LIMIT_TYPE_INVALID = -1
_CGROUP_IO_LIMIT_TYPE_INVALID = -EINVAL,
} CGroupIOLimitType;
extern const uint64_t cgroup_io_limit_defaults[_CGROUP_IO_LIMIT_TYPE_MAX];
@ -283,7 +283,7 @@ typedef enum ManagedOOMMode {
MANAGED_OOM_AUTO,
MANAGED_OOM_KILL,
_MANAGED_OOM_MODE_MAX,
_MANAGED_OOM_MODE_INVALID = -1,
_MANAGED_OOM_MODE_INVALID = -EINVAL,
} ManagedOOMMode;
const char* managed_oom_mode_to_string(ManagedOOMMode m) _const_;

View File

@ -26,7 +26,7 @@ typedef enum LocaleVariable {
VARIABLE_LC_MEASUREMENT,
VARIABLE_LC_IDENTIFICATION,
_VARIABLE_LC_MAX,
_VARIABLE_LC_INVALID = -1
_VARIABLE_LC_INVALID = -EINVAL,
} LocaleVariable;
int get_locales(char ***l);

View File

@ -23,7 +23,7 @@ typedef enum LogTarget{
LOG_TARGET_AUTO, /* console if stderr is not journal, JOURNAL_OR_KMSG otherwise */
LOG_TARGET_NULL,
_LOG_TARGET_MAX,
_LOG_TARGET_INVALID = -1
_LOG_TARGET_INVALID = -EINVAL,
} LogTarget;
/* Note to readers: << and >> have lower precedence than & and | */

View File

@ -24,7 +24,7 @@ typedef enum SmackAttr {
SMACK_ATTR_IPIN,
SMACK_ATTR_IPOUT,
_SMACK_ATTR_MAX,
_SMACK_ATTR_INVALID = -1,
_SMACK_ATTR_INVALID = -EINVAL,
} SmackAttr;
bool mac_smack_use(void);

View File

@ -63,7 +63,7 @@ typedef enum SocketAddressBindIPv6Only {
SOCKET_ADDRESS_BOTH,
SOCKET_ADDRESS_IPV6_ONLY,
_SOCKET_ADDRESS_BIND_IPV6_ONLY_MAX,
_SOCKET_ADDRESS_BIND_IPV6_ONLY_INVALID = -1
_SOCKET_ADDRESS_BIND_IPV6_ONLY_INVALID = -EINVAL,
} SocketAddressBindIPv6Only;
#define socket_address_family(a) ((a)->sockaddr.sa.sa_family)

View File

@ -111,7 +111,7 @@ typedef enum ColorMode {
/* Only 256 colors. */
COLOR_256 = 256,
_COLOR_INVALID = -1,
_COLOR_INVALID = -EINVAL,
} ColorMode;
int acquire_terminal(const char *name, AcquireTerminalFlags flags, usec_t timeout);

View File

@ -35,7 +35,7 @@ typedef enum TimestampStyle {
TIMESTAMP_UTC,
TIMESTAMP_US_UTC,
_TIMESTAMP_STYLE_MAX,
_TIMESTAMP_STYLE_INVALID = -1,
_TIMESTAMP_STYLE_INVALID = -EINVAL,
} TimestampStyle;
#define USEC_INFINITY ((usec_t) UINT64_MAX)

View File

@ -22,7 +22,7 @@ typedef enum UnitType {
UNIT_SLICE,
UNIT_SCOPE,
_UNIT_TYPE_MAX,
_UNIT_TYPE_INVALID = -1
_UNIT_TYPE_INVALID = -EINVAL,
} UnitType;
typedef enum UnitLoadState {
@ -34,7 +34,7 @@ typedef enum UnitLoadState {
UNIT_MERGED,
UNIT_MASKED,
_UNIT_LOAD_STATE_MAX,
_UNIT_LOAD_STATE_INVALID = -1
_UNIT_LOAD_STATE_INVALID = -EINVAL,
} UnitLoadState;
typedef enum UnitActiveState {
@ -46,7 +46,7 @@ typedef enum UnitActiveState {
UNIT_DEACTIVATING,
UNIT_MAINTENANCE,
_UNIT_ACTIVE_STATE_MAX,
_UNIT_ACTIVE_STATE_INVALID = -1
_UNIT_ACTIVE_STATE_INVALID = -EINVAL,
} UnitActiveState;
typedef enum FreezerState {
@ -55,7 +55,7 @@ typedef enum FreezerState {
FREEZER_FROZEN,
FREEZER_THAWING,
_FREEZER_STATE_MAX,
_FREEZER_STATE_INVALID = -1
_FREEZER_STATE_INVALID = -EINVAL,
} FreezerState;
typedef enum AutomountState {
@ -64,7 +64,7 @@ typedef enum AutomountState {
AUTOMOUNT_RUNNING,
AUTOMOUNT_FAILED,
_AUTOMOUNT_STATE_MAX,
_AUTOMOUNT_STATE_INVALID = -1
_AUTOMOUNT_STATE_INVALID = -EINVAL,
} AutomountState;
/* We simply watch devices, we cannot plug/unplug them. That
@ -74,7 +74,7 @@ typedef enum DeviceState {
DEVICE_TENTATIVE, /* mounted or swapped, but not (yet) announced by udev */
DEVICE_PLUGGED, /* announced by udev */
_DEVICE_STATE_MAX,
_DEVICE_STATE_INVALID = -1
_DEVICE_STATE_INVALID = -EINVAL,
} DeviceState;
typedef enum MountState {
@ -91,7 +91,7 @@ typedef enum MountState {
MOUNT_FAILED,
MOUNT_CLEANING,
_MOUNT_STATE_MAX,
_MOUNT_STATE_INVALID = -1
_MOUNT_STATE_INVALID = -EINVAL,
} MountState;
typedef enum PathState {
@ -100,7 +100,7 @@ typedef enum PathState {
PATH_RUNNING,
PATH_FAILED,
_PATH_STATE_MAX,
_PATH_STATE_INVALID = -1
_PATH_STATE_INVALID = -EINVAL,
} PathState;
typedef enum ScopeState {
@ -111,7 +111,7 @@ typedef enum ScopeState {
SCOPE_STOP_SIGKILL,
SCOPE_FAILED,
_SCOPE_STATE_MAX,
_SCOPE_STATE_INVALID = -1
_SCOPE_STATE_INVALID = -EINVAL,
} ScopeState;
typedef enum ServiceState {
@ -135,14 +135,14 @@ typedef enum ServiceState {
SERVICE_AUTO_RESTART,
SERVICE_CLEANING,
_SERVICE_STATE_MAX,
_SERVICE_STATE_INVALID = -1
_SERVICE_STATE_INVALID = -EINVAL,
} ServiceState;
typedef enum SliceState {
SLICE_DEAD,
SLICE_ACTIVE,
_SLICE_STATE_MAX,
_SLICE_STATE_INVALID = -1
_SLICE_STATE_INVALID = -EINVAL,
} SliceState;
typedef enum SocketState {
@ -161,7 +161,7 @@ typedef enum SocketState {
SOCKET_FAILED,
SOCKET_CLEANING,
_SOCKET_STATE_MAX,
_SOCKET_STATE_INVALID = -1
_SOCKET_STATE_INVALID = -EINVAL,
} SocketState;
typedef enum SwapState {
@ -175,14 +175,14 @@ typedef enum SwapState {
SWAP_FAILED,
SWAP_CLEANING,
_SWAP_STATE_MAX,
_SWAP_STATE_INVALID = -1
_SWAP_STATE_INVALID = -EINVAL,
} SwapState;
typedef enum TargetState {
TARGET_DEAD,
TARGET_ACTIVE,
_TARGET_STATE_MAX,
_TARGET_STATE_INVALID = -1
_TARGET_STATE_INVALID = -EINVAL,
} TargetState;
typedef enum TimerState {
@ -192,7 +192,7 @@ typedef enum TimerState {
TIMER_ELAPSED,
TIMER_FAILED,
_TIMER_STATE_MAX,
_TIMER_STATE_INVALID = -1
_TIMER_STATE_INVALID = -EINVAL,
} TimerState;
typedef enum UnitDependency {
@ -237,7 +237,7 @@ typedef enum UnitDependency {
UNIT_REFERENCED_BY,
_UNIT_DEPENDENCY_MAX,
_UNIT_DEPENDENCY_INVALID = -1
_UNIT_DEPENDENCY_INVALID = -EINVAL,
} UnitDependency;
typedef enum NotifyAccess {
@ -246,7 +246,7 @@ typedef enum NotifyAccess {
NOTIFY_MAIN,
NOTIFY_EXEC,
_NOTIFY_ACCESS_MAX,
_NOTIFY_ACCESS_INVALID = -1
_NOTIFY_ACCESS_INVALID = -EINVAL,
} NotifyAccess;
char *unit_dbus_path_from_name(const char *name);

View File

@ -26,7 +26,7 @@ enum UnitFileState {
UNIT_FILE_TRANSIENT,
UNIT_FILE_BAD,
_UNIT_FILE_STATE_MAX,
_UNIT_FILE_STATE_INVALID = -1
_UNIT_FILE_STATE_INVALID = -EINVAL,
};
enum UnitFileScope {
@ -34,7 +34,7 @@ enum UnitFileScope {
UNIT_FILE_GLOBAL,
UNIT_FILE_USER,
_UNIT_FILE_SCOPE_MAX,
_UNIT_FILE_SCOPE_INVALID = -1
_UNIT_FILE_SCOPE_INVALID = -EINVAL,
};
bool unit_type_may_alias(UnitType type) _const_;

View File

@ -13,7 +13,7 @@ typedef enum UnitNameFlags {
UNIT_NAME_TEMPLATE = 1 << 1, /* Allow foo@.service */
UNIT_NAME_INSTANCE = 1 << 2, /* Allow foo@bar.service */
UNIT_NAME_ANY = UNIT_NAME_PLAIN|UNIT_NAME_TEMPLATE|UNIT_NAME_INSTANCE,
_UNIT_NAME_INVALID = -1,
_UNIT_NAME_INVALID = -EINVAL,
} UnitNameFlags;
bool unit_name_is_valid(const char *n, UnitNameFlags flags) _pure_;

View File

@ -41,7 +41,7 @@ enum {
VIRTUALIZATION_CONTAINER_LAST = VIRTUALIZATION_CONTAINER_OTHER,
_VIRTUALIZATION_MAX,
_VIRTUALIZATION_INVALID = -1
_VIRTUALIZATION_INVALID = -EINVAL,
};
static inline bool VIRTUALIZATION_IS_VM(int x) {

View File

@ -2,13 +2,14 @@
#pragma once
#include <efi.h>
#include <errno.h>
typedef enum RandomSeedMode {
RANDOM_SEED_OFF,
RANDOM_SEED_WITH_SYSTEM_TOKEN,
RANDOM_SEED_ALWAYS,
_RANDOM_SEED_MODE_MAX,
_RANDOM_SEED_MODE_INVALID = -1,
_RANDOM_SEED_MODE_INVALID = -EINVAL,
} RandomSeedMode;
EFI_STATUS process_random_seed(EFI_FILE *root_dir, RandomSeedMode mode);

View File

@ -12,7 +12,7 @@ typedef enum AutomountResult {
AUTOMOUNT_FAILURE_START_LIMIT_HIT,
AUTOMOUNT_FAILURE_MOUNT_START_LIMIT_HIT,
_AUTOMOUNT_RESULT_MAX,
_AUTOMOUNT_RESULT_INVALID = -1
_AUTOMOUNT_RESULT_INVALID = -EINVAL,
} AutomountResult;
struct Automount {

View File

@ -44,7 +44,7 @@ typedef enum CGroupDevicePolicy {
CGROUP_DEVICE_POLICY_STRICT,
_CGROUP_DEVICE_POLICY_MAX,
_CGROUP_DEVICE_POLICY_INVALID = -1
_CGROUP_DEVICE_POLICY_INVALID = -EINVAL,
} CGroupDevicePolicy;
typedef enum FreezerAction {
@ -52,7 +52,7 @@ typedef enum FreezerAction {
FREEZER_THAW,
_FREEZER_ACTION_MAX,
_FREEZER_ACTION_INVALID = -1,
_FREEZER_ACTION_INVALID = -EINVAL,
} FreezerAction;
struct CGroupDeviceAllow {
@ -173,7 +173,7 @@ typedef enum CGroupIPAccountingMetric {
CGROUP_IP_EGRESS_BYTES,
CGROUP_IP_EGRESS_PACKETS,
_CGROUP_IP_ACCOUNTING_METRIC_MAX,
_CGROUP_IP_ACCOUNTING_METRIC_INVALID = -1,
_CGROUP_IP_ACCOUNTING_METRIC_INVALID = -EINVAL,
} CGroupIPAccountingMetric;
/* Used when querying IO accounting data */
@ -183,7 +183,7 @@ typedef enum CGroupIOAccountingMetric {
CGROUP_IO_READ_OPERATIONS,
CGROUP_IO_WRITE_OPERATIONS,
_CGROUP_IO_ACCOUNTING_METRIC_MAX,
_CGROUP_IO_ACCOUNTING_METRIC_INVALID = -1,
_CGROUP_IO_ACCOUNTING_METRIC_INVALID = -EINVAL,
} CGroupIOAccountingMetric;
typedef struct Unit Unit;

View File

@ -1,6 +1,8 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <errno.h>
typedef enum EmergencyAction {
EMERGENCY_ACTION_NONE,
EMERGENCY_ACTION_REBOOT,
@ -13,7 +15,7 @@ typedef enum EmergencyAction {
_EMERGENCY_ACTION_FIRST_USER_ACTION = EMERGENCY_ACTION_EXIT,
EMERGENCY_ACTION_EXIT_FORCE,
_EMERGENCY_ACTION_MAX,
_EMERGENCY_ACTION_INVALID = -1
_EMERGENCY_ACTION_INVALID = -EINVAL,
} EmergencyAction;
typedef enum EmergencyActionFlags {

View File

@ -33,7 +33,7 @@ typedef enum ExecUtmpMode {
EXEC_UTMP_LOGIN,
EXEC_UTMP_USER,
_EXEC_UTMP_MODE_MAX,
_EXEC_UTMP_MODE_INVALID = -1
_EXEC_UTMP_MODE_INVALID = -EINVAL,
} ExecUtmpMode;
typedef enum ExecInput {
@ -46,7 +46,7 @@ typedef enum ExecInput {
EXEC_INPUT_DATA,
EXEC_INPUT_FILE,
_EXEC_INPUT_MAX,
_EXEC_INPUT_INVALID = -1
_EXEC_INPUT_INVALID = -EINVAL,
} ExecInput;
typedef enum ExecOutput {
@ -63,7 +63,7 @@ typedef enum ExecOutput {
EXEC_OUTPUT_FILE_APPEND,
EXEC_OUTPUT_FILE_TRUNCATE,
_EXEC_OUTPUT_MAX,
_EXEC_OUTPUT_INVALID = -1
_EXEC_OUTPUT_INVALID = -EINVAL,
} ExecOutput;
typedef enum ExecPreserveMode {
@ -71,7 +71,7 @@ typedef enum ExecPreserveMode {
EXEC_PRESERVE_YES,
EXEC_PRESERVE_RESTART,
_EXEC_PRESERVE_MODE_MAX,
_EXEC_PRESERVE_MODE_INVALID = -1
_EXEC_PRESERVE_MODE_INVALID = -EINVAL,
} ExecPreserveMode;
typedef enum ExecKeyringMode {
@ -79,7 +79,7 @@ typedef enum ExecKeyringMode {
EXEC_KEYRING_PRIVATE,
EXEC_KEYRING_SHARED,
_EXEC_KEYRING_MODE_MAX,
_EXEC_KEYRING_MODE_INVALID = -1,
_EXEC_KEYRING_MODE_INVALID = -EINVAL,
} ExecKeyringMode;
/* Contains start and exit information about an executed command. */
@ -126,7 +126,7 @@ typedef enum ExecDirectoryType {
EXEC_DIRECTORY_LOGS,
EXEC_DIRECTORY_CONFIGURATION,
_EXEC_DIRECTORY_TYPE_MAX,
_EXEC_DIRECTORY_TYPE_INVALID = -1,
_EXEC_DIRECTORY_TYPE_INVALID = -EINVAL,
} ExecDirectoryType;
typedef struct ExecDirectory {
@ -144,7 +144,7 @@ typedef enum ExecCleanMask {
EXEC_CLEAN_CONFIGURATION = 1U << EXEC_DIRECTORY_CONFIGURATION,
EXEC_CLEAN_NONE = 0,
EXEC_CLEAN_ALL = (1U << _EXEC_DIRECTORY_TYPE_MAX) - 1,
_EXEC_CLEAN_MASK_INVALID = -1,
_EXEC_CLEAN_MASK_INVALID = -EINVAL,
} ExecCleanMask;
/* A credential configured with SetCredential= */

View File

@ -57,14 +57,14 @@ enum JobType {
JOB_RELOAD_OR_START, /* if running, reload, otherwise start */
_JOB_TYPE_MAX,
_JOB_TYPE_INVALID = -1
_JOB_TYPE_INVALID = -EINVAL,
};
enum JobState {
JOB_WAITING,
JOB_RUNNING,
_JOB_STATE_MAX,
_JOB_STATE_INVALID = -1
_JOB_STATE_INVALID = -EINVAL,
};
enum JobMode {
@ -77,7 +77,7 @@ enum JobMode {
JOB_IGNORE_REQUIREMENTS, /* Ignore requirement dependencies */
JOB_TRIGGERING, /* Adds TRIGGERED_BY dependencies to the same transaction */
_JOB_MODE_MAX,
_JOB_MODE_INVALID = -1
_JOB_MODE_INVALID = -EINVAL,
};
enum JobResult {
@ -93,7 +93,7 @@ enum JobResult {
JOB_COLLECTED, /* Job was garbage collected, since nothing needed it anymore */
JOB_ONCE, /* Unit was started before, and hence can't be started again */
_JOB_RESULT_MAX,
_JOB_RESULT_INVALID = -1
_JOB_RESULT_INVALID = -EINVAL,
};
#include "unit.h"

View File

@ -15,7 +15,7 @@ typedef enum KillMode {
KILL_MIXED,
KILL_NONE,
_KILL_MODE_MAX,
_KILL_MODE_INVALID = -1
_KILL_MODE_INVALID = -EINVAL,
} KillMode;
struct KillContext {
@ -37,7 +37,7 @@ typedef enum KillWho {
KILL_CONTROL_FAIL,
KILL_ALL_FAIL,
_KILL_WHO_MAX,
_KILL_WHO_INVALID = -1
_KILL_WHO_INVALID = -EINVAL,
} KillWho;
void kill_context_init(KillContext *c);

View File

@ -36,7 +36,7 @@ typedef enum ManagerState {
MANAGER_MAINTENANCE,
MANAGER_STOPPING,
_MANAGER_STATE_MAX,
_MANAGER_STATE_INVALID = -1
_MANAGER_STATE_INVALID = -EINVAL,
} ManagerState;
typedef enum ManagerObjective {
@ -50,7 +50,7 @@ typedef enum ManagerObjective {
MANAGER_KEXEC,
MANAGER_SWITCH_ROOT,
_MANAGER_OBJECTIVE_MAX,
_MANAGER_OBJECTIVE_INVALID = -1
_MANAGER_OBJECTIVE_INVALID = -EINVAL,
} ManagerObjective;
typedef enum StatusType {
@ -65,7 +65,7 @@ typedef enum OOMPolicy {
OOM_STOP, /* The kernel kills the process it wants to kill, and we stop the unit */
OOM_KILL, /* The kernel kills the process it wants to kill, and all others in the unit, and we stop the unit */
_OOM_POLICY_MAX,
_OOM_POLICY_INVALID = -1
_OOM_POLICY_INVALID = -EINVAL,
} OOMPolicy;
/* Notes:
@ -111,7 +111,7 @@ typedef enum ManagerTimestamp {
MANAGER_TIMESTAMP_INITRD_UNITS_LOAD_START,
MANAGER_TIMESTAMP_INITRD_UNITS_LOAD_FINISH,
_MANAGER_TIMESTAMP_MAX,
_MANAGER_TIMESTAMP_INVALID = -1,
_MANAGER_TIMESTAMP_INVALID = -EINVAL,
} ManagerTimestamp;
typedef enum WatchdogType {

View File

@ -12,7 +12,7 @@ typedef enum MountExecCommand {
MOUNT_EXEC_UNMOUNT,
MOUNT_EXEC_REMOUNT,
_MOUNT_EXEC_COMMAND_MAX,
_MOUNT_EXEC_COMMAND_INVALID = -1
_MOUNT_EXEC_COMMAND_INVALID = -EINVAL,
} MountExecCommand;
typedef enum MountResult {
@ -25,7 +25,7 @@ typedef enum MountResult {
MOUNT_FAILURE_START_LIMIT_HIT,
MOUNT_FAILURE_PROTOCOL,
_MOUNT_RESULT_MAX,
_MOUNT_RESULT_INVALID = -1
_MOUNT_RESULT_INVALID = -EINVAL,
} MountResult;
typedef struct MountParameters {

View File

@ -23,7 +23,7 @@ typedef enum ProtectHome {
PROTECT_HOME_READ_ONLY,
PROTECT_HOME_TMPFS,
_PROTECT_HOME_MAX,
_PROTECT_HOME_INVALID = -1
_PROTECT_HOME_INVALID = -EINVAL,
} ProtectHome;
typedef enum NamespaceType {
@ -35,7 +35,7 @@ typedef enum NamespaceType {
NAMESPACE_PID,
NAMESPACE_NET,
_NAMESPACE_TYPE_MAX,
_NAMESPACE_TYPE_INVALID = -1,
_NAMESPACE_TYPE_INVALID = -EINVAL,
} NamespaceType;
typedef enum ProtectSystem {
@ -44,7 +44,7 @@ typedef enum ProtectSystem {
PROTECT_SYSTEM_FULL,
PROTECT_SYSTEM_STRICT,
_PROTECT_SYSTEM_MAX,
_PROTECT_SYSTEM_INVALID = -1
_PROTECT_SYSTEM_INVALID = -EINVAL,
} ProtectSystem;
typedef enum ProtectProc {
@ -53,14 +53,14 @@ typedef enum ProtectProc {
PROTECT_PROC_INVISIBLE, /* hidepid=invisible */
PROTECT_PROC_PTRACEABLE, /* hidepid=ptraceable */
_PROTECT_PROC_MAX,
_PROTECT_PROC_INVALID = -1,
_PROTECT_PROC_INVALID = -EINVAL,
} ProtectProc;
typedef enum ProcSubset {
PROC_SUBSET_ALL,
PROC_SUBSET_PID, /* subset=pid */
_PROC_SUBSET_MAX,
_PROC_SUBSET_INVALID = -1,
_PROC_SUBSET_INVALID = -EINVAL,
} ProcSubset;
struct NamespaceInfo {

View File

@ -13,7 +13,7 @@ typedef enum PathType {
PATH_CHANGED,
PATH_MODIFIED,
_PATH_TYPE_MAX,
_PATH_TYPE_INVALID = -1
_PATH_TYPE_INVALID = -EINVAL,
} PathType;
typedef struct PathSpec {
@ -47,7 +47,7 @@ typedef enum PathResult {
PATH_FAILURE_START_LIMIT_HIT,
PATH_FAILURE_UNIT_START_LIMIT_HIT,
_PATH_RESULT_MAX,
_PATH_RESULT_INVALID = -1
_PATH_RESULT_INVALID = -EINVAL,
} PathResult;
struct Path {

View File

@ -12,7 +12,7 @@ typedef enum ScopeResult {
SCOPE_FAILURE_RESOURCES,
SCOPE_FAILURE_TIMEOUT,
_SCOPE_RESULT_MAX,
_SCOPE_RESULT_INVALID = -1
_SCOPE_RESULT_INVALID = -EINVAL,
} ScopeResult;
struct Scope {

View File

@ -2738,7 +2738,7 @@ static int service_deserialize_exec_command(
STATE_EXEC_COMMAND_PATH,
STATE_EXEC_COMMAND_ARGS,
_STATE_EXEC_COMMAND_MAX,
_STATE_EXEC_COMMAND_INVALID = -1,
_STATE_EXEC_COMMAND_INVALID = -EINVAL,
} state;
assert(s);

View File

@ -20,7 +20,7 @@ typedef enum ServiceRestart {
SERVICE_RESTART_ON_ABORT,
SERVICE_RESTART_ALWAYS,
_SERVICE_RESTART_MAX,
_SERVICE_RESTART_INVALID = -1
_SERVICE_RESTART_INVALID = -EINVAL,
} ServiceRestart;
typedef enum ServiceType {
@ -32,7 +32,7 @@ typedef enum ServiceType {
SERVICE_IDLE, /* much like simple, but delay exec() until all jobs are dispatched. */
SERVICE_EXEC, /* we fork and wait until we execute exec() (this means our own setup is waited for) */
_SERVICE_TYPE_MAX,
_SERVICE_TYPE_INVALID = -1
_SERVICE_TYPE_INVALID = -EINVAL,
} ServiceType;
typedef enum ServiceExecCommand {
@ -44,7 +44,7 @@ typedef enum ServiceExecCommand {
SERVICE_EXEC_STOP,
SERVICE_EXEC_STOP_POST,
_SERVICE_EXEC_COMMAND_MAX,
_SERVICE_EXEC_COMMAND_INVALID = -1
_SERVICE_EXEC_COMMAND_INVALID = -EINVAL,
} ServiceExecCommand;
typedef enum NotifyState {
@ -53,7 +53,7 @@ typedef enum NotifyState {
NOTIFY_RELOADING,
NOTIFY_STOPPING,
_NOTIFY_STATE_MAX,
_NOTIFY_STATE_INVALID = -1
_NOTIFY_STATE_INVALID = -EINVAL,
} NotifyState;
/* The values of this enum are referenced in man/systemd.exec.xml and src/shared/bus-unit-util.c.
@ -71,7 +71,7 @@ typedef enum ServiceResult {
SERVICE_FAILURE_OOM_KILL,
SERVICE_SKIP_CONDITION,
_SERVICE_RESULT_MAX,
_SERVICE_RESULT_INVALID = -1
_SERVICE_RESULT_INVALID = -EINVAL,
} ServiceResult;
typedef enum ServiceTimeoutFailureMode {
@ -79,7 +79,7 @@ typedef enum ServiceTimeoutFailureMode {
SERVICE_TIMEOUT_ABORT,
SERVICE_TIMEOUT_KILL,
_SERVICE_TIMEOUT_FAILURE_MODE_MAX,
_SERVICE_TIMEOUT_FAILURE_MODE_INVALID = -1
_SERVICE_TIMEOUT_FAILURE_MODE_INVALID = -EINVAL,
} ServiceTimeoutFailureMode;
struct ServiceFDStore {

View File

@ -14,7 +14,7 @@ typedef enum ShowStatus {
SHOW_STATUS_TEMPORARY, /* enabled temporarily, may flip back to _AUTO */
SHOW_STATUS_YES, /* printing of status is enabled */
_SHOW_STATUS_MAX,
_SHOW_STATUS_INVALID = -1,
_SHOW_STATUS_INVALID = -EINVAL,
} ShowStatus;
typedef enum ShowStatusFlags {
@ -26,7 +26,7 @@ typedef enum StatusUnitFormat {
STATUS_UNIT_FORMAT_NAME,
STATUS_UNIT_FORMAT_DESCRIPTION,
_STATUS_UNIT_FORMAT_MAX,
_STATUS_UNIT_FORMAT_INVALID = -1,
_STATUS_UNIT_FORMAT_INVALID = -EINVAL,
} StatusUnitFormat;
static inline bool show_status_on(ShowStatus s) {

View File

@ -16,7 +16,7 @@ typedef enum SocketExecCommand {
SOCKET_EXEC_STOP_PRE,
SOCKET_EXEC_STOP_POST,
_SOCKET_EXEC_COMMAND_MAX,
_SOCKET_EXEC_COMMAND_INVALID = -1
_SOCKET_EXEC_COMMAND_INVALID = -EINVAL,
} SocketExecCommand;
typedef enum SocketType {
@ -26,7 +26,7 @@ typedef enum SocketType {
SOCKET_MQUEUE,
SOCKET_USB_FUNCTION,
_SOCKET_TYPE_MAX,
_SOCKET_TYPE_INVALID = -1
_SOCKET_TYPE_INVALID = -EINVAL,
} SocketType;
typedef enum SocketResult {
@ -40,7 +40,7 @@ typedef enum SocketResult {
SOCKET_FAILURE_TRIGGER_LIMIT_HIT,
SOCKET_FAILURE_SERVICE_START_LIMIT_HIT,
_SOCKET_RESULT_MAX,
_SOCKET_RESULT_INVALID = -1
_SOCKET_RESULT_INVALID = -EINVAL,
} SocketResult;
typedef struct SocketPort {
@ -63,7 +63,7 @@ typedef enum SocketTimestamping {
SOCKET_TIMESTAMPING_US, /* SO_TIMESTAMP */
SOCKET_TIMESTAMPING_NS, /* SO_TIMESTAMPNS */
_SOCKET_TIMESTAMPING_MAX,
_SOCKET_TIMESTAMPING_INVALID = -1,
_SOCKET_TIMESTAMPING_INVALID = -EINVAL,
} SocketTimestamping;
struct Socket {

View File

@ -14,7 +14,7 @@ typedef enum SwapExecCommand {
SWAP_EXEC_ACTIVATE,
SWAP_EXEC_DEACTIVATE,
_SWAP_EXEC_COMMAND_MAX,
_SWAP_EXEC_COMMAND_INVALID = -1
_SWAP_EXEC_COMMAND_INVALID = -EINVAL,
} SwapExecCommand;
typedef enum SwapResult {
@ -26,7 +26,7 @@ typedef enum SwapResult {
SWAP_FAILURE_CORE_DUMP,
SWAP_FAILURE_START_LIMIT_HIT,
_SWAP_RESULT_MAX,
_SWAP_RESULT_INVALID = -1
_SWAP_RESULT_INVALID = -EINVAL,
} SwapResult;
typedef struct SwapParameters {

View File

@ -14,7 +14,7 @@ typedef enum TimerBase {
TIMER_UNIT_INACTIVE,
TIMER_CALENDAR,
_TIMER_BASE_MAX,
_TIMER_BASE_INVALID = -1
_TIMER_BASE_INVALID = -EINVAL,
} TimerBase;
typedef struct TimerValue {
@ -33,7 +33,7 @@ typedef enum TimerResult {
TIMER_FAILURE_RESOURCES,
TIMER_FAILURE_START_LIMIT_HIT,
_TIMER_RESULT_MAX,
_TIMER_RESULT_INVALID = -1
_TIMER_RESULT_INVALID = -EINVAL,
} TimerResult;
struct Timer {

View File

@ -23,14 +23,14 @@ typedef enum KillOperation {
KILL_KILL,
KILL_WATCHDOG,
_KILL_OPERATION_MAX,
_KILL_OPERATION_INVALID = -1
_KILL_OPERATION_INVALID = -EINVAL,
} KillOperation;
typedef enum CollectMode {
COLLECT_INACTIVE,
COLLECT_INACTIVE_OR_FAILED,
_COLLECT_MODE_MAX,
_COLLECT_MODE_INVALID = -1,
_COLLECT_MODE_INVALID = -EINVAL,
} CollectMode;
static inline bool UNIT_IS_ACTIVE_OR_RELOADING(UnitActiveState t) {

View File

@ -124,7 +124,7 @@ typedef enum CoredumpStorage {
COREDUMP_STORAGE_EXTERNAL,
COREDUMP_STORAGE_JOURNAL,
_COREDUMP_STORAGE_MAX,
_COREDUMP_STORAGE_INVALID = -1
_COREDUMP_STORAGE_INVALID = -EINVAL,
} CoredumpStorage;
static const char* const coredump_storage_table[_COREDUMP_STORAGE_MAX] = {

View File

@ -1,6 +1,8 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <errno.h>
typedef enum EnrollType {
ENROLL_PASSWORD,
ENROLL_RECOVERY,
@ -8,7 +10,7 @@ typedef enum EnrollType {
ENROLL_FIDO2,
ENROLL_TPM2,
_ENROLL_TYPE_MAX,
_ENROLL_TYPE_INVALID = -1,
_ENROLL_TYPE_INVALID = -EINVAL,
} EnrollType;
typedef enum WipeScope {
@ -16,7 +18,7 @@ typedef enum WipeScope {
WIPE_ALL, /* wipe all slots */
WIPE_EMPTY_PASSPHRASE, /* wipe slots with empty passphrases plus listed slots */
_WIPE_SCOPE_MAX,
_WIPE_SCOPE_INVALID = -1,
_WIPE_SCOPE_INVALID = -EINVAL,
} WipeScope;
const char* enroll_type_to_string(EnrollType t);

View File

@ -37,7 +37,7 @@ typedef enum HomeState {
HOME_AUTHENTICATING_WHILE_ACTIVE,
HOME_AUTHENTICATING_FOR_ACQUIRE, /* authenticating because Acquire() was called */
_HOME_STATE_MAX,
_HOME_STATE_INVALID = -1
_HOME_STATE_INVALID = -EINVAL,
} HomeState;
static inline bool HOME_STATE_IS_ACTIVE(HomeState state) {

View File

@ -14,7 +14,7 @@ typedef enum OperationType {
OPERATION_DEACTIVATE_FORCE, /* enqueued on hard $HOME unplug */
OPERATION_IMMEDIATE, /* this is never enqueued, it's just a marker we immediately started executing an operation without enqueuing anything first. */
_OPERATION_MAX,
_OPERATION_INVALID = -1,
_OPERATION_INVALID = -EINVAL,
} OperationType;
/* Encapsulates an operation on one or more home directories. This has two uses:

View File

@ -14,7 +14,7 @@ typedef enum UserReconcileMode {
USER_RECONCILE_REQUIRE_NEWER, /* host version must be newer than embedded version */
USER_RECONCILE_REQUIRE_NEWER_OR_EQUAL, /* similar, but may also be equal */
_USER_RECONCILE_MODE_MAX,
_USER_RECONCILE_MODE_INVALID = -1,
_USER_RECONCILE_MODE_INVALID = -EINVAL,
} UserReconcileMode;
enum { /* return values */

View File

@ -59,7 +59,7 @@ enum {
PROP_OS_CPE_NAME,
PROP_OS_HOME_URL,
_PROP_MAX,
_PROP_INVALID = -1,
_PROP_INVALID = -EINVAL,
};
typedef struct Context {

View File

@ -17,7 +17,7 @@ typedef enum ImportCompressType {
IMPORT_COMPRESS_GZIP,
IMPORT_COMPRESS_BZIP2,
_IMPORT_COMPRESS_TYPE_MAX,
_IMPORT_COMPRESS_TYPE_INVALID = -1,
_IMPORT_COMPRESS_TYPE_INVALID = -EINVAL,
} ImportCompressType;
typedef struct ImportCompress {

View File

@ -46,7 +46,7 @@ typedef enum TransferType {
TRANSFER_PULL_TAR,
TRANSFER_PULL_RAW,
_TRANSFER_TYPE_MAX,
_TRANSFER_TYPE_INVALID = -1,
_TRANSFER_TYPE_INVALID = -EINVAL,
} TransferType;
struct Transfer {

View File

@ -33,7 +33,7 @@ typedef enum VerificationStyle {
VERIFICATION_PER_FILE, /* SuSE-style ".sha256" files with inline gpg signature */
VERIFICATION_PER_DIRECTORY, /* Ubuntu-style SHA256SUM files with detached SHA256SUM.gpg signatures */
_VERIFICATION_STYLE_MAX,
_VERIFICATION_STYLE_INVALID = -1,
_VERIFICATION_STYLE_INVALID = -EINVAL,
} VerificationStyle;
int verification_style_from_url(const char *url, VerificationStyle *style);

View File

@ -22,7 +22,7 @@ typedef enum PullJobState {
PULL_JOB_DONE,
PULL_JOB_FAILED,
_PULL_JOB_STATE_MAX,
_PULL_JOB_STATE_INVALID = -1,
_PULL_JOB_STATE_INVALID = -EINVAL,
} PullJobState;
#define PULL_JOB_IS_COMPLETE(j) (IN_SET((j)->state, PULL_JOB_DONE, PULL_JOB_FAILED))

View File

@ -36,5 +36,5 @@ typedef enum JournalWriteSplitMode {
JOURNAL_WRITE_SPLIT_NONE,
JOURNAL_WRITE_SPLIT_HOST,
_JOURNAL_WRITE_SPLIT_MAX,
_JOURNAL_WRITE_SPLIT_INVALID = -1
_JOURNAL_WRITE_SPLIT_INVALID = -EINVAL,
} JournalWriteSplitMode;

View File

@ -25,7 +25,7 @@ typedef enum Storage {
STORAGE_PERSISTENT,
STORAGE_NONE,
_STORAGE_MAX,
_STORAGE_INVALID = -1
_STORAGE_INVALID = -EINVAL,
} Storage;
typedef enum SplitMode {
@ -33,7 +33,7 @@ typedef enum SplitMode {
SPLIT_LOGIN, /* deprecated */
SPLIT_NONE,
_SPLIT_MAX,
_SPLIT_INVALID = -1
_SPLIT_INVALID = -EINVAL,
} SplitMode;
typedef struct JournalCompressOptions {

View File

@ -60,7 +60,7 @@ typedef enum LineBreak {
LINE_BREAK_EOF,
LINE_BREAK_PID_CHANGE,
_LINE_BREAK_MAX,
_LINE_BREAK_INVALID = -1,
_LINE_BREAK_INVALID = -EINVAL,
} LineBreak;
struct StdoutStream {

View File

@ -46,7 +46,7 @@ typedef enum IPv4ACDState {
IPV4ACD_STATE_ANNOUNCING,
IPV4ACD_STATE_RUNNING,
_IPV4ACD_STATE_MAX,
_IPV4ACD_STATE_INVALID = -1
_IPV4ACD_STATE_INVALID = -EINVAL,
} IPv4ACDState;
struct sd_ipv4acd {

View File

@ -122,7 +122,7 @@ typedef enum BusSlotType {
BUS_NODE_ENUMERATOR,
BUS_NODE_VTABLE,
BUS_NODE_OBJECT_MANAGER,
_BUS_SLOT_INVALID = -1,
_BUS_SLOT_INVALID = -EINVAL,
} BusSlotType;
struct sd_bus_slot {

View File

@ -27,7 +27,7 @@ enum bus_match_node_type {
BUS_MATCH_ARG_HAS,
BUS_MATCH_ARG_HAS_LAST = BUS_MATCH_ARG_HAS + 63,
_BUS_MATCH_NODE_TYPE_MAX,
_BUS_MATCH_NODE_TYPE_INVALID = -1
_BUS_MATCH_NODE_TYPE_INVALID = -EINVAL,
};
struct bus_match_node {

View File

@ -21,7 +21,7 @@ typedef enum DeviceEnumerationType {
DEVICE_ENUMERATION_TYPE_DEVICES,
DEVICE_ENUMERATION_TYPE_SUBSYSTEMS,
_DEVICE_ENUMERATION_TYPE_MAX,
_DEVICE_ENUMERATION_TYPE_INVALID = -1,
_DEVICE_ENUMERATION_TYPE_INVALID = -EINVAL,
} DeviceEnumerationType;
struct sd_device_enumerator {

View File

@ -1,6 +1,8 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <errno.h>
#include "sd-device.h"
typedef enum MonitorNetlinkGroup {
@ -8,7 +10,7 @@ typedef enum MonitorNetlinkGroup {
MONITOR_GROUP_KERNEL,
MONITOR_GROUP_UDEV,
_MONITOR_NETLINK_GROUP_MAX,
_MONITOR_NETLINK_GROUP_INVALID = -1,
_MONITOR_NETLINK_GROUP_INVALID = -EINVAL,
} MonitorNetlinkGroup;
int device_monitor_new_full(sd_device_monitor **ret, MonitorNetlinkGroup group, int fd);

View File

@ -20,7 +20,7 @@ typedef enum DeviceAction {
DEVICE_ACTION_BIND,
DEVICE_ACTION_UNBIND,
_DEVICE_ACTION_MAX,
_DEVICE_ACTION_INVALID = -1,
_DEVICE_ACTION_INVALID = -EINVAL,
} DeviceAction;
int device_new_from_nulstr(sd_device **ret, uint8_t *nulstr, size_t len);

View File

@ -28,7 +28,7 @@ typedef enum EventSourceType {
SOURCE_WATCHDOG,
SOURCE_INOTIFY,
_SOURCE_EVENT_SOURCE_TYPE_MAX,
_SOURCE_EVENT_SOURCE_TYPE_INVALID = -1
_SOURCE_EVENT_SOURCE_TYPE_INVALID = -EINVAL,
} EventSourceType;
/* All objects we use in epoll events start with this value, so that
@ -40,7 +40,7 @@ typedef enum WakeupType {
WAKEUP_SIGNAL_DATA,
WAKEUP_INOTIFY_DATA,
_WAKEUP_TYPE_MAX,
_WAKEUP_TYPE_INVALID = -1,
_WAKEUP_TYPE_INVALID = -EINVAL,
} WakeupType;
struct inode_data;

View File

@ -33,7 +33,7 @@ struct match_callback {
typedef enum NetlinkSlotType {
NETLINK_REPLY_CALLBACK,
NETLINK_MATCH_CALLBACK,
_NETLINK_SLOT_INVALID = -1,
_NETLINK_SLOT_INVALID = -EINVAL,
} NetlinkSlotType;
struct sd_netlink_slot {

View File

@ -93,7 +93,7 @@ typedef enum NLUnionLinkInfoData {
NL_UNION_LINK_INFO_DATA_IFB,
NL_UNION_LINK_INFO_DATA_BAREUDP,
_NL_UNION_LINK_INFO_DATA_MAX,
_NL_UNION_LINK_INFO_DATA_INVALID = -1
_NL_UNION_LINK_INFO_DATA_INVALID = -EINVAL,
} NLUnionLinkInfoData;
const char *nl_union_link_info_data_to_string(NLUnionLinkInfoData p) _const_;
@ -115,7 +115,7 @@ typedef enum NLUnionTCAOptionData {
NL_UNION_TCA_OPTION_DATA_SFB,
NL_UNION_TCA_OPTION_DATA_TBF,
_NL_UNION_TCA_OPTION_DATA_MAX,
_NL_UNION_TCA_OPTION_DATA_INVALID = -1,
_NL_UNION_TCA_OPTION_DATA_INVALID = -EINVAL,
} NLUnionTCAOptionData;
const char *nl_union_tca_option_data_to_string(NLUnionTCAOptionData p) _const_;
@ -131,7 +131,7 @@ typedef enum NLUnionNFTExprData {
NL_UNION_NFT_EXPR_DATA_META,
NL_UNION_NFT_EXPR_DATA_NAT,
_NL_UNION_NFT_EXPR_DATA_MAX,
_NL_UNION_NFT_EXPR_DATA_INVALID = -1,
_NL_UNION_NFT_EXPR_DATA_INVALID = -EINVAL,
} NLUnionNFTExprData;
const char *nl_union_nft_expr_data_to_string(NLUnionNFTExprData p) _const_;

View File

@ -22,7 +22,7 @@ typedef enum LinkOperationalState {
LINK_OPERSTATE_ENSLAVED,
LINK_OPERSTATE_ROUTABLE,
_LINK_OPERSTATE_MAX,
_LINK_OPERSTATE_INVALID = -1
_LINK_OPERSTATE_INVALID = -EINVAL,
} LinkOperationalState;
typedef enum LinkCarrierState {
@ -33,7 +33,7 @@ typedef enum LinkCarrierState {
LINK_CARRIER_STATE_CARRIER = LINK_OPERSTATE_CARRIER,
LINK_CARRIER_STATE_ENSLAVED = LINK_OPERSTATE_ENSLAVED,
_LINK_CARRIER_STATE_MAX,
_LINK_CARRIER_STATE_INVALID = -1
_LINK_CARRIER_STATE_INVALID = -EINVAL,
} LinkCarrierState;
typedef enum LinkAddressState {
@ -41,7 +41,7 @@ typedef enum LinkAddressState {
LINK_ADDRESS_STATE_DEGRADED,
LINK_ADDRESS_STATE_ROUTABLE,
_LINK_ADDRESS_STATE_MAX,
_LINK_ADDRESS_STATE_INVALID = -1
_LINK_ADDRESS_STATE_INVALID = -EINVAL,
} LinkAddressState;
const char* link_operstate_to_string(LinkOperationalState s) _const_;

View File

@ -15,7 +15,7 @@ typedef enum HandleAction {
HANDLE_SUSPEND_THEN_HIBERNATE,
HANDLE_LOCK,
_HANDLE_ACTION_MAX,
_HANDLE_ACTION_INVALID = -1
_HANDLE_ACTION_INVALID = -EINVAL,
} HandleAction;
#include "logind-inhibit.h"

View File

@ -13,14 +13,14 @@ typedef enum InhibitWhat {
INHIBIT_HANDLE_LID_SWITCH = 1 << 6,
INHIBIT_HANDLE_REBOOT_KEY = 1 << 7,
_INHIBIT_WHAT_MAX = 1 << 8,
_INHIBIT_WHAT_INVALID = -1
_INHIBIT_WHAT_INVALID = -EINVAL,
} InhibitWhat;
typedef enum InhibitMode {
INHIBIT_BLOCK,
INHIBIT_DELAY,
_INHIBIT_MODE_MAX,
_INHIBIT_MODE_INVALID = -1
_INHIBIT_MODE_INVALID = -EINVAL,
} InhibitMode;
#include "logind.h"

View File

@ -15,7 +15,7 @@ typedef enum SessionState {
SESSION_ACTIVE, /* Logged in and in the fg */
SESSION_CLOSING, /* Logged out, but scope is still there */
_SESSION_STATE_MAX,
_SESSION_STATE_INVALID = -1
_SESSION_STATE_INVALID = -EINVAL,
} SessionState;
typedef enum SessionClass {
@ -24,7 +24,7 @@ typedef enum SessionClass {
SESSION_LOCK_SCREEN,
SESSION_BACKGROUND,
_SESSION_CLASS_MAX,
_SESSION_CLASS_INVALID = -1
_SESSION_CLASS_INVALID = -EINVAL,
} SessionClass;
typedef enum SessionType {
@ -35,7 +35,7 @@ typedef enum SessionType {
SESSION_MIR,
SESSION_WEB,
_SESSION_TYPE_MAX,
_SESSION_TYPE_INVALID = -1
_SESSION_TYPE_INVALID = -EINVAL,
} SessionType;
#define SESSION_TYPE_IS_GRAPHICAL(type) IN_SET(type, SESSION_X11, SESSION_WAYLAND, SESSION_MIR)
@ -44,7 +44,7 @@ enum KillWho {
KILL_LEADER,
KILL_ALL,
_KILL_WHO_MAX,
_KILL_WHO_INVALID = -1
_KILL_WHO_INVALID = -EINVAL,
};
typedef enum TTYValidity {
@ -52,7 +52,7 @@ typedef enum TTYValidity {
TTY_FROM_UTMP,
TTY_UTMP_INCONSISTENT, /* may happen on ssh sessions with multiplexed TTYs */
_TTY_VALIDITY_MAX,
_TTY_VALIDITY_INVALID = -1,
_TTY_VALIDITY_INVALID = -EINVAL,
} TTYValidity;
struct Session {

View File

@ -16,7 +16,7 @@ typedef enum UserState {
USER_ACTIVE, /* User logged in and has a session in the fg */
USER_CLOSING, /* User logged out, but processes still remain and lingering is not enabled */
_USER_STATE_MAX,
_USER_STATE_INVALID = -1
_USER_STATE_INVALID = -EINVAL,
} UserState;
struct User {

View File

@ -14,7 +14,7 @@ typedef enum MachineState {
MACHINE_RUNNING, /* Machine is running */
MACHINE_CLOSING, /* Machine is terminating */
_MACHINE_STATE_MAX,
_MACHINE_STATE_INVALID = -1
_MACHINE_STATE_INVALID = -EINVAL,
} MachineState;
typedef enum MachineClass {
@ -22,14 +22,14 @@ typedef enum MachineClass {
MACHINE_VM,
MACHINE_HOST,
_MACHINE_CLASS_MAX,
_MACHINE_CLASS_INVALID = -1
_MACHINE_CLASS_INVALID = -EINVAL,
} MachineClass;
enum KillWho {
KILL_LEADER,
KILL_ALL,
_KILL_WHO_MAX,
_KILL_WHO_INVALID = -1
_KILL_WHO_INVALID = -EINVAL,
};
struct Machine {

View File

@ -19,7 +19,7 @@ typedef enum DHCPType {
DHCP_TYPE_EITHER6,
DHCP_TYPE_IBFT,
_DHCP_TYPE_MAX,
_DHCP_TYPE_INVALID = -1,
_DHCP_TYPE_INVALID = -EINVAL,
} DHCPType;
typedef struct Address Address;

View File

@ -15,7 +15,7 @@ typedef enum BareUDPProtocol {
BARE_UDP_PROTOCOL_MPLS_UC = ETH_P_MPLS_UC,
BARE_UDP_PROTOCOL_MPLS_MC = ETH_P_MPLS_MC,
_BARE_UDP_PROTOCOL_MAX,
_BARE_UDP_PROTOCOL_INVALID = -1
_BARE_UDP_PROTOCOL_INVALID = -EINVAL,
} BareUDPProtocol;
struct BareUDP {

View File

@ -35,7 +35,7 @@ typedef enum MulticastRouter {
MULTICAST_ROUTER_PERMANENT = MDB_RTR_TYPE_PERM,
MULTICAST_ROUTER_TEMPORARY = MDB_RTR_TYPE_TEMP,
_MULTICAST_ROUTER_MAX,
_MULTICAST_ROUTER_INVALID = -1,
_MULTICAST_ROUTER_INVALID = -EINVAL,
} MulticastRouter;
DEFINE_NETDEV_CAST(BRIDGE, Bridge);

View File

@ -12,7 +12,7 @@ typedef enum FooOverUDPEncapType {
NETDEV_FOO_OVER_UDP_ENCAP_DIRECT = FOU_ENCAP_DIRECT,
NETDEV_FOO_OVER_UDP_ENCAP_GUE = FOU_ENCAP_GUE,
_NETDEV_FOO_OVER_UDP_ENCAP_MAX,
_NETDEV_FOO_OVER_UDP_ENCAP_INVALID = -1,
_NETDEV_FOO_OVER_UDP_ENCAP_INVALID = -EINVAL,
} FooOverUDPEncapType;
typedef struct FouTunnel {

View File

@ -14,7 +14,7 @@ typedef enum GeneveDF {
NETDEV_GENEVE_DF_YES = GENEVE_DF_SET,
NETDEV_GENEVE_DF_INHERIT = GENEVE_DF_INHERIT,
_NETDEV_GENEVE_DF_MAX,
_NETDEV_GENEVE_DF_INVALID = -1
_NETDEV_GENEVE_DF_INVALID = -EINVAL,
} GeneveDF;
struct Geneve {

View File

@ -12,14 +12,14 @@ typedef enum L2tpL2specType {
NETDEV_L2TP_L2SPECTYPE_NONE = L2TP_L2SPECTYPE_NONE,
NETDEV_L2TP_L2SPECTYPE_DEFAULT = L2TP_L2SPECTYPE_DEFAULT,
_NETDEV_L2TP_L2SPECTYPE_MAX,
_NETDEV_L2TP_L2SPECTYPE_INVALID = -1,
_NETDEV_L2TP_L2SPECTYPE_INVALID = -EINVAL,
} L2tpL2specType;
typedef enum L2tpEncapType {
NETDEV_L2TP_ENCAPTYPE_UDP = L2TP_ENCAPTYPE_UDP,
NETDEV_L2TP_ENCAPTYPE_IP = L2TP_ENCAPTYPE_IP,
_NETDEV_L2TP_ENCAPTYPE_MAX,
_NETDEV_L2TP_ENCAPTYPE_INVALID = -1,
_NETDEV_L2TP_ENCAPTYPE_INVALID = -EINVAL,
} L2tpEncapType;
typedef enum L2tpLocalAddressType {
@ -27,7 +27,7 @@ typedef enum L2tpLocalAddressType {
NETDEV_L2TP_LOCAL_ADDRESS_STATIC,
NETDEV_L2TP_LOCAL_ADDRESS_DYNAMIC,
_NETDEV_L2TP_LOCAL_ADDRESS_MAX,
_NETDEV_L2TP_LOCAL_ADDRESS_INVALID = -1,
_NETDEV_L2TP_LOCAL_ADDRESS_INVALID = -EINVAL,
} L2tpLocalAddressType;
typedef struct L2tpTunnel L2tpTunnel;

View File

@ -85,7 +85,7 @@ typedef enum NetDevKind {
NETDEV_KIND_BAREUDP,
_NETDEV_KIND_MAX,
_NETDEV_KIND_TUNNEL, /* Used by config_parse_stacked_netdev() */
_NETDEV_KIND_INVALID = -1
_NETDEV_KIND_INVALID = -EINVAL,
} NetDevKind;
typedef enum NetDevState {
@ -95,7 +95,7 @@ typedef enum NetDevState {
NETDEV_STATE_READY,
NETDEV_STATE_LINGER,
_NETDEV_STATE_MAX,
_NETDEV_STATE_INVALID = -1,
_NETDEV_STATE_INVALID = -EINVAL,
} NetDevState;
typedef enum NetDevCreateType {
@ -104,7 +104,7 @@ typedef enum NetDevCreateType {
NETDEV_CREATE_STACKED,
NETDEV_CREATE_AFTER_CONFIGURED,
_NETDEV_CREATE_MAX,
_NETDEV_CREATE_INVALID = -1,
_NETDEV_CREATE_INVALID = -EINVAL,
} NetDevCreateType;
typedef struct Manager Manager;

View File

@ -12,13 +12,13 @@ typedef enum Ip6TnlMode {
NETDEV_IP6_TNL_MODE_IPIP6,
NETDEV_IP6_TNL_MODE_ANYIP6,
_NETDEV_IP6_TNL_MODE_MAX,
_NETDEV_IP6_TNL_MODE_INVALID = -1,
_NETDEV_IP6_TNL_MODE_INVALID = -EINVAL,
} Ip6TnlMode;
typedef enum IPv6FlowLabel {
NETDEV_IPV6_FLOWLABEL_INHERIT = 0xFFFFF + 1,
_NETDEV_IPV6_FLOWLABEL_MAX,
_NETDEV_IPV6_FLOWLABEL_INVALID = -1,
_NETDEV_IPV6_FLOWLABEL_INVALID = -EINVAL,
} IPv6FlowLabel;
typedef struct Tunnel {

View File

@ -16,7 +16,7 @@ typedef enum VxLanDF {
NETDEV_VXLAN_DF_YES = VXLAN_DF_SET,
NETDEV_VXLAN_DF_INHERIT = VXLAN_DF_INHERIT,
_NETDEV_VXLAN_DF_MAX,
_NETDEV_VXLAN_DF_INVALID = -1
_NETDEV_VXLAN_DF_INVALID = -EINVAL,
} VxLanDF;
struct VxLan {

View File

@ -16,7 +16,7 @@ typedef enum DHCPUseDomains {
DHCP_USE_DOMAINS_YES,
DHCP_USE_DOMAINS_ROUTE,
_DHCP_USE_DOMAINS_MAX,
_DHCP_USE_DOMAINS_INVALID = -1,
_DHCP_USE_DOMAINS_INVALID = -EINVAL,
} DHCPUseDomains;
typedef enum DHCPOptionDataType {

View File

@ -14,7 +14,7 @@ typedef enum DHCPClientIdentifier {
* https://github.com/systemd/systemd/issues/7828 */
DHCP_CLIENT_ID_DUID_ONLY,
_DHCP_CLIENT_ID_MAX,
_DHCP_CLIENT_ID_INVALID = -1,
_DHCP_CLIENT_ID_INVALID = -EINVAL,
} DHCPClientIdentifier;
int dhcp4_configure(Link *link);

View File

@ -11,7 +11,7 @@ typedef enum DHCP6ClientStartMode {
DHCP6_CLIENT_START_MODE_INFORMATION_REQUEST,
DHCP6_CLIENT_START_MODE_SOLICIT,
_DHCP6_CLIENT_START_MODE_MAX,
_DHCP6_CLIENT_START_MODE_INVALID = -1,
_DHCP6_CLIENT_START_MODE_INVALID = -EINVAL,
} DHCP6ClientStartMode;
typedef struct Link Link;

View File

@ -22,7 +22,7 @@ typedef enum NeighborCacheEntryFlags {
NEIGHBOR_CACHE_ENTRY_FLAGS_MASTER = NTF_MASTER,
NEIGHBOR_CACHE_ENTRY_FLAGS_ROUTER = NTF_ROUTER,
_NEIGHBOR_CACHE_ENTRY_FLAGS_MAX,
_NEIGHBOR_CACHE_ENTRY_FLAGS_INVALID = -1,
_NEIGHBOR_CACHE_ENTRY_FLAGS_INVALID = -EINVAL,
} NeighborCacheEntryFlags;
typedef struct FdbEntry {

View File

@ -33,7 +33,7 @@ typedef enum LinkState {
LINK_STATE_FAILED, /* at least one configuration process failed */
LINK_STATE_LINGER, /* RTM_DELLINK for the link has been received */
_LINK_STATE_MAX,
_LINK_STATE_INVALID = -1
_LINK_STATE_INVALID = -EINVAL,
} LinkState;
typedef struct Manager Manager;

View File

@ -10,7 +10,7 @@ typedef enum LLDPMode {
LLDP_MODE_YES = 1,
LLDP_MODE_ROUTERS_ONLY = 2,
_LLDP_MODE_MAX,
_LLDP_MODE_INVALID = -1,
_LLDP_MODE_INVALID = -EINVAL,
} LLDPMode;
int link_lldp_rx_configure(Link *link);

View File

@ -14,7 +14,7 @@ typedef enum IPv6TokenAddressGeneration {
IPV6_TOKEN_ADDRESS_GENERATION_STATIC,
IPV6_TOKEN_ADDRESS_GENERATION_PREFIXSTABLE,
_IPV6_TOKEN_ADDRESS_GENERATION_MAX,
_IPV6_TOKEN_ADDRESS_GENERATION_INVALID = -1,
_IPV6_TOKEN_ADDRESS_GENERATION_INVALID = -EINVAL,
} IPv6TokenAddressGeneration;
typedef enum IPv6AcceptRAStartDHCP6Client {
@ -22,7 +22,7 @@ typedef enum IPv6AcceptRAStartDHCP6Client {
IPV6_ACCEPT_RA_START_DHCP6_CLIENT_ALWAYS,
IPV6_ACCEPT_RA_START_DHCP6_CLIENT_YES,
_IPV6_ACCEPT_RA_START_DHCP6_CLIENT_MAX,
_IPV6_ACCEPT_RA_START_DHCP6_CLIENT_INVALID = -1,
_IPV6_ACCEPT_RA_START_DHCP6_CLIENT_INVALID = -EINVAL,
} IPv6AcceptRAStartDHCP6Client;
typedef struct NDiscAddress {

View File

@ -35,7 +35,7 @@ typedef enum KeepConfiguration {
KEEP_CONFIGURATION_STATIC = 1 << 2,
KEEP_CONFIGURATION_YES = KEEP_CONFIGURATION_DHCP | KEEP_CONFIGURATION_STATIC,
_KEEP_CONFIGURATION_MAX,
_KEEP_CONFIGURATION_INVALID = -1,
_KEEP_CONFIGURATION_INVALID = -EINVAL,
} KeepConfiguration;
typedef enum IPv6LinkLocalAddressGenMode {
@ -44,7 +44,7 @@ typedef enum IPv6LinkLocalAddressGenMode {
IPV6_LINK_LOCAL_ADDRESSS_GEN_MODE_STABLE_PRIVACY = IN6_ADDR_GEN_MODE_STABLE_PRIVACY,
IPV6_LINK_LOCAL_ADDRESSS_GEN_MODE_RANDOM = IN6_ADDR_GEN_MODE_RANDOM,
_IPV6_LINK_LOCAL_ADDRESS_GEN_MODE_MAX,
_IPV6_LINK_LOCAL_ADDRESS_GEN_MODE_INVALID = -1
_IPV6_LINK_LOCAL_ADDRESS_GEN_MODE_INVALID = -EINVAL,
} IPv6LinkLocalAddressGenMode;
typedef enum ActivationPolicy {
@ -55,7 +55,7 @@ typedef enum ActivationPolicy {
ACTIVATION_POLICY_DOWN,
ACTIVATION_POLICY_BOUND,
_ACTIVATION_POLICY_MAX,
_ACTIVATION_POLICY_INVALID = -1
_ACTIVATION_POLICY_INVALID = -EINVAL,
} ActivationPolicy;
typedef struct Manager Manager;

View File

@ -23,7 +23,7 @@ typedef enum RADVPrefixDelegation {
RADV_PREFIX_DELEGATION_DHCP6 = 1 << 1,
RADV_PREFIX_DELEGATION_BOTH = RADV_PREFIX_DELEGATION_STATIC | RADV_PREFIX_DELEGATION_DHCP6,
_RADV_PREFIX_DELEGATION_MAX,
_RADV_PREFIX_DELEGATION_INVALID = -1,
_RADV_PREFIX_DELEGATION_INVALID = -EINVAL,
} RADVPrefixDelegation;
typedef struct Prefix {

View File

@ -15,7 +15,7 @@ typedef enum SRIOVLinkState {
SR_IOV_LINK_STATE_ENABLE = IFLA_VF_LINK_STATE_ENABLE,
SR_IOV_LINK_STATE_DISABLE = IFLA_VF_LINK_STATE_DISABLE,
_SR_IOV_LINK_STATE_MAX,
_SR_IOV_LINK_STATE_INVALID = -1,
_SR_IOV_LINK_STATE_INVALID = -EINVAL,
} SRIOVLinkState;
typedef struct SRIOV {

View File

@ -13,7 +13,7 @@ typedef enum IPv6PrivacyExtensions {
IPV6_PRIVACY_EXTENSIONS_PREFER_PUBLIC,
IPV6_PRIVACY_EXTENSIONS_YES, /* aka prefer-temporary */
_IPV6_PRIVACY_EXTENSIONS_MAX,
_IPV6_PRIVACY_EXTENSIONS_INVALID = -1,
_IPV6_PRIVACY_EXTENSIONS_INVALID = -EINVAL,
} IPv6PrivacyExtensions;
int link_set_sysctl(Link *link);

View File

@ -17,7 +17,7 @@ typedef enum AddressFamily {
ADDRESS_FAMILY_IPV6 = 1 << 1,
ADDRESS_FAMILY_YES = ADDRESS_FAMILY_IPV4 | ADDRESS_FAMILY_IPV6,
_ADDRESS_FAMILY_MAX,
_ADDRESS_FAMILY_INVALID = -1,
_ADDRESS_FAMILY_INVALID = -EINVAL,
} AddressFamily;
typedef struct NetworkConfigSection {

View File

@ -31,7 +31,7 @@ typedef enum QDiscKind {
QDISC_KIND_TBF,
QDISC_KIND_TEQL,
_QDISC_KIND_MAX,
_QDISC_KIND_INVALID = -1,
_QDISC_KIND_INVALID = -EINVAL,
} QDiscKind;
typedef struct QDisc {

View File

@ -8,7 +8,7 @@ typedef enum TrafficControlKind {
TC_KIND_TCLASS,
TC_KIND_FILTER,
_TC_KIND_MAX,
_TC_KIND_INVALID = -1,
_TC_KIND_INVALID = -EINVAL,
} TrafficControlKind;
typedef struct TrafficControl {

View File

@ -13,7 +13,7 @@ typedef enum TClassKind {
TCLASS_KIND_HTB,
TCLASS_KIND_QFQ,
_TCLASS_KIND_MAX,
_TCLASS_KIND_INVALID = -1,
_TCLASS_KIND_INVALID = -EINVAL,
} TClassKind;
typedef struct TClass {

View File

@ -29,7 +29,7 @@ typedef enum CustomMountType {
CUSTOM_MOUNT_INACCESSIBLE,
CUSTOM_MOUNT_ARBITRARY,
_CUSTOM_MOUNT_TYPE_MAX,
_CUSTOM_MOUNT_TYPE_INVALID = -1
_CUSTOM_MOUNT_TYPE_INVALID = -EINVAL,
} CustomMountType;
typedef struct CustomMount {

View File

@ -25,7 +25,7 @@ typedef enum StartMode {
START_PID2, /* Use stub init process as PID 1, run parameters as command line as process 2 */
START_BOOT, /* Search for init system, pass arguments as parameters */
_START_MODE_MAX,
_START_MODE_INVALID = -1
_START_MODE_INVALID = -EINVAL,
} StartMode;
typedef enum UserNamespaceMode {
@ -33,7 +33,7 @@ typedef enum UserNamespaceMode {
USER_NAMESPACE_FIXED,
USER_NAMESPACE_PICK,
_USER_NAMESPACE_MODE_MAX,
_USER_NAMESPACE_MODE_INVALID = -1,
_USER_NAMESPACE_MODE_INVALID = -EINVAL,
} UserNamespaceMode;
typedef enum ResolvConfMode {
@ -53,7 +53,7 @@ typedef enum ResolvConfMode {
RESOLV_CONF_DELETE,
RESOLV_CONF_AUTO,
_RESOLV_CONF_MODE_MAX,
_RESOLV_CONF_MODE_INVALID = -1
_RESOLV_CONF_MODE_INVALID = -EINVAL,
} ResolvConfMode;
typedef enum LinkJournal {
@ -62,7 +62,7 @@ typedef enum LinkJournal {
LINK_HOST,
LINK_GUEST,
_LINK_JOURNAL_MAX,
_LINK_JOURNAL_INVALID = -1
_LINK_JOURNAL_INVALID = -EINVAL,
} LinkJournal;
typedef enum TimezoneMode {
@ -73,7 +73,7 @@ typedef enum TimezoneMode {
TIMEZONE_DELETE,
TIMEZONE_AUTO,
_TIMEZONE_MODE_MAX,
_TIMEZONE_MODE_INVALID = -1
_TIMEZONE_MODE_INVALID = -EINVAL,
} TimezoneMode;
typedef enum ConsoleMode {
@ -82,7 +82,7 @@ typedef enum ConsoleMode {
CONSOLE_PASSIVE,
CONSOLE_PIPE,
_CONSOLE_MODE_MAX,
_CONSOLE_MODE_INVALID = -1,
_CONSOLE_MODE_INVALID = -EINVAL,
} ConsoleMode;
typedef enum SettingsMask {

View File

@ -129,7 +129,7 @@ typedef enum EncryptMode {
ENCRYPT_TPM2,
ENCRYPT_KEY_FILE_TPM2,
_ENCRYPT_MODE_MAX,
_ENCRYPT_MODE_INVALID = -1,
_ENCRYPT_MODE_INVALID = -EINVAL,
} EncryptMode;
struct Partition {

View File

@ -42,7 +42,7 @@ typedef enum PortableState {
PORTABLE_RUNNING,
PORTABLE_RUNNING_RUNTIME,
_PORTABLE_STATE_MAX,
_PORTABLE_STATE_INVALID = -1
_PORTABLE_STATE_INVALID = -EINVAL,
} PortableState;
typedef struct PortableChange {

View File

@ -32,7 +32,7 @@ typedef enum ImageAcquireMode {
BUS_IMAGE_AUTHENTICATE_BY_PATH, /* allow by name + polkit by path */
BUS_IMAGE_AUTHENTICATE_ALL, /* polkit by name + polkit by path */
_BUS_IMAGE_ACQUIRE_MODE_MAX,
_BUS_IMAGE_ACQUIRE_MODE_INVALID = -1
_BUS_IMAGE_ACQUIRE_MODE_INVALID = -EINVAL,
} ImageAcquireMode;
int bus_image_acquire(Manager *m, sd_bus_message *message, const char *name_or_path, Image *image, ImageAcquireMode mode, const char *polkit_action, Image **ret, sd_bus_error *error);

View File

@ -53,7 +53,7 @@ typedef enum PStoreStorage {
PSTORE_STORAGE_EXTERNAL,
PSTORE_STORAGE_JOURNAL,
_PSTORE_STORAGE_MAX,
_PSTORE_STORAGE_INVALID = -1
_PSTORE_STORAGE_INVALID = -EINVAL,
} PStoreStorage;
static const char* const pstore_storage_table[_PSTORE_STORAGE_MAX] = {

View File

@ -90,7 +90,7 @@ enum {
DNS_TYPE_DLV,
_DNS_TYPE_MAX,
_DNS_TYPE_INVALID = -1
_DNS_TYPE_INVALID = -EINVAL,
};
assert_cc(DNS_TYPE_SSHFP == 44);
@ -103,7 +103,7 @@ enum {
DNS_CLASS_ANY = 0xFF,
_DNS_CLASS_MAX,
_DNS_CLASS_INVALID = -1
_DNS_CLASS_INVALID = -EINVAL,
};
#define _DNS_CLASS_STRING_MAX (sizeof "CLASS" + DECIMAL_STR_MAX(uint16_t))

View File

@ -18,7 +18,7 @@ typedef enum ExecutionMode {
MODE_STATUS,
MODE_SET_LINK,
MODE_REVERT_LINK,
_MODE_INVALID = -1,
_MODE_INVALID = -EINVAL,
} ExecutionMode;
extern ExecutionMode arg_mode;

View File

@ -27,7 +27,7 @@ enum DnssecResult {
DNSSEC_INCOMPATIBLE_SERVER,
_DNSSEC_RESULT_MAX,
_DNSSEC_RESULT_INVALID = -1
_DNSSEC_RESULT_INVALID = -EINVAL,
};
enum DnssecVerdict {
@ -37,7 +37,7 @@ enum DnssecVerdict {
DNSSEC_INDETERMINATE,
_DNSSEC_VERDICT_MAX,
_DNSSEC_VERDICT_INVALID = -1
_DNSSEC_VERDICT_INVALID = -EINVAL,
};
#define DNSSEC_CANONICAL_HOSTNAME_MAX (DNS_HOSTNAME_MAX + 2)

View File

@ -22,7 +22,7 @@ typedef enum DnsProtocol {
DNS_PROTOCOL_MDNS,
DNS_PROTOCOL_LLMNR,
_DNS_PROTOCOL_MAX,
_DNS_PROTOCOL_INVALID = -1
_DNS_PROTOCOL_INVALID = -EINVAL,
} DnsProtocol;
struct DnsPacketHeader {

View File

@ -22,7 +22,7 @@ typedef enum DnsScopeMatch {
DNS_SCOPE_YES_BASE, /* Add the number of matching labels to this */
DNS_SCOPE_YES_END = DNS_SCOPE_YES_BASE + DNS_N_LABELS_MAX,
_DNS_SCOPE_MATCH_MAX,
_DNS_SCOPE_MATCH_INVALID = -1
_DNS_SCOPE_MATCH_INVALID = -EINVAL,
} DnsScopeMatch;
struct DnsScope {

View File

@ -20,7 +20,7 @@ typedef enum DnsServerType {
DNS_SERVER_FALLBACK,
DNS_SERVER_LINK,
_DNS_SERVER_TYPE_MAX,
_DNS_SERVER_TYPE_INVALID = -1
_DNS_SERVER_TYPE_INVALID = -EINVAL,
} DnsServerType;
const char* dns_server_type_to_string(DnsServerType i) _const_;
@ -35,7 +35,7 @@ typedef enum DnsServerFeatureLevel {
DNS_SERVER_FEATURE_LEVEL_LARGE,
DNS_SERVER_FEATURE_LEVEL_TLS_DO,
_DNS_SERVER_FEATURE_LEVEL_MAX,
_DNS_SERVER_FEATURE_LEVEL_INVALID = -1
_DNS_SERVER_FEATURE_LEVEL_INVALID = -EINVAL,
} DnsServerFeatureLevel;
#define DNS_SERVER_FEATURE_LEVEL_WORST 0

View File

@ -21,7 +21,7 @@ typedef enum DnsStreamType {
DNS_STREAM_LLMNR_RECV, /* Incoming LLMNR TCP lookup */
DNS_STREAM_STUB, /* Incoming DNS stub connection */
_DNS_STREAM_TYPE_MAX,
_DNS_STREAM_TYPE_INVALID = -1,
_DNS_STREAM_TYPE_INVALID = -EINVAL,
} DnsStreamType;
#define DNS_STREAM_WRITE_TLS_DATA 1

View File

@ -11,7 +11,7 @@ typedef enum DnsStubListenerMode {
DNS_STUB_LISTENER_TCP = 1 << 1,
DNS_STUB_LISTENER_YES = DNS_STUB_LISTENER_UDP | DNS_STUB_LISTENER_TCP,
_DNS_STUB_LISTENER_MODE_MAX,
_DNS_STUB_LISTENER_MODE_INVALID = -1
_DNS_STUB_LISTENER_MODE_INVALID = -EINVAL,
} DnsStubListenerMode;
#include "resolved-manager.h"

View File

@ -32,7 +32,7 @@ enum DnsTransactionState {
DNS_TRANSACTION_NETWORK_DOWN,
DNS_TRANSACTION_NOT_FOUND, /* like NXDOMAIN, but when LLMNR/TCP connections fail */
_DNS_TRANSACTION_STATE_MAX,
_DNS_TRANSACTION_STATE_INVALID = -1
_DNS_TRANSACTION_STATE_INVALID = -EINVAL,
};
#define DNS_TRANSACTION_IS_LIVE(state) IN_SET((state), DNS_TRANSACTION_NULL, DNS_TRANSACTION_PENDING, DNS_TRANSACTION_VALIDATING)
@ -43,7 +43,7 @@ enum DnsTransactionSource {
DNS_TRANSACTION_ZONE,
DNS_TRANSACTION_TRUST_ANCHOR,
_DNS_TRANSACTION_SOURCE_MAX,
_DNS_TRANSACTION_SOURCE_INVALID = -1
_DNS_TRANSACTION_SOURCE_INVALID = -EINVAL,
};
struct DnsTransaction {

View File

@ -14,7 +14,7 @@ typedef enum ResolvConfMode {
RESOLV_CONF_FOREIGN,
RESOLV_CONF_MISSING,
_RESOLV_CONF_MODE_MAX,
_RESOLV_CONF_MODE_INVALID = -1,
_RESOLV_CONF_MODE_INVALID = -EINVAL,
} ResolvConfMode;
int resolv_conf_mode(void);

View File

@ -21,7 +21,7 @@ typedef enum BondMode {
NETDEV_BOND_MODE_BALANCE_TLB = BOND_MODE_TLB,
NETDEV_BOND_MODE_BALANCE_ALB = BOND_MODE_ALB,
_NETDEV_BOND_MODE_MAX,
_NETDEV_BOND_MODE_INVALID = -1
_NETDEV_BOND_MODE_INVALID = -EINVAL,
} BondMode;
typedef enum BondXmitHashPolicy {
@ -31,14 +31,14 @@ typedef enum BondXmitHashPolicy {
NETDEV_BOND_XMIT_HASH_POLICY_ENCAP23 = BOND_XMIT_POLICY_ENCAP23,
NETDEV_BOND_XMIT_HASH_POLICY_ENCAP34 = BOND_XMIT_POLICY_ENCAP34,
_NETDEV_BOND_XMIT_HASH_POLICY_MAX,
_NETDEV_BOND_XMIT_HASH_POLICY_INVALID = -1
_NETDEV_BOND_XMIT_HASH_POLICY_INVALID = -EINVAL,
} BondXmitHashPolicy;
typedef enum BondLacpRate {
NETDEV_BOND_LACP_RATE_SLOW,
NETDEV_BOND_LACP_RATE_FAST,
_NETDEV_BOND_LACP_RATE_MAX,
_NETDEV_BOND_LACP_RATE_INVALID = -1,
_NETDEV_BOND_LACP_RATE_INVALID = -EINVAL,
} BondLacpRate;
typedef enum BondAdSelect {
@ -46,7 +46,7 @@ typedef enum BondAdSelect {
NETDEV_BOND_AD_SELECT_BANDWIDTH,
NETDEV_BOND_AD_SELECT_COUNT,
_NETDEV_BOND_AD_SELECT_MAX,
_NETDEV_BOND_AD_SELECT_INVALID = -1,
_NETDEV_BOND_AD_SELECT_INVALID = -EINVAL,
} BondAdSelect;
typedef enum BondFailOverMac {
@ -54,7 +54,7 @@ typedef enum BondFailOverMac {
NETDEV_BOND_FAIL_OVER_MAC_ACTIVE,
NETDEV_BOND_FAIL_OVER_MAC_FOLLOW,
_NETDEV_BOND_FAIL_OVER_MAC_MAX,
_NETDEV_BOND_FAIL_OVER_MAC_INVALID = -1,
_NETDEV_BOND_FAIL_OVER_MAC_INVALID = -EINVAL,
} BondFailOverMac;
typedef enum BondArpValidate {
@ -63,14 +63,14 @@ typedef enum BondArpValidate {
NETDEV_BOND_ARP_VALIDATE_BACKUP,
NETDEV_BOND_ARP_VALIDATE_ALL,
_NETDEV_BOND_ARP_VALIDATE_MAX,
_NETDEV_BOND_ARP_VALIDATE_INVALID = -1,
_NETDEV_BOND_ARP_VALIDATE_INVALID = -EINVAL,
} BondArpValidate;
typedef enum BondArpAllTargets {
NETDEV_BOND_ARP_ALL_TARGETS_ANY,
NETDEV_BOND_ARP_ALL_TARGETS_ALL,
_NETDEV_BOND_ARP_ALL_TARGETS_MAX,
_NETDEV_BOND_ARP_ALL_TARGETS_INVALID = -1,
_NETDEV_BOND_ARP_ALL_TARGETS_INVALID = -EINVAL,
} BondArpAllTargets;
typedef enum BondPrimaryReselect {
@ -78,7 +78,7 @@ typedef enum BondPrimaryReselect {
NETDEV_BOND_PRIMARY_RESELECT_BETTER,
NETDEV_BOND_PRIMARY_RESELECT_FAILURE,
_NETDEV_BOND_PRIMARY_RESELECT_MAX,
_NETDEV_BOND_PRIMARY_RESELECT_INVALID = -1,
_NETDEV_BOND_PRIMARY_RESELECT_INVALID = -EINVAL,
} BondPrimaryReselect;
const char *bond_mode_to_string(BondMode d) _const_;

Some files were not shown because too many files have changed in this diff Show More