summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-address-label.h
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-08-28 06:57:05 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-09-06 03:34:53 +0200
commit934cf1c06b177553da38ec6137557cb912960cba (patch)
tree0c46249faf850b31ef04995499bcb2e5cf6b2032 /src/network/networkd-address-label.h
parentconf-parser: introduce config section parser wrapper (diff)
downloadsystemd-934cf1c06b177553da38ec6137557cb912960cba.tar.xz
systemd-934cf1c06b177553da38ec6137557cb912960cba.zip
network/address-label: introduce generic conf parser for [IPv6AddressLabel] section
This also - renames n -> label, - use log_syntax_parse_error(). No functional change, just refactoring.
Diffstat (limited to 'src/network/networkd-address-label.h')
-rw-r--r--src/network/networkd-address-label.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/network/networkd-address-label.h b/src/network/networkd-address-label.h
index d2165719c3..f0c7943545 100644
--- a/src/network/networkd-address-label.h
+++ b/src/network/networkd-address-label.h
@@ -30,5 +30,16 @@ void manager_drop_invalid_address_labels(Manager *manager);
int link_request_static_address_labels(Link *link);
int manager_request_static_address_labels(Manager *manager);
-CONFIG_PARSER_PROTOTYPE(config_parse_address_label);
-CONFIG_PARSER_PROTOTYPE(config_parse_address_label_prefix);
+typedef enum IPv6AddressLabelConfParserType {
+ IPV6_ADDRESS_LABEL,
+ IPV6_ADDRESS_LABEL_PREFIX,
+ _IPV6_ADDRESS_LABEL_CONF_PARSER_MAX,
+ _IPV6_ADDRESS_LABEL_CONF_PARSER_INVALID = -EINVAL,
+
+ IPV6_ADDRESS_LABEL_BY_MANAGER = 1 << 16,
+ IPV6_ADDRESS_LABEL_SECTION_MASK = IPV6_ADDRESS_LABEL_BY_MANAGER - 1,
+} IPv6AddressLabelConfParserType;
+
+assert_cc(IPV6_ADDRESS_LABEL_BY_MANAGER >= _IPV6_ADDRESS_LABEL_CONF_PARSER_MAX);
+
+CONFIG_PARSER_PROTOTYPE(config_parse_ipv6_address_label_section);