summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-dhcp4.c
diff options
context:
space:
mode:
authorSusant Sahani <ssahani@vmware.com>2020-03-02 21:44:01 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2020-03-03 03:53:49 +0100
commita75b21175078988cc22310f2d12c74c7bad92e40 (patch)
treef6098a8e019269034b9294a81f5f1fe5f2a7ca84 /src/network/networkd-dhcp4.c
parentMerge pull request #14992 from keszybz/syslog-address-length-fix (diff)
downloadsystemd-a75b21175078988cc22310f2d12c74c7bad92e40.tar.xz
systemd-a75b21175078988cc22310f2d12c74c7bad92e40.zip
network: Move config_parse_ip_service_type to networkd-dhcp4.c and
rename
Diffstat (limited to 'src/network/networkd-dhcp4.c')
-rw-r--r--src/network/networkd-dhcp4.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
index 34770f6f2b..13e3e32f40 100644
--- a/src/network/networkd-dhcp4.c
+++ b/src/network/networkd-dhcp4.c
@@ -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",