From: Yu Watanabe Date: Sat, 6 Jan 2024 04:07:11 +0000 (+0900) Subject: network/route-metric: pass attribute type to conf parsers X-Git-Tag: v256-rc1~1247^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2126e235e4147293d809e699ddd4d9a003e5571;p=thirdparty%2Fsystemd.git network/route-metric: pass attribute type to conf parsers The passed attribute type will be used later. This also - rename conf parsers, - sort gperf entries by the attr type. No functional change, just refactoring and preparation for later commits. --- diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf index 455ca8ee226..fd1f26c7980 100644 --- a/src/network/networkd-network-gperf.gperf +++ b/src/network/networkd-network-gperf.gperf @@ -192,23 +192,23 @@ Route.Metric, config_parse_route_priority, Route.Scope, config_parse_route_scope, 0, 0 Route.PreferredSource, config_parse_preferred_src, 0, 0 Route.Table, config_parse_route_table, 0, 0 -Route.MTUBytes, config_parse_route_mtu, AF_UNSPEC, 0 Route.GatewayOnLink, config_parse_route_gateway_onlink, 0, 0 Route.GatewayOnlink, config_parse_route_gateway_onlink, 0, 0 Route.IPv6Preference, config_parse_ipv6_route_preference, 0, 0 Route.Protocol, config_parse_route_protocol, 0, 0 Route.Type, config_parse_route_type, 0, 0 -Route.TCPRetransmissionTimeoutSec, config_parse_route_tcp_rto, 0, 0 -Route.HopLimit, config_parse_route_hop_limit, 0, 0 -Route.InitialCongestionWindow, config_parse_route_tcp_window, 0, 0 -Route.InitialAdvertisedReceiveWindow, config_parse_route_tcp_window, 0, 0 -Route.TCPAdvertisedMaximumSegmentSize, config_parse_tcp_advmss, 0, 0 -Route.TCPCongestionControlAlgorithm, config_parse_tcp_congestion, 0, 0 -Route.QuickAck, config_parse_route_boolean, 0, 0 -Route.FastOpenNoCookie, config_parse_route_boolean, 0, 0 -Route.TTLPropagate, config_parse_warn_compat, DISABLED_LEGACY, 0 Route.MultiPathRoute, config_parse_multipath_route, 0, 0 Route.NextHop, config_parse_route_nexthop, 0, 0 +Route.MTUBytes, config_parse_route_metric_mtu, RTAX_MTU, 0 +Route.TCPAdvertisedMaximumSegmentSize, config_parse_route_metric_advmss, RTAX_ADVMSS, 0 +Route.HopLimit, config_parse_route_metric_hop_limit, RTAX_HOPLIMIT, 0 +Route.InitialCongestionWindow, config_parse_route_metric_tcp_window, RTAX_INITCWND, 0 +Route.TCPRetransmissionTimeoutSec, config_parse_route_metric_tcp_rto, RTAX_RTO_MIN, 0 +Route.InitialAdvertisedReceiveWindow, config_parse_route_metric_tcp_window, RTAX_INITRWND, 0 +Route.QuickAck, config_parse_route_metric_boolean, RTAX_QUICKACK, 0 +Route.TCPCongestionControlAlgorithm, config_parse_route_metric_tcp_congestion, RTAX_CC_ALGO, 0 +Route.FastOpenNoCookie, config_parse_route_metric_boolean, RTAX_FASTOPEN_NO_COOKIE, 0 +Route.TTLPropagate, config_parse_warn_compat, DISABLED_LEGACY, 0 NextHop.Id, config_parse_nexthop_id, 0, 0 NextHop.Gateway, config_parse_nexthop_gateway, 0, 0 NextHop.Family, config_parse_nexthop_family, 0, 0 diff --git a/src/network/networkd-route-metric.c b/src/network/networkd-route-metric.c index 194e53be397..2319447eb7b 100644 --- a/src/network/networkd-route-metric.c +++ b/src/network/networkd-route-metric.c @@ -5,7 +5,7 @@ #include "parse-util.h" #include "string-util.h" -int config_parse_route_mtu( +int config_parse_route_metric_mtu( const char *unit, const char *filename, unsigned line, @@ -36,7 +36,7 @@ int config_parse_route_mtu( return 0; } - r = config_parse_mtu(unit, filename, line, section, section_line, lvalue, ltype, rvalue, &route->mtu, userdata); + r = config_parse_mtu(unit, filename, line, section, section_line, lvalue, AF_UNSPEC, rvalue, &route->mtu, userdata); if (r <= 0) return r; @@ -44,7 +44,7 @@ int config_parse_route_mtu( return 0; } -int config_parse_tcp_advmss( +int config_parse_route_metric_advmss( const char *unit, const char *filename, unsigned line, @@ -101,7 +101,7 @@ int config_parse_tcp_advmss( return 0; } -int config_parse_route_hop_limit( +int config_parse_route_metric_hop_limit( const char *unit, const char *filename, unsigned line, @@ -205,7 +205,7 @@ int config_parse_tcp_window( return 0; } -int config_parse_route_tcp_window( +int config_parse_route_metric_tcp_window( const char *unit, const char *filename, unsigned line, @@ -252,7 +252,7 @@ int config_parse_route_tcp_window( return 0; } -int config_parse_route_tcp_rto( +int config_parse_route_metric_tcp_rto( const char *unit, const char *filename, unsigned line, @@ -304,7 +304,7 @@ int config_parse_route_tcp_rto( return 0; } -int config_parse_route_boolean( +int config_parse_route_metric_boolean( const char *unit, const char *filename, unsigned line, @@ -353,7 +353,7 @@ int config_parse_route_boolean( return 0; } -int config_parse_tcp_congestion( +int config_parse_route_metric_tcp_congestion( const char *unit, const char *filename, unsigned line, @@ -384,7 +384,7 @@ int config_parse_tcp_congestion( return 0; } - r = config_parse_string(unit, filename, line, section, section_line, lvalue, ltype, + r = config_parse_string(unit, filename, line, section, section_line, lvalue, 0, rvalue, &route->tcp_congestion_control_algo, userdata); if (r < 0) return r; diff --git a/src/network/networkd-route-metric.h b/src/network/networkd-route-metric.h index a6ae425013d..ba8b7bb6c8d 100644 --- a/src/network/networkd-route-metric.h +++ b/src/network/networkd-route-metric.h @@ -3,11 +3,11 @@ #include "conf-parser.h" -CONFIG_PARSER_PROTOTYPE(config_parse_route_mtu); -CONFIG_PARSER_PROTOTYPE(config_parse_tcp_advmss); -CONFIG_PARSER_PROTOTYPE(config_parse_route_hop_limit); -CONFIG_PARSER_PROTOTYPE(config_parse_route_tcp_window); -CONFIG_PARSER_PROTOTYPE(config_parse_route_tcp_rto); -CONFIG_PARSER_PROTOTYPE(config_parse_route_boolean); -CONFIG_PARSER_PROTOTYPE(config_parse_tcp_congestion); +CONFIG_PARSER_PROTOTYPE(config_parse_route_metric_mtu); +CONFIG_PARSER_PROTOTYPE(config_parse_route_metric_advmss); +CONFIG_PARSER_PROTOTYPE(config_parse_route_metric_hop_limit); +CONFIG_PARSER_PROTOTYPE(config_parse_route_metric_tcp_window); +CONFIG_PARSER_PROTOTYPE(config_parse_route_metric_tcp_rto); +CONFIG_PARSER_PROTOTYPE(config_parse_route_metric_boolean); +CONFIG_PARSER_PROTOTYPE(config_parse_route_metric_tcp_congestion); CONFIG_PARSER_PROTOTYPE(config_parse_tcp_window);