networkd-util.c revision 765afd5c4dbc71940d6dd6007ecc3eaa5a0b2aa1
0d8efe3535b3ce9ecbc2c6482007edfc3ac492d0Dave Reisner/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
0d8efe3535b3ce9ecbc2c6482007edfc3ac492d0Dave Reisner This file is part of systemd.
0d8efe3535b3ce9ecbc2c6482007edfc3ac492d0Dave Reisner Copyright 2013 Tom Gundersen <teg@jklm.no>
0d8efe3535b3ce9ecbc2c6482007edfc3ac492d0Dave Reisner systemd is free software; you can redistribute it and/or modify it
0d8efe3535b3ce9ecbc2c6482007edfc3ac492d0Dave Reisner under the terms of the GNU Lesser General Public License as published by
0d8efe3535b3ce9ecbc2c6482007edfc3ac492d0Dave Reisner the Free Software Foundation; either version 2.1 of the License, or
0d8efe3535b3ce9ecbc2c6482007edfc3ac492d0Dave Reisner (at your option) any later version.
328b5bc96e452b67ae2eb3dee3a09ff3ce03f662Dave Reisner systemd is distributed in the hope that it will be useful, but
328b5bc96e452b67ae2eb3dee3a09ff3ce03f662Dave Reisner WITHOUT ANY WARRANTY; without even the implied warranty of
328b5bc96e452b67ae2eb3dee3a09ff3ce03f662Dave Reisner MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
328b5bc96e452b67ae2eb3dee3a09ff3ce03f662Dave Reisner Lesser General Public License for more details.
328b5bc96e452b67ae2eb3dee3a09ff3ce03f662Dave Reisner You should have received a copy of the GNU Lesser General Public License
328b5bc96e452b67ae2eb3dee3a09ff3ce03f662Dave Reisner along with systemd; If not, see <http://www.gnu.org/licenses/>.
328b5bc96e452b67ae2eb3dee3a09ff3ce03f662Dave Reisnerconst char *address_family_boolean_to_string(AddressFamilyBoolean b) {
328b5bc96e452b67ae2eb3dee3a09ff3ce03f662Dave Reisner return "ipv4";
328b5bc96e452b67ae2eb3dee3a09ff3ce03f662Dave Reisner return "ipv6";
328b5bc96e452b67ae2eb3dee3a09ff3ce03f662Dave ReisnerAddressFamilyBoolean address_family_boolean_from_string(const char *s) {
328b5bc96e452b67ae2eb3dee3a09ff3ce03f662Dave Reisner /* Make this a true superset of a boolean */
0d8efe3535b3ce9ecbc2c6482007edfc3ac492d0Dave ReisnerDEFINE_CONFIG_PARSE_ENUM(config_parse_address_family_boolean, address_family_boolean, AddressFamilyBoolean, "Failed to parse option");
0d8efe3535b3ce9ecbc2c6482007edfc3ac492d0Dave Reisnerint config_parse_address_family_boolean_with_kernel(
0d8efe3535b3ce9ecbc2c6482007edfc3ac492d0Dave Reisner const char* unit,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
s = ADDRESS_FAMILY_NO;
log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse IPForward= option, ignoring: %s", rvalue);
*fwd = s;
int config_parse_resolve(
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) {
log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse %s= option, ignoring: %s", lvalue, rvalue);
*resolve = s;