]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/udev/net/link-config.h
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / udev / net / link-config.h
index f74a790d558958295e5bd6df56d0da6f68338066..a413251bd068bee568c2230d19344d543b0bc1e9 100644 (file)
@@ -1,4 +1,5 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+/* SPDX-License-Identifier: LGPL-2.1+ */
+#pragma once
 
 /***
  This file is part of systemd.
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#pragma once
+#include "libudev.h"
 
+#include "condition.h"
 #include "ethtool-util.h"
-
-#include "libudev.h"
-#include "util.h"
 #include "list.h"
 
 typedef struct link_config_ctx link_config_ctx;
@@ -33,11 +32,14 @@ typedef struct link_config link_config;
 typedef enum MACPolicy {
         MACPOLICY_PERSISTENT,
         MACPOLICY_RANDOM,
+        MACPOLICY_NONE,
         _MACPOLICY_MAX,
         _MACPOLICY_INVALID = -1
 } MACPolicy;
 
 typedef enum NamePolicy {
+        NAMEPOLICY_KERNEL,
+        NAMEPOLICY_DATABASE,
         NAMEPOLICY_ONBOARD,
         NAMEPOLICY_SLOT,
         NAMEPOLICY_PATH,
@@ -50,9 +52,14 @@ struct link_config {
         char *filename;
 
         struct ether_addr *match_mac;
-        char *match_path;
-        char *match_driver;
-        char *match_type;
+        char **match_path;
+        char **match_driver;
+        char **match_type;
+        char **match_name;
+        Condition *match_host;
+        Condition *match_virt;
+        Condition *match_kernel;
+        Condition *match_arch;
 
         char *description;
         struct ether_addr *mac;
@@ -60,10 +67,13 @@ struct link_config {
         NamePolicy *name_policy;
         char *name;
         char *alias;
-        unsigned int mtu;
-        unsigned int speed;
+        size_t mtu;
+        size_t speed;
         Duplex duplex;
+        int autonegotiation;
         WakeOnLan wol;
+        NetDevPort port;
+        NetDevFeature features[_NET_DEV_FEAT_MAX];
 
         LIST_FIELDS(link_config, links);
 };
@@ -77,6 +87,8 @@ bool link_config_should_reload(link_config_ctx *ctx);
 int link_config_get(link_config_ctx *ctx, struct udev_device *device, struct link_config **ret);
 int link_config_apply(link_config_ctx *ctx, struct link_config *config, struct udev_device *device, const char **name);
 
+int link_get_driver(link_config_ctx *ctx, struct udev_device *device, char **ret);
+
 const char *name_policy_to_string(NamePolicy p) _const_;
 NamePolicy name_policy_from_string(const char *p) _pure_;
 
@@ -84,7 +96,7 @@ const char *mac_policy_to_string(MACPolicy p) _const_;
 MACPolicy mac_policy_from_string(const char *p) _pure_;
 
 /* gperf lookup function */
-const struct ConfigPerfItem* link_config_gperf_lookup(const char *key, unsigned length);
+const struct ConfigPerfItem* link_config_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
 
-int config_parse_mac_policy(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
-int config_parse_name_policy(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
+int config_parse_mac_policy(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
+int config_parse_name_policy(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);