]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: Move config_parse_ip_service_type to networkd-dhcp4.c and
authorSusant Sahani <ssahani@vmware.com>
Mon, 2 Mar 2020 20:44:01 +0000 (21:44 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 3 Mar 2020 02:53:49 +0000 (11:53 +0900)
rename

src/network/networkd-conf.c
src/network/networkd-conf.h
src/network/networkd-dhcp4.c
src/network/networkd-dhcp4.h
src/network/networkd-network-gperf.gperf

index eef7788c49efbd88509a9f90df576929e8ce12da..350fea634c6741056dbd80267ba0ff941d4dbebc 100644 (file)
@@ -182,30 +182,3 @@ int config_parse_duid_rawdata(
         ret->raw_data_len = count;
         return 0;
 }
-
-int config_parse_ip_service_type(
-                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) {
-
-        assert(filename);
-        assert(lvalue);
-        assert(rvalue);
-
-        if (streq(rvalue, "CS4"))
-                *((int *)data) = IPTOS_CLASS_CS4;
-        else if (streq(rvalue, "CS6"))
-                *((int *)data) = IPTOS_CLASS_CS6;
-        else
-                log_syntax(unit, LOG_WARNING, filename, line, 0,
-                           "Failed to parse IPServiceType type '%s', ignoring.", rvalue);
-
-        return 0;
-}
index a615998f92d922946fe2f2ed075643bacba8a678..88a2c64031c22fcc5a497c3e380d2699695a4074 100644 (file)
@@ -15,4 +15,3 @@ const struct ConfigPerfItem* networkd_gperf_lookup(const char *key, GPERF_LEN_TY
 
 CONFIG_PARSER_PROTOTYPE(config_parse_duid_type);
 CONFIG_PARSER_PROTOTYPE(config_parse_duid_rawdata);
-CONFIG_PARSER_PROTOTYPE(config_parse_ip_service_type);
index 34770f6f2bd042d0ad3a70192860f92b469aeaf3..13e3e32f40e8c6add46c852127b8f29d9beb6e5a 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 
 #include <netinet/in.h>
+#include <netinet/ip.h>
 #include <linux/if.h>
 #include <linux/if_arp.h>
 
@@ -1703,6 +1704,33 @@ int config_parse_dhcp_request_options(
         return 0;
 }
 
+int config_parse_dhcp_ip_service_type(
+                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) {
+
+        assert(filename);
+        assert(lvalue);
+        assert(rvalue);
+
+        if (streq(rvalue, "CS4"))
+                *((int *)data) = IPTOS_CLASS_CS4;
+        else if (streq(rvalue, "CS6"))
+                *((int *)data) = IPTOS_CLASS_CS6;
+        else
+                log_syntax(unit, LOG_WARNING, filename, line, 0,
+                           "Failed to parse IPServiceType type '%s', ignoring.", rvalue);
+
+        return 0;
+}
+
 static const char* const dhcp_client_identifier_table[_DHCP_CLIENT_ID_MAX] = {
         [DHCP_CLIENT_ID_MAC] = "mac",
         [DHCP_CLIENT_ID_DUID] = "duid",
index fce11ef671e65783c454a9c6cb83639936678bdd..95fa5ee4b5bce81c8e42c306658cbc186b6ffee2 100644 (file)
@@ -27,3 +27,4 @@ CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_black_listed_ip_address);
 CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_max_attempts);
 CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_user_class);
 CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_request_options);
+CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_ip_service_type);
index 134f1535d607ff87d45f807494740e569c473bee..fb726c8634690d73d1be90db46ee2743dc64eaae 100644 (file)
@@ -180,7 +180,7 @@ DHCPv4.ListenPort,                           config_parse_uint16,
 DHCPv4.SendRelease,                          config_parse_bool,                                        0,                             offsetof(Network, dhcp_send_release)
 DHCPv4.SendDecline,                          config_parse_bool,                                        0,                             offsetof(Network, dhcp_send_decline)
 DHCPv4.BlackList,                            config_parse_dhcp_black_listed_ip_address,                0,                             0
-DHCPv4.IPServiceType,                        config_parse_ip_service_type,                             0,                             offsetof(Network, ip_service_type)
+DHCPv4.IPServiceType,                        config_parse_dhcp_ip_service_type,                        0,                             offsetof(Network, ip_service_type)
 DHCPv4.SendOption,                           config_parse_dhcp_send_option,                            0,                             offsetof(Network, dhcp_client_send_options)
 DHCPv4.RouteMTUBytes,                        config_parse_mtu,                                         AF_INET,                       offsetof(Network, dhcp_route_mtu)
 DHCPv6.UseDNS,                               config_parse_bool,                                        0,                             offsetof(Network, dhcp6_use_dns)