fc2f9534d07db2b185c02b1961428b53daf1986eLennart Poettering This file is part of systemd.
fc2f9534d07db2b185c02b1961428b53daf1986eLennart Poettering Copyright 2013 Tom Gundersen <teg@jklm.no>
fc2f9534d07db2b185c02b1961428b53daf1986eLennart Poettering systemd is free software; you can redistribute it and/or modify it
fc2f9534d07db2b185c02b1961428b53daf1986eLennart Poettering under the terms of the GNU Lesser General Public License as published by
fc2f9534d07db2b185c02b1961428b53daf1986eLennart Poettering the Free Software Foundation; either version 2.1 of the License, or
fc2f9534d07db2b185c02b1961428b53daf1986eLennart Poettering (at your option) any later version.
fc2f9534d07db2b185c02b1961428b53daf1986eLennart Poettering systemd is distributed in the hope that it will be useful, but
fc2f9534d07db2b185c02b1961428b53daf1986eLennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
fc2f9534d07db2b185c02b1961428b53daf1986eLennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
fc2f9534d07db2b185c02b1961428b53daf1986eLennart Poettering Lesser General Public License for more details.
fc2f9534d07db2b185c02b1961428b53daf1986eLennart Poettering You should have received a copy of the GNU Lesser General Public License
fc2f9534d07db2b185c02b1961428b53daf1986eLennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
fc2f9534d07db2b185c02b1961428b53daf1986eLennart Poetteringconst char *address_family_boolean_to_string(AddressFamilyBoolean b) {
fc2f9534d07db2b185c02b1961428b53daf1986eLennart Poettering return "ipv4";
fc2f9534d07db2b185c02b1961428b53daf1986eLennart Poettering return "ipv6";
fc2f9534d07db2b185c02b1961428b53daf1986eLennart PoetteringAddressFamilyBoolean address_family_boolean_from_string(const char *s) {
fc2f9534d07db2b185c02b1961428b53daf1986eLennart Poettering /* Make this a true superset of a boolean */
fc2f9534d07db2b185c02b1961428b53daf1986eLennart PoetteringDEFINE_CONFIG_PARSE_ENUM(config_parse_address_family_boolean, address_family_boolean, AddressFamilyBoolean, "Failed to parse option");
fc2f9534d07db2b185c02b1961428b53daf1986eLennart Poetteringint config_parse_address_family_boolean_with_kernel(
765afd5c4dbc71940d6dd6007ecc3eaa5a0b2aa1Lennart Poettering /* This function is mostly obsolete now. It simply redirects
765afd5c4dbc71940d6dd6007ecc3eaa5a0b2aa1Lennart Poettering * "kernel" to "no". In older networkd versions we used to
765afd5c4dbc71940d6dd6007ecc3eaa5a0b2aa1Lennart Poettering * distuingish IPForward=off from IPForward=kernel, where the
765afd5c4dbc71940d6dd6007ecc3eaa5a0b2aa1Lennart Poettering * former would explicitly turn off forwarding while the
765afd5c4dbc71940d6dd6007ecc3eaa5a0b2aa1Lennart Poettering * latter would simply not touch the setting. But that logic
765afd5c4dbc71940d6dd6007ecc3eaa5a0b2aa1Lennart Poettering * is gone, hence silently accept the old setting, but turn it
fc2f9534d07db2b185c02b1961428b53daf1986eLennart Poettering s = address_family_boolean_from_string(rvalue);
85e070c2b3f66d838c11f8f008106b9e42c9afafMichal Sekletar log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse IPForward= option, ignoring: %s", rvalue);