X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fudev%2Fnet%2Flink-config.h;h=34facdeb5de6239aa712f3f769ab5449358a5794;hb=62a30b2c490512fe22a4e5faacb1d55763ead1e0;hp=f74a790d558958295e5bd6df56d0da6f68338066;hpb=d2df0d0ed3a88e491405b403e6022e6619750130;p=elogind.git diff --git a/src/udev/net/link-config.h b/src/udev/net/link-config.h index f74a790d5..34facdeb5 100644 --- a/src/udev/net/link-config.h +++ b/src/udev/net/link-config.h @@ -22,10 +22,9 @@ #pragma once #include "ethtool-util.h" - -#include "libudev.h" -#include "util.h" +#include "condition.h" #include "list.h" +#include "libudev.h" typedef struct link_config_ctx link_config_ctx; typedef struct link_config link_config; @@ -38,6 +37,8 @@ typedef enum MACPolicy { } MACPolicy; typedef enum NamePolicy { + NAMEPOLICY_KERNEL, + NAMEPOLICY_DATABASE, NAMEPOLICY_ONBOARD, NAMEPOLICY_SLOT, NAMEPOLICY_PATH, @@ -50,9 +51,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; @@ -77,6 +83,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_; @@ -86,5 +94,5 @@ MACPolicy mac_policy_from_string(const char *p) _pure_; /* gperf lookup function */ const struct ConfigPerfItem* link_config_gperf_lookup(const char *key, unsigned 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);