about summary refs log tree commit diff
path: root/src/core/initrd/nm-initrd-generator.h
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2021-02-25 11:36:45 +0100
committerSebastien Bacher <seb128@ubuntu.com>2021-02-25 11:36:45 +0100
commitd92aa7f298fe84d4cf686c5ad64b73438e00d377 (patch)
tree2f1f4c7b48cff9e63b0d0e3669bada3d9aeda72e /src/core/initrd/nm-initrd-generator.h
parenta82e048a943092315a32d745c99e0f5635e29134 (diff)
parent3a56bce6c0ea7ba0fe269520547740783b342e0d (diff)
Merge branch 'upstream/latest' of https://salsa.debian.org/utopia-team/network-manager into upstream/latest
Diffstat (limited to 'src/core/initrd/nm-initrd-generator.h')
-rw-r--r--src/core/initrd/nm-initrd-generator.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/core/initrd/nm-initrd-generator.h b/src/core/initrd/nm-initrd-generator.h
new file mode 100644
index 00000000..56dcfd68
--- /dev/null
+++ b/src/core/initrd/nm-initrd-generator.h
@@ -0,0 +1,45 @@
+/* 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_MS 60000
+
+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__ */