networkd.h revision 1c4baffc1895809bae9ac36b670af90a4cb9cd7d
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen/***
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen This file is part of systemd.
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen Copyright 2013 Tom Gundersen <teg@jklm.no>
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen systemd is free software; you can redistribute it and/or modify it
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen under the terms of the GNU Lesser General Public License as published by
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen the Free Software Foundation; either version 2.1 of the License, or
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen (at your option) any later version.
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen systemd is distributed in the hope that it will be useful, but
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen WITHOUT ANY WARRANTY; without even the implied warranty of
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen Lesser General Public License for more details.
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen You should have received a copy of the GNU Lesser General Public License
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen along with systemd; If not, see <http://www.gnu.org/licenses/>.
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen***/
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen#pragma once
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen#include <arpa/inet.h>
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen#include "sd-event.h"
1c4baffc1895809bae9ac36b670af90a4cb9cd7dTom Gundersen#include "sd-netlink.h"
1346b1f0388f4100bb3c2a2bb23bc881769c020cTom Gundersen#include "sd-bus.h"
f5be560181d092c5f52a2b819aedcd48220f36abTom Gundersen#include "sd-dhcp-client.h"
dd43110f781a9245ec00531456fee68ed763a179Tom Gundersen#include "sd-dhcp-server.h"
5c1d3fc93d91384bbac29adf01074fa4375317eaUmut Tezduyar Lindskog#include "sd-ipv4ll.h"
4138fb2c7936758da709eaed3f6b4f3df1d04effPatrik Flykt#include "sd-icmp6-nd.h"
4138fb2c7936758da709eaed3f6b4f3df1d04effPatrik Flykt#include "sd-dhcp6-client.h"
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen#include "udev.h"
ce43e484465050c619ea9a1991d49b3d6215028bSusant Sahani#include "sd-lldp.h"
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
1c4baffc1895809bae9ac36b670af90a4cb9cd7dTom Gundersen#include "netlink-util.h"
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen#include "hashmap.h"
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen#include "list.h"
06f021a8048583d66202e3ac5cd0a12386d33ac2Tom Gundersen#include "set.h"
134e56dcc53970a20a858283650bb92cd5da1d17Lennart Poettering#include "condition.h"
3b653205cf7bd3851befd0a9f6a3ded6e267c173Lennart Poettering#include "in-addr-util.h"
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
aba496a58acf9d9c61314de71353550e579f85eeUmut Tezduyar Lindskog#define CACHE_INFO_INFINITY_LIFE_TIME 0xFFFFFFFFU
4faefc7ff884eae65a80e82313fd9f4bb859d6dbLennart Poettering#define DHCP_ROUTE_METRIC 1024
4faefc7ff884eae65a80e82313fd9f4bb859d6dbLennart Poettering#define IPV4LL_ROUTE_METRIC 2048
aba496a58acf9d9c61314de71353550e579f85eeUmut Tezduyar Lindskog
1a436809498faf6486815baa0338fb6b8e5def07Tom Gundersentypedef struct NetDev NetDev;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersentypedef struct Network Network;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersentypedef struct Link Link;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersentypedef struct Address Address;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersentypedef struct Route Route;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersentypedef struct Manager Manager;
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poetteringtypedef struct AddressPool AddressPool;
b98b483bac585af754e8a22ea890db8486905d8aAlin Rautatypedef struct FdbEntry FdbEntry;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
cb9fc36a1211967e8c58b0502a26c42552ac8060Lennart Poetteringtypedef enum AddressFamilyBoolean {
769d324c99aab129148bd25f5f663ef441287d86Lennart Poettering /* This is a bitmask, though it usually doesn't feel that way! */
769d324c99aab129148bd25f5f663ef441287d86Lennart Poettering ADDRESS_FAMILY_NO = 0,
769d324c99aab129148bd25f5f663ef441287d86Lennart Poettering ADDRESS_FAMILY_IPV4 = 1,
769d324c99aab129148bd25f5f663ef441287d86Lennart Poettering ADDRESS_FAMILY_IPV6 = 2,
769d324c99aab129148bd25f5f663ef441287d86Lennart Poettering ADDRESS_FAMILY_YES = 3,
cb9fc36a1211967e8c58b0502a26c42552ac8060Lennart Poettering _ADDRESS_FAMILY_BOOLEAN_MAX,
cb9fc36a1211967e8c58b0502a26c42552ac8060Lennart Poettering _ADDRESS_FAMILY_BOOLEAN_INVALID = -1,
cb9fc36a1211967e8c58b0502a26c42552ac8060Lennart Poettering} AddressFamilyBoolean;
ed942a9eb22d50f667909ad6184b45015d28d054Tom Gundersen
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersentypedef enum LLMNRSupport {
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen LLMNR_SUPPORT_NO,
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen LLMNR_SUPPORT_YES,
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen LLMNR_SUPPORT_RESOLVE,
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen _LLMNR_SUPPORT_MAX,
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen _LLMNR_SUPPORT_INVALID = -1,
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen} LLMNRSupport;
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen
e331e24649213f2e093e16e4d3d64ee823dfc375Tom Gundersentypedef enum LinkOperationalState {
e331e24649213f2e093e16e4d3d64ee823dfc375Tom Gundersen LINK_OPERSTATE_OFF,
e331e24649213f2e093e16e4d3d64ee823dfc375Tom Gundersen LINK_OPERSTATE_NO_CARRIER,
e331e24649213f2e093e16e4d3d64ee823dfc375Tom Gundersen LINK_OPERSTATE_DORMANT,
e331e24649213f2e093e16e4d3d64ee823dfc375Tom Gundersen LINK_OPERSTATE_CARRIER,
e331e24649213f2e093e16e4d3d64ee823dfc375Tom Gundersen LINK_OPERSTATE_DEGRADED,
e331e24649213f2e093e16e4d3d64ee823dfc375Tom Gundersen LINK_OPERSTATE_ROUTABLE,
e331e24649213f2e093e16e4d3d64ee823dfc375Tom Gundersen _LINK_OPERSTATE_MAX,
e331e24649213f2e093e16e4d3d64ee823dfc375Tom Gundersen _LINK_OPERSTATE_INVALID = -1
e331e24649213f2e093e16e4d3d64ee823dfc375Tom Gundersen} LinkOperationalState;
e331e24649213f2e093e16e4d3d64ee823dfc375Tom Gundersen
3e43b2cd97bd82efe6a09e8b9b2e6b5f33f578a0Jan Janssentypedef enum DCHPClientIdentifier {
3e43b2cd97bd82efe6a09e8b9b2e6b5f33f578a0Jan Janssen DHCP_CLIENT_ID_MAC,
3e43b2cd97bd82efe6a09e8b9b2e6b5f33f578a0Jan Janssen DHCP_CLIENT_ID_DUID,
3e43b2cd97bd82efe6a09e8b9b2e6b5f33f578a0Jan Janssen _DHCP_CLIENT_ID_MAX,
3e43b2cd97bd82efe6a09e8b9b2e6b5f33f578a0Jan Janssen _DHCP_CLIENT_ID_INVALID = -1,
3e43b2cd97bd82efe6a09e8b9b2e6b5f33f578a0Jan Janssen} DCHPClientIdentifier;
3e43b2cd97bd82efe6a09e8b9b2e6b5f33f578a0Jan Janssen
b98b483bac585af754e8a22ea890db8486905d8aAlin Rautastruct FdbEntry {
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta Network *network;
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta unsigned section;
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta struct ether_addr *mac_addr;
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta uint16_t vlan_id;
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta LIST_FIELDS(FdbEntry, static_fdb_entries);
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta};
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersenstruct Network {
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen Manager *manager;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen char *filename;
dbffab87f1504abc9f189dd253111693c99fbd9aTom Gundersen char *name;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen struct ether_addr *match_mac;
5256e00e8b9015dd1a976d647fc71dc7efbd8cf8Tom Gundersen char **match_path;
5256e00e8b9015dd1a976d647fc71dc7efbd8cf8Tom Gundersen char **match_driver;
5256e00e8b9015dd1a976d647fc71dc7efbd8cf8Tom Gundersen char **match_type;
5256e00e8b9015dd1a976d647fc71dc7efbd8cf8Tom Gundersen char **match_name;
edb85f0d8d0a84f27308a3728f3fde3c52b9dce2Susant Sahani
2cc412b59353576cece2d5b30c6a39c70552f0a0Tom Gundersen Condition *match_host;
2cc412b59353576cece2d5b30c6a39c70552f0a0Tom Gundersen Condition *match_virt;
2cc412b59353576cece2d5b30c6a39c70552f0a0Tom Gundersen Condition *match_kernel;
edbb03e95a3c31bf719d5c6c46eec14d0bcb9c8fTom Gundersen Condition *match_arch;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen char *description;
1a436809498faf6486815baa0338fb6b8e5def07Tom Gundersen NetDev *bridge;
1a436809498faf6486815baa0338fb6b8e5def07Tom Gundersen NetDev *bond;
6a0a2f860f1ca4a10932da3b41dbc3c0139757ccTom Gundersen Hashmap *stacked_netdevs;
cb9fc36a1211967e8c58b0502a26c42552ac8060Lennart Poettering AddressFamilyBoolean dhcp;
3e43b2cd97bd82efe6a09e8b9b2e6b5f33f578a0Jan Janssen DCHPClientIdentifier dhcp_client_identifier;
3175fcdec5d748e8db85a3e7fe1cb67f5f6a865dTom Gundersen char *dhcp_vendor_class_identifier;
5be4d38e31281727b6f45ae869136bb01a1f7790Tom Gundersen bool dhcp_dns;
bcb7a07e0a785bda1eed658e984ff6b4a11cba9aTom Gundersen bool dhcp_ntp;
4f882b2a5007e51032459e29d15a86df6b5ea9f4Tom Gundersen bool dhcp_mtu;
1346b1f0388f4100bb3c2a2bb23bc881769c020cTom Gundersen bool dhcp_hostname;
ad0734e890b25751ef8229e47210ff11ae8fa3f3Tom Gundersen bool dhcp_domains;
4cc7a82c9490a3c5ae03b1d6d168ce40ba499e23Eugene Yakubovich bool dhcp_sendhost;
f5de5b00204f041aaec828d336c8afd9e860a5c3Tom Gundersen bool dhcp_broadcast;
eb27aeca247a4cf8816fffc4c0dbcab55ead3864Tom Gundersen bool dhcp_critical;
e1ea665edac17d75fce01b72dadfa3211b60df2cEugene Yakubovich bool dhcp_routes;
84b5b79a8f7b423c5b7cad4170eb68d57fe5e26cAngus Gibson unsigned dhcp_route_metric;
d0d6a4cd70477970812bff0a37e70f66208d7c14Tom Gundersen AddressFamilyBoolean link_local;
bfa695b5cc37aeb78737c57c84e9e69ea08152c0Tom Gundersen bool ipv4ll_route;
7f77697a1744f8df2089848b9d718faf7ba6c665Tom Gundersen union in_addr_union ipv6_token;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
dd43110f781a9245ec00531456fee68ed763a179Tom Gundersen bool dhcp_server;
dd43110f781a9245ec00531456fee68ed763a179Tom Gundersen
e1853b00ef7cb56cafd908327dd44b3ab48b402cSusant Sahani unsigned cost;
e1853b00ef7cb56cafd908327dd44b3ab48b402cSusant Sahani
769d324c99aab129148bd25f5f663ef441287d86Lennart Poettering AddressFamilyBoolean ip_forward;
5a8bcb674f71a20e95df55319b34c556638378ceLennart Poettering bool ip_masquerade;
5a8bcb674f71a20e95df55319b34c556638378ceLennart Poettering
c106cc36b9b8e8998eb95299b02f1db9c1209122Tom Gundersen struct ether_addr *mac;
c106cc36b9b8e8998eb95299b02f1db9c1209122Tom Gundersen unsigned mtu;
c106cc36b9b8e8998eb95299b02f1db9c1209122Tom Gundersen
ce43e484465050c619ea9a1991d49b3d6215028bSusant Sahani bool lldp;
ce43e484465050c619ea9a1991d49b3d6215028bSusant Sahani
f048a16b464295a4e0a4f4c1210f06343ad31231Tom Gundersen LIST_HEAD(Address, static_addresses);
f048a16b464295a4e0a4f4c1210f06343ad31231Tom Gundersen LIST_HEAD(Route, static_routes);
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta LIST_HEAD(FdbEntry, static_fdb_entries);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
6ae115c1fe95611b39d2f20cfcea3d385429f59eTom Gundersen Hashmap *addresses_by_section;
6ae115c1fe95611b39d2f20cfcea3d385429f59eTom Gundersen Hashmap *routes_by_section;
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta Hashmap *fdb_entries_by_section;
6ae115c1fe95611b39d2f20cfcea3d385429f59eTom Gundersen
67272d157a35e5cda4e5c904eafdcc23d20541d1Tom Gundersen bool wildcard_domain;
0d4ad91dd4fc831c31a9775b0eadf97fea6cd7f6Alin Rauta char **domains, **dns, **ntp, **bind_carrier;
06f021a8048583d66202e3ac5cd0a12386d33ac2Tom Gundersen
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen LLMNRSupport llmnr;
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen LIST_FIELDS(Network, networks);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen};
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersenstruct Address {
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen Network *network;
16aa63a00b5b1db23a9c0b8de350ebf482d90cd0Tom Gundersen unsigned section;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering int family;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen unsigned char prefixlen;
5c1d3fc93d91384bbac29adf01074fa4375317eaUmut Tezduyar Lindskog unsigned char scope;
851c9f82736c89d423b244a292e153ec7124d309Patrik Flykt uint32_t flags;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen char *label;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
eb0ea358b688a6f83ff305c6b825c61f12b6dcb8Tom Gundersen struct in_addr broadcast;
aba496a58acf9d9c61314de71353550e579f85eeUmut Tezduyar Lindskog struct ifa_cacheinfo cinfo;
8cd11a0f0f4ca05199e1166f6a07472b296f7455Tom Gundersen
5d3de3fe9cc452f1bfe3c2dcafecbd7f904da4dcLennart Poettering union in_addr_union in_addr;
c081882f07617e56bcbce54105068137e4e0bb52Susant Sahani union in_addr_union in_addr_peer;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
fd6d906cf46ecef45ebbb5a361e1dc436f031d7aLennart Poettering bool ip_masquerade_done;
5a8bcb674f71a20e95df55319b34c556638378ceLennart Poettering
3d3d425547a3f38473fcf8737b85dfebb630479dTom Gundersen LIST_FIELDS(Address, addresses);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen};
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersenstruct Route {
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen Network *network;
16aa63a00b5b1db23a9c0b8de350ebf482d90cd0Tom Gundersen unsigned section;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering int family;
6ae115c1fe95611b39d2f20cfcea3d385429f59eTom Gundersen unsigned char dst_prefixlen;
9e7e440835c43d81ffdbc299d2c07daaa641ed50Tom Gundersen unsigned char src_prefixlen;
5c1d3fc93d91384bbac29adf01074fa4375317eaUmut Tezduyar Lindskog unsigned char scope;
5c1d3fc93d91384bbac29adf01074fa4375317eaUmut Tezduyar Lindskog uint32_t metrics;
28cc555d8504c9429776aedbbe1fee7101258578Dan Williams unsigned char protocol; /* RTPROT_* */
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
5d3de3fe9cc452f1bfe3c2dcafecbd7f904da4dcLennart Poettering union in_addr_union in_addr;
5d3de3fe9cc452f1bfe3c2dcafecbd7f904da4dcLennart Poettering union in_addr_union dst_addr;
9e7e440835c43d81ffdbc299d2c07daaa641ed50Tom Gundersen union in_addr_union src_addr;
46b0c76e2c355c0d0cc4792abb98cde07b28bc53Emil Renner Berthing union in_addr_union prefsrc_addr;
6ae115c1fe95611b39d2f20cfcea3d385429f59eTom Gundersen
3d3d425547a3f38473fcf8737b85dfebb630479dTom Gundersen LIST_FIELDS(Route, routes);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen};
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poetteringstruct AddressPool {
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering Manager *manager;
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering int family;
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering unsigned prefixlen;
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering union in_addr_union in_addr;
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering LIST_FIELDS(AddressPool, address_pools);
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering};
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersenstruct Manager {
1c4baffc1895809bae9ac36b670af90a4cb9cd7dTom Gundersen sd_netlink *rtnl;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen sd_event *event;
9c0a72f961e00b0447767973e7117e131bea5b5dTom Gundersen sd_event_source *bus_retry_event_source;
1346b1f0388f4100bb3c2a2bb23bc881769c020cTom Gundersen sd_bus *bus;
9c0a72f961e00b0447767973e7117e131bea5b5dTom Gundersen sd_bus_slot *prepare_for_sleep_slot;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen struct udev *udev;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen struct udev_monitor *udev_monitor;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen sd_event_source *udev_event_source;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
6a24f1484fcc1f59f89617afbe4282667a358eabTom Gundersen bool enumerating;
6a24f1484fcc1f59f89617afbe4282667a358eabTom Gundersen
bbf7c04821a71fec67eaf0e7a34d17afc5913c13Tom Gundersen char *state_file;
e331e24649213f2e093e16e4d3d64ee823dfc375Tom Gundersen LinkOperationalState operational_state;
bbf7c04821a71fec67eaf0e7a34d17afc5913c13Tom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen Hashmap *links;
52433f6b65eccd1c54606dde999610640f3458acTom Gundersen Hashmap *netdevs;
dbffab87f1504abc9f189dd253111693c99fbd9aTom Gundersen Hashmap *networks_by_name;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen LIST_HEAD(Network, networks);
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering LIST_HEAD(AddressPool, address_pools);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen usec_t network_dirs_ts_usec;
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen};
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
2ad8416dd057e7e3185169609ca3006e7649f576Zbigniew Jędrzejewski-Szmekextern const char* const network_dirs[];
2ad8416dd057e7e3185169609ca3006e7649f576Zbigniew Jędrzejewski-Szmek
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen/* Manager */
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
e331e24649213f2e093e16e4d3d64ee823dfc375Tom Gundersenextern const sd_bus_vtable manager_vtable[];
e331e24649213f2e093e16e4d3d64ee823dfc375Tom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersenint manager_new(Manager **ret);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersenvoid manager_free(Manager *m);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
8f203c166ecb24f904a068f2d8f0c636c1511a8fTom Gundersenint manager_connect_bus(Manager *m);
a97dcc12e486ecff531809802930a26c4da827f2Tom Gundersenint manager_run(Manager *m);
a97dcc12e486ecff531809802930a26c4da827f2Tom Gundersen
02b59d57e0c08231645120077f651151f5bb2babTom Gundersenint manager_load_config(Manager *m);
02b59d57e0c08231645120077f651151f5bb2babTom Gundersenbool manager_should_reload(Manager *m);
02b59d57e0c08231645120077f651151f5bb2babTom Gundersen
505f8da7325591defe5f751f328bd26915267602Tom Gundersenint manager_rtnl_enumerate_links(Manager *m);
45af44d47da6933b260c734ad9ff721f63f80a4dTom Gundersenint manager_rtnl_enumerate_addresses(Manager *m);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
e331e24649213f2e093e16e4d3d64ee823dfc375Tom Gundersenint manager_send_changed(Manager *m, const char *property, ...) _sentinel_;
bbf7c04821a71fec67eaf0e7a34d17afc5913c13Tom Gundersenint manager_save(Manager *m);
3bef724f7e7f7eaca69881548b06e221b77d7031Tom Gundersen
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poetteringint manager_address_pool_acquire(Manager *m, int family, unsigned prefixlen, union in_addr_union *found);
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom GundersenDEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_free);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen#define _cleanup_manager_free_ _cleanup_(manager_freep)
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen/* Network */
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersenint network_load(Manager *manager);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersenvoid network_free(Network *network);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom GundersenDEFINE_TRIVIAL_CLEANUP_FUNC(Network*, network_free);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen#define _cleanup_network_free_ _cleanup_(network_freep)
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
dbffab87f1504abc9f189dd253111693c99fbd9aTom Gundersenint network_get_by_name(Manager *manager, const char *name, Network **ret);
505f8da7325591defe5f751f328bd26915267602Tom Gundersenint network_get(Manager *manager, struct udev_device *device,
505f8da7325591defe5f751f328bd26915267602Tom Gundersen const char *ifname, const struct ether_addr *mac,
505f8da7325591defe5f751f328bd26915267602Tom Gundersen Network **ret);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersenint network_apply(Manager *manager, Network *network, Link *link);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
69a93e7db47addc4495a6ec9dc0fc74092a6ebeeTom Gundersenint config_parse_netdev(const char *unit, const char *filename, unsigned line,
02b59d57e0c08231645120077f651151f5bb2babTom Gundersen const char *section, unsigned section_line, const char *lvalue,
02b59d57e0c08231645120077f651151f5bb2babTom Gundersen int ltype, const char *rvalue, void *data, void *userdata);
02b59d57e0c08231645120077f651151f5bb2babTom Gundersen
6192b846ca0d15602e94ddb5da4420b7c60d64a5Tom Gundersenint config_parse_domains(const char *unit,
6192b846ca0d15602e94ddb5da4420b7c60d64a5Tom Gundersen const char *filename,
6192b846ca0d15602e94ddb5da4420b7c60d64a5Tom Gundersen unsigned line,
6192b846ca0d15602e94ddb5da4420b7c60d64a5Tom Gundersen const char *section,
6192b846ca0d15602e94ddb5da4420b7c60d64a5Tom Gundersen unsigned section_line,
6192b846ca0d15602e94ddb5da4420b7c60d64a5Tom Gundersen const char *lvalue,
6192b846ca0d15602e94ddb5da4420b7c60d64a5Tom Gundersen int ltype,
6192b846ca0d15602e94ddb5da4420b7c60d64a5Tom Gundersen const char *rvalue,
6192b846ca0d15602e94ddb5da4420b7c60d64a5Tom Gundersen void *data,
6192b846ca0d15602e94ddb5da4420b7c60d64a5Tom Gundersen void *userdata);
6192b846ca0d15602e94ddb5da4420b7c60d64a5Tom Gundersen
7951dea20911969287878e6897b3eca348721adeSusant Sahaniint config_parse_tunnel(const char *unit,
7951dea20911969287878e6897b3eca348721adeSusant Sahani const char *filename,
7951dea20911969287878e6897b3eca348721adeSusant Sahani unsigned line,
7951dea20911969287878e6897b3eca348721adeSusant Sahani const char *section,
7951dea20911969287878e6897b3eca348721adeSusant Sahani unsigned section_line,
7951dea20911969287878e6897b3eca348721adeSusant Sahani const char *lvalue,
7951dea20911969287878e6897b3eca348721adeSusant Sahani int ltype,
7951dea20911969287878e6897b3eca348721adeSusant Sahani const char *rvalue,
7951dea20911969287878e6897b3eca348721adeSusant Sahani void *data,
7951dea20911969287878e6897b3eca348721adeSusant Sahani void *userdata);
7951dea20911969287878e6897b3eca348721adeSusant Sahani
7951dea20911969287878e6897b3eca348721adeSusant Sahaniint config_parse_tunnel_address(const char *unit,
7951dea20911969287878e6897b3eca348721adeSusant Sahani const char *filename,
7951dea20911969287878e6897b3eca348721adeSusant Sahani unsigned line,
7951dea20911969287878e6897b3eca348721adeSusant Sahani const char *section,
7951dea20911969287878e6897b3eca348721adeSusant Sahani unsigned section_line,
7951dea20911969287878e6897b3eca348721adeSusant Sahani const char *lvalue,
7951dea20911969287878e6897b3eca348721adeSusant Sahani int ltype,
7951dea20911969287878e6897b3eca348721adeSusant Sahani const char *rvalue,
7951dea20911969287878e6897b3eca348721adeSusant Sahani void *data,
7951dea20911969287878e6897b3eca348721adeSusant Sahani void *userdata);
7951dea20911969287878e6897b3eca348721adeSusant Sahani
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahaniint config_parse_vxlan_group_address(const char *unit,
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani const char *filename,
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani unsigned line,
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani const char *section,
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani unsigned section_line,
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani const char *lvalue,
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani int ltype,
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani const char *rvalue,
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani void *data,
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani void *userdata);
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahani
3175fcdec5d748e8db85a3e7fe1cb67f5f6a865dTom Gundersenextern const sd_bus_vtable network_vtable[];
3175fcdec5d748e8db85a3e7fe1cb67f5f6a865dTom Gundersen
3175fcdec5d748e8db85a3e7fe1cb67f5f6a865dTom Gundersenint network_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error);
3175fcdec5d748e8db85a3e7fe1cb67f5f6a865dTom Gundersenint network_object_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error);
3175fcdec5d748e8db85a3e7fe1cb67f5f6a865dTom Gundersen
02b59d57e0c08231645120077f651151f5bb2babTom Gundersen/* gperf */
c0dda18697e0994272c0c9616d36f6777b60e2c7Tom Gundersenconst struct ConfigPerfItem* network_network_gperf_lookup(const char *key, unsigned length);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen/* Route */
f048a16b464295a4e0a4f4c1210f06343ad31231Tom Gundersenint route_new_static(Network *network, unsigned section, Route **ret);
28cc555d8504c9429776aedbbe1fee7101258578Dan Williamsint route_new_dynamic(Route **ret, unsigned char rtm_protocol);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersenvoid route_free(Route *route);
1c4baffc1895809bae9ac36b670af90a4cb9cd7dTom Gundersenint route_configure(Route *route, Link *link, sd_netlink_message_handler_t callback);
1c4baffc1895809bae9ac36b670af90a4cb9cd7dTom Gundersenint route_drop(Route *route, Link *link, sd_netlink_message_handler_t callback);
5c1d3fc93d91384bbac29adf01074fa4375317eaUmut Tezduyar Lindskog
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom GundersenDEFINE_TRIVIAL_CLEANUP_FUNC(Route*, route_free);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen#define _cleanup_route_free_ _cleanup_(route_freep)
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersenint config_parse_gateway(const char *unit, const char *filename, unsigned line,
71a6151083d842b2f5bf04e50239f0bf85d34d2eTom Gundersen const char *section, unsigned section_line, const char *lvalue,
71a6151083d842b2f5bf04e50239f0bf85d34d2eTom Gundersen int ltype, const char *rvalue, void *data, void *userdata);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
6ae115c1fe95611b39d2f20cfcea3d385429f59eTom Gundersenint config_parse_destination(const char *unit, const char *filename, unsigned line,
6ae115c1fe95611b39d2f20cfcea3d385429f59eTom Gundersen const char *section, unsigned section_line, const char *lvalue,
6ae115c1fe95611b39d2f20cfcea3d385429f59eTom Gundersen int ltype, const char *rvalue, void *data, void *userdata);
6ae115c1fe95611b39d2f20cfcea3d385429f59eTom Gundersen
5d8e593dce074bff966fc0a46579c61b4f3bc33aSusant Sahaniint config_parse_route_priority(const char *unit, const char *filename, unsigned line,
5d8e593dce074bff966fc0a46579c61b4f3bc33aSusant Sahani const char *section, unsigned section_line, const char *lvalue,
5d8e593dce074bff966fc0a46579c61b4f3bc33aSusant Sahani int ltype, const char *rvalue, void *data, void *userdata);
769b56a308c3f3d3952eda87fd4fb004207f4f49Tom Gundersen
769b56a308c3f3d3952eda87fd4fb004207f4f49Tom Gundersenint config_parse_route_scope(const char *unit, const char *filename, unsigned line,
769b56a308c3f3d3952eda87fd4fb004207f4f49Tom Gundersen const char *section, unsigned section_line, const char *lvalue,
769b56a308c3f3d3952eda87fd4fb004207f4f49Tom Gundersen int ltype, const char *rvalue, void *data, void *userdata);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen/* Address */
f048a16b464295a4e0a4f4c1210f06343ad31231Tom Gundersenint address_new_static(Network *network, unsigned section, Address **ret);
f048a16b464295a4e0a4f4c1210f06343ad31231Tom Gundersenint address_new_dynamic(Address **ret);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersenvoid address_free(Address *address);
1c4baffc1895809bae9ac36b670af90a4cb9cd7dTom Gundersenint address_configure(Address *address, Link *link, sd_netlink_message_handler_t callback);
1c4baffc1895809bae9ac36b670af90a4cb9cd7dTom Gundersenint address_update(Address *address, Link *link, sd_netlink_message_handler_t callback);
1c4baffc1895809bae9ac36b670af90a4cb9cd7dTom Gundersenint address_drop(Address *address, Link *link, sd_netlink_message_handler_t callback);
5a8bcb674f71a20e95df55319b34c556638378ceLennart Poetteringint address_establish(Address *address, Link *link);
5a8bcb674f71a20e95df55319b34c556638378ceLennart Poetteringint address_release(Address *address, Link *link);
9505d3c6deda0452c22ab2ed47bca74b98d87a17Tom Gundersenbool address_equal(Address *a1, Address *a2);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom GundersenDEFINE_TRIVIAL_CLEANUP_FUNC(Address*, address_free);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen#define _cleanup_address_free_ _cleanup_(address_freep)
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersenint config_parse_address(const char *unit, const char *filename, unsigned line,
71a6151083d842b2f5bf04e50239f0bf85d34d2eTom Gundersen const char *section, unsigned section_line, const char *lvalue,
71a6151083d842b2f5bf04e50239f0bf85d34d2eTom Gundersen int ltype, const char *rvalue, void *data, void *userdata);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen
eb0ea358b688a6f83ff305c6b825c61f12b6dcb8Tom Gundersenint config_parse_broadcast(const char *unit, const char *filename, unsigned line,
eb0ea358b688a6f83ff305c6b825c61f12b6dcb8Tom Gundersen const char *section, unsigned section_line, const char *lvalue,
eb0ea358b688a6f83ff305c6b825c61f12b6dcb8Tom Gundersen int ltype, const char *rvalue, void *data, void *userdata);
eb0ea358b688a6f83ff305c6b825c61f12b6dcb8Tom Gundersen
6ae115c1fe95611b39d2f20cfcea3d385429f59eTom Gundersenint config_parse_label(const char *unit, const char *filename, unsigned line,
6ae115c1fe95611b39d2f20cfcea3d385429f59eTom Gundersen const char *section, unsigned section_line, const char *lvalue,
6ae115c1fe95611b39d2f20cfcea3d385429f59eTom Gundersen int ltype, const char *rvalue, void *data, void *userdata);
6ae115c1fe95611b39d2f20cfcea3d385429f59eTom Gundersen
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta/* Forwarding database table. */
a245ced0d7b0af9ae5438d978e24183672a0a4d9Tom Gundersenint fdb_entry_configure(Link *const link, FdbEntry *const fdb_entry);
b98b483bac585af754e8a22ea890db8486905d8aAlin Rautavoid fdb_entry_free(FdbEntry *fdb_entry);
b98b483bac585af754e8a22ea890db8486905d8aAlin Rautaint fdb_entry_new_static(Network *const network, const unsigned section, FdbEntry **ret);
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta
b98b483bac585af754e8a22ea890db8486905d8aAlin RautaDEFINE_TRIVIAL_CLEANUP_FUNC(FdbEntry*, fdb_entry_free);
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta#define _cleanup_fdbentry_free_ _cleanup_(fdb_entry_freep)
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta
b98b483bac585af754e8a22ea890db8486905d8aAlin Rautaint config_parse_fdb_hwaddr(const char *unit, const char *filename, unsigned line,
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta const char *section, unsigned section_line, const char *lvalue,
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta int ltype, const char *rvalue, void *data, void *userdata);
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta
b98b483bac585af754e8a22ea890db8486905d8aAlin Rautaint config_parse_fdb_vlan_id(const char *unit, const char *filename, unsigned line,
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta const char *section, unsigned section_line, const char *lvalue,
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta int ltype, const char *rvalue, void *data, void *userdata);
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta
ed942a9eb22d50f667909ad6184b45015d28d054Tom Gundersen/* DHCP support */
ed942a9eb22d50f667909ad6184b45015d28d054Tom Gundersen
ed942a9eb22d50f667909ad6184b45015d28d054Tom Gundersenint config_parse_dhcp(const char *unit, const char *filename, unsigned line,
ed942a9eb22d50f667909ad6184b45015d28d054Tom Gundersen const char *section, unsigned section_line, const char *lvalue,
ed942a9eb22d50f667909ad6184b45015d28d054Tom Gundersen int ltype, const char *rvalue, void *data, void *userdata);
3e43b2cd97bd82efe6a09e8b9b2e6b5f33f578a0Jan Janssenint config_parse_dhcp_client_identifier(const char *unit, const char *filename, unsigned line,
3e43b2cd97bd82efe6a09e8b9b2e6b5f33f578a0Jan Janssen const char *section, unsigned section_line, const char *lvalue,
3e43b2cd97bd82efe6a09e8b9b2e6b5f33f578a0Jan Janssen int ltype, const char *rvalue, void *data, void *userdata);
ed942a9eb22d50f667909ad6184b45015d28d054Tom Gundersen
d0d6a4cd70477970812bff0a37e70f66208d7c14Tom Gundersen/* IPv4LL support (legacy) */
d0d6a4cd70477970812bff0a37e70f66208d7c14Tom Gundersen
d0d6a4cd70477970812bff0a37e70f66208d7c14Tom Gundersenint config_parse_ipv4ll(const char *unit, const char *filename, unsigned line,
d0d6a4cd70477970812bff0a37e70f66208d7c14Tom Gundersen const char *section, unsigned section_line, const char *lvalue,
d0d6a4cd70477970812bff0a37e70f66208d7c14Tom Gundersen int ltype, const char *rvalue, void *data, void *userdata);
d0d6a4cd70477970812bff0a37e70f66208d7c14Tom Gundersen
7f77697a1744f8df2089848b9d718faf7ba6c665Tom Gundersen/* IPv6 support */
60c35566600f45350c37f152c1093018972bd9a5Tom Gundersenint config_parse_ipv6token(const char *unit, const char *filename, unsigned line,
60c35566600f45350c37f152c1093018972bd9a5Tom Gundersen const char *section, unsigned section_line, const char *lvalue,
60c35566600f45350c37f152c1093018972bd9a5Tom Gundersen int ltype, const char *rvalue, void *data, void *userdata);
7f77697a1744f8df2089848b9d718faf7ba6c665Tom Gundersen
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen/* LLMNR support */
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersenconst char* llmnr_support_to_string(LLMNRSupport i) _const_;
bd8f65387673e29f46136a4ed172097035002c23Tom GundersenLLMNRSupport llmnr_support_from_string(const char *s) _pure_;
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersenint config_parse_llmnr(const char *unit, const char *filename, unsigned line,
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen const char *section, unsigned section_line, const char *lvalue,
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen int ltype, const char *rvalue, void *data, void *userdata);
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering/* Address Pool */
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poetteringint address_pool_new(Manager *m, AddressPool **ret, int family, const union in_addr_union *u, unsigned prefixlen);
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poetteringint address_pool_new_from_string(Manager *m, AddressPool **ret, int family, const char *p, unsigned prefixlen);
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poetteringvoid address_pool_free(AddressPool *p);
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poetteringint address_pool_acquire(AddressPool *p, unsigned prefixlen, union in_addr_union *found);
cb9fc36a1211967e8c58b0502a26c42552ac8060Lennart Poettering
cb9fc36a1211967e8c58b0502a26c42552ac8060Lennart Poetteringconst char *address_family_boolean_to_string(AddressFamilyBoolean b) _const_;
cb9fc36a1211967e8c58b0502a26c42552ac8060Lennart PoetteringAddressFamilyBoolean address_family_boolean_from_string(const char *s) _const_;
769d324c99aab129148bd25f5f663ef441287d86Lennart Poettering
769d324c99aab129148bd25f5f663ef441287d86Lennart Poetteringint config_parse_address_family_boolean(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);
e331e24649213f2e093e16e4d3d64ee823dfc375Tom Gundersen
8add5f79709f323f1b077dde8a4a1aa7f560886fNick Owens/* IPForwarding parser */
8add5f79709f323f1b077dde8a4a1aa7f560886fNick Owensint config_parse_address_family_boolean_with_kernel(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);
8add5f79709f323f1b077dde8a4a1aa7f560886fNick Owens
6a7a4e4d0a057febab787a2d5d3e0b52d2db2268Lennart Poettering/* Operational State */
e331e24649213f2e093e16e4d3d64ee823dfc375Tom Gundersen
e331e24649213f2e093e16e4d3d64ee823dfc375Tom Gundersenconst char* link_operstate_to_string(LinkOperationalState s) _const_;
e331e24649213f2e093e16e4d3d64ee823dfc375Tom GundersenLinkOperationalState link_operstate_from_string(const char *s) _pure_;