diff options
| author | Michael Biebl <biebl@debian.org> | 2021-10-01 23:05:04 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2021-10-01 23:05:04 +0200 |
| commit | e74c568b07b50b97873fb4ee1d776dedefbd54d6 (patch) | |
| tree | 3469f17ea9af91f7ff169b890633bda68b0cf76e /src/nm-initrd-generator/nm-initrd-generator.h | |
| parent | bfe522304da217296e2a61040f58e35ec5d6f3f2 (diff) | |
New upstream version 1.32.12 upstream/1.32.12
Diffstat (limited to 'src/nm-initrd-generator/nm-initrd-generator.h')
| -rw-r--r-- | src/nm-initrd-generator/nm-initrd-generator.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/nm-initrd-generator/nm-initrd-generator.h b/src/nm-initrd-generator/nm-initrd-generator.h new file mode 100644 index 00000000..2ec52a01 --- /dev/null +++ b/src/nm-initrd-generator/nm-initrd-generator.h @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2014, 2018 Red Hat, Inc. + */ + +#ifndef __NM_INITRD_GENERATOR_H__ +#define __NM_INITRD_GENERATOR_H__ + +#include "nm-connection.h" +#include "nm-utils.h" + +#define NMI_WAIT_DEVICE_TIMEOUT_MSEC 60000 +#define NMI_IP_REQUIRED_TIMEOUT_MSEC 20000 + +static inline int +get_ip_address_family(const char *str, gboolean with_prefix) +{ + int addr_family; + + if (!str) + return AF_UNSPEC; + + if (with_prefix) { + if (nm_utils_parse_inaddr_prefix_bin(AF_UNSPEC, str, &addr_family, NULL, NULL)) + return addr_family; + } else { + if (nm_utils_parse_inaddr_bin(AF_UNSPEC, str, &addr_family, NULL)) + return addr_family; + } + + return AF_UNSPEC; +} + +GHashTable *nmi_ibft_read(const char *sysfs_dir); + +gboolean +nmi_ibft_update_connection_from_nic(NMConnection *connection, GHashTable *nic, GError **error); + +NMConnection *nmi_dt_reader_parse(const char *sysfs_dir); + +GHashTable *nmi_cmdline_reader_parse(const char * sysfs_dir, + const char *const *argv, + char ** hostname, + gint64 * carrier_timeout_sec); + +#endif /* __NM_INITRD_GENERATOR_H__ */ |