networkd-network.c revision edbb03e95a3c31bf719d5c6c46eec14d0bcb9c8f
97a9a944b5887e91042b019776c41d5dd74557aferikabele/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive This file is part of systemd.
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive Copyright 2013 Tom Gundersen <teg@jklm.no>
5a58787efeb02a1c3f06569d019ad81fd2efa06end systemd is free software; you can redistribute it and/or modify it
5a58787efeb02a1c3f06569d019ad81fd2efa06end under the terms of the GNU Lesser General Public License as published by
5a58787efeb02a1c3f06569d019ad81fd2efa06end the Free Software Foundation; either version 2.1 of the License, or
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen (at your option) any later version.
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen systemd is distributed in the hope that it will be useful, but
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen WITHOUT ANY WARRANTY; without even the implied warranty of
5a58787efeb02a1c3f06569d019ad81fd2efa06end MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5a58787efeb02a1c3f06569d019ad81fd2efa06end Lesser General Public License for more details.
d229f940abfb2490dee17979e9a5ff31b7012eb5rbowen You should have received a copy of the GNU Lesser General Public License
3f08db06526d6901aa08c110b5bc7dde6bc39905nd along with systemd; If not, see <http://www.gnu.org/licenses/>.
e1e8390280254f7f0580d701e583f670643d4f3fnilgunstatic int network_load_one(Manager *manager, const char *filename) {
deeee6bb6fd94c0ba5f3730b58abd9d299c89ccdnd network->vlans = hashmap_new(uint64_hash_func, uint64_compare_func);
4a31db3c3a0202003c1b9f87affa7cc143e120e5sf network->addresses_by_section = hashmap_new(uint64_hash_func, uint64_compare_func);
117c1f888a14e73cdd821dc6c23eb0411144a41cnd network->routes_by_section = hashmap_new(uint64_hash_func, uint64_compare_func);
5a58787efeb02a1c3f06569d019ad81fd2efa06end r = config_parse(NULL, filename, file, "Match\0Network\0Address\0Route\0DHCPv4\0", config_item_perf_lookup,
5a58787efeb02a1c3f06569d019ad81fd2efa06end (void*) network_network_gperf_lookup, false, false, network);
55478342807b8fbc71ba2af7444e3a06fad7ebf1rbowen if (r < 0) {
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd log_warning("Could not parse config file %s: %s", filename, strerror(-r));
06ba4a61654b3763ad65f52283832ebf058fdf1cslive LIST_FOREACH(static_routes, route, network->static_routes) {
06ba4a61654b3763ad65f52283832ebf058fdf1cslive log_warning("Route section without Gateway field configured in %s. "
97a9a944b5887e91042b019776c41d5dd74557aferikabele LIST_FOREACH(static_addresses, address, network->static_addresses) {
ffb01336be79c64046b636e59fa8ddca8ec029edsf log_warning("Address section without Address field configured in %s. "
709e3a21ba73b8433462959cd56c773454b34441trawick r = conf_files_list_strv(&files, ".network", NULL, network_dirs);
709e3a21ba73b8433462959cd56c773454b34441trawick if (r < 0) {
709e3a21ba73b8433462959cd56c773454b34441trawick log_error("Failed to enumerate network files: %s", strerror(-r));
5a58787efeb02a1c3f06569d019ad81fd2efa06end if (r < 0)
06ba4a61654b3763ad65f52283832ebf058fdf1cslive LIST_REMOVE(networks, network->manager->networks, network);
2bfb6b5514fae5aff3a3a56a15f3d5a545395c41igalicint network_get(Manager *manager, struct udev_device *device, Network **ret) {
5a58787efeb02a1c3f06569d019ad81fd2efa06end if (net_match_config(network->match_mac, network->match_path,
0d0ba3a410038e179b695446bb149cce6264e0abndint network_apply(Manager *manager, Network *network, Link *link) {
0d0ba3a410038e179b695446bb149cce6264e0abnd if (r < 0)
0d0ba3a410038e179b695446bb149cce6264e0abnd if (r < 0)
const char *filename,
unsigned line,
const char *section,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
const char *filename,
unsigned line,
const char *section,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {
const char *filename,
unsigned line,
const char *section,
unsigned section_line,
const char *lvalue,
int ltype,
const char *rvalue,
void *data,
void *userdata) {