]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/route-metric: pass attribute type to conf parsers
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 6 Jan 2024 04:07:11 +0000 (13:07 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 6 Jan 2024 16:39:58 +0000 (01:39 +0900)
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.

src/network/networkd-network-gperf.gperf
src/network/networkd-route-metric.c
src/network/networkd-route-metric.h

index 455ca8ee226fc51420d8e288d978988338b09dbb..fd1f26c79803c015d4a9abdb3b5062d9b9ba725e 100644 (file)
@@ -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
index 194e53be397a9959359cd9946c2e712afa420f7d..2319447eb7b639609efbf768fe1ddd1b40867a75 100644 (file)
@@ -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;
index a6ae425013dafe343be60e9305d6de93940d0021..ba8b7bb6c8dfce49a433736110bbc278452dae18 100644 (file)
@@ -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);