From d8b736bd0c7dcd4e3735d7557e92fb894a169190 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 18 Nov 2019 17:33:58 +0900 Subject: [PATCH] network: rename SendRawOption= to SendOption= As DHCPv4.SendOption= and DHCPServer.SendRawOption= take the same format. --- man/systemd.network.xml | 34 +++++++++---------- src/network/networkd-dhcp-server.c | 2 +- src/network/networkd-dhcp-server.h | 2 +- src/network/networkd-network-gperf.gperf | 2 +- .../fuzz-network-parser/directives.network | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/man/systemd.network.xml b/man/systemd.network.xml index e87ca1f287..8b401eeaf9 100644 --- a/man/systemd.network.xml +++ b/man/systemd.network.xml @@ -1643,14 +1643,13 @@ SendOption= Send an arbitrary option in the DHCPv4 request. Takes a DHCP option number, data type - and data separated with a colon (option: - type:value). The option - number must be an interger in the range 1..254. The type takes one of - uint8, uint16, uint32, - ipv4address, or string. - Special characters in the data string may be escaped using + and data separated with a colon + (option:type:value). + The option number must be an interger in the range 1..254. The type takes one of uint8, + uint16, uint32, ipv4address, or + string. Special characters in the data string may be escaped using C-style - escapes. This option can be specified multiple times. If an empty string is specified, + escapes. This setting can be specified multiple times. If an empty string is specified, then all options specified earlier are cleared. Defaults to unset. @@ -1905,16 +1904,17 @@ - SendRawOption= - - Send a raw option with value via DHCPv4 server. Takes a DHCP option, data type and data - (option:type:value). The option ranges [1-254]. The type takes one of uint8, - uint16, uint32, ipv4address, or string. - Special characters in the data string may be escaped using - C-style - escapes. This option can be specified multiple times. If an empty string is specified, then all - options specified earlier are cleared. Defaults to unset. - + SendOption= + + Send a raw option with value via DHCPv4 server. Takes a DHCP option number, data type + and data (option:type:value). + The option number is an integer in the range 1..254. The type takes one of uint8, + uint16, uint32, ipv4address, or + string. Special characters in the data string may be escaped using + C-style + escapes. This setting can be specified multiple times. If an empty string is specified, + then all options specified earlier are cleared. Defaults to unset. + diff --git a/src/network/networkd-dhcp-server.c b/src/network/networkd-dhcp-server.c index 79ac325926..8102c1be96 100644 --- a/src/network/networkd-dhcp-server.c +++ b/src/network/networkd-dhcp-server.c @@ -480,7 +480,7 @@ int config_parse_dhcp_server_sip( } } -int config_parse_dhcp_server_raw_option_data( +int config_parse_dhcp_server_option_data( const char *unit, const char *filename, unsigned line, diff --git a/src/network/networkd-dhcp-server.h b/src/network/networkd-dhcp-server.h index e0a7799b1c..21f1f31b15 100644 --- a/src/network/networkd-dhcp-server.h +++ b/src/network/networkd-dhcp-server.h @@ -12,4 +12,4 @@ int dhcp4_server_configure(Link *link); CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_server_dns); CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_server_ntp); CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_server_sip); -CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_server_raw_option_data); +CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_server_option_data); diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf index a99ef94d32..928253cae0 100644 --- a/src/network/networkd-network-gperf.gperf +++ b/src/network/networkd-network-gperf.gperf @@ -200,7 +200,7 @@ DHCPServer.EmitTimezone, config_parse_bool, DHCPServer.Timezone, config_parse_timezone, 0, offsetof(Network, dhcp_server_timezone) DHCPServer.PoolOffset, config_parse_uint32, 0, offsetof(Network, dhcp_server_pool_offset) DHCPServer.PoolSize, config_parse_uint32, 0, offsetof(Network, dhcp_server_pool_size) -DHCPServer.SendRawOption, config_parse_dhcp_server_raw_option_data, 0, 0 +DHCPServer.SendOption, config_parse_dhcp_server_option_data, 0, 0 Bridge.Cost, config_parse_uint32, 0, offsetof(Network, cost) Bridge.UseBPDU, config_parse_tristate, 0, offsetof(Network, use_bpdu) Bridge.HairPin, config_parse_tristate, 0, offsetof(Network, hairpin) diff --git a/test/fuzz/fuzz-network-parser/directives.network b/test/fuzz/fuzz-network-parser/directives.network index a5f54610da..cb10ca306a 100644 --- a/test/fuzz/fuzz-network-parser/directives.network +++ b/test/fuzz/fuzz-network-parser/directives.network @@ -259,7 +259,7 @@ MaxLeaseTimeSec= DefaultLeaseTimeSec= EmitTimezone= DNS= -SendRawOption= +SendOption= [NextHop] Id= Gateway=