networkd.h revision ce43e484465050c619ea9a1991d49b3d6215028b
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen This file is part of systemd.
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen Copyright 2013 Tom Gundersen <teg@jklm.no>
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 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 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/>.
aba496a58acf9d9c61314de71353550e579f85eeUmut Tezduyar Lindskog#define CACHE_INFO_INFINITY_LIFE_TIME 0xFFFFFFFFU
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen unsigned char prefixlen;
81163121e649523b4071f67ddc03c2db649036c5Tom Gundersen unsigned char flags;
2ad8416dd057e7e3185169609ca3006e7649f576Zbigniew Jędrzejewski-Szmekextern const char* const network_dirs[];
45af44d47da6933b260c734ad9ff721f63f80a4dTom Gundersenint manager_rtnl_enumerate_addresses(Manager *m);
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poetteringint manager_address_pool_acquire(Manager *m, int family, unsigned prefixlen, union in_addr_union *found);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom GundersenDEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_free);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen#define _cleanup_manager_free_ _cleanup_(manager_freep)
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom GundersenDEFINE_TRIVIAL_CLEANUP_FUNC(Network*, network_free);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen#define _cleanup_network_free_ _cleanup_(network_freep)
505f8da7325591defe5f751f328bd26915267602Tom Gundersenint network_get(Manager *manager, struct udev_device *device,
505f8da7325591defe5f751f328bd26915267602Tom Gundersen const char *ifname, const struct ether_addr *mac,
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersenint network_apply(Manager *manager, Network *network, Link *link);
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);
7951dea20911969287878e6897b3eca348721adeSusant Sahaniint config_parse_tunnel_address(const char *unit,
85a8eeee36b57c1ab382b0225fa9a87525bbeee9Susant Sahaniint config_parse_vxlan_group_address(const char *unit,
c0dda18697e0994272c0c9616d36f6777b60e2c7Tom Gundersenconst struct ConfigPerfItem* network_network_gperf_lookup(const char *key, unsigned length);
f048a16b464295a4e0a4f4c1210f06343ad31231Tom Gundersenint route_new_static(Network *network, unsigned section, Route **ret);
28cc555d8504c9429776aedbbe1fee7101258578Dan Williamsint route_new_dynamic(Route **ret, unsigned char rtm_protocol);
f882c247ad59776c3a7753bb963c1f8e2386cb79Tom Gundersenint route_configure(Route *route, Link *link, sd_rtnl_message_handler_t callback);
5c1d3fc93d91384bbac29adf01074fa4375317eaUmut Tezduyar Lindskogint route_drop(Route *route, Link *link, sd_rtnl_message_handler_t callback);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom GundersenDEFINE_TRIVIAL_CLEANUP_FUNC(Route*, route_free);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen#define _cleanup_route_free_ _cleanup_(route_freep)
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);
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);
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);
f048a16b464295a4e0a4f4c1210f06343ad31231Tom Gundersenint address_new_static(Network *network, unsigned section, Address **ret);
f882c247ad59776c3a7753bb963c1f8e2386cb79Tom Gundersenint address_configure(Address *address, Link *link, sd_rtnl_message_handler_t callback);
aba496a58acf9d9c61314de71353550e579f85eeUmut Tezduyar Lindskogint address_update(Address *address, Link *link, sd_rtnl_message_handler_t callback);
407fe036a24834203aca6c1eec7d74d9ad3e9ee0Tom Gundersenint address_drop(Address *address, Link *link, sd_rtnl_message_handler_t callback);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom GundersenDEFINE_TRIVIAL_CLEANUP_FUNC(Address*, address_free);
f579559b3a14c1f1ef96c372e7626c4733e6ef7dTom Gundersen#define _cleanup_address_free_ _cleanup_(address_freep)
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);
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);
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);
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta/* Forwarding database table. */
b98b483bac585af754e8a22ea890db8486905d8aAlin Rautaint fdb_entry_configure(sd_rtnl *const rtnl, FdbEntry *const fdb_entry, const int ifindex);
b98b483bac585af754e8a22ea890db8486905d8aAlin Rautaint fdb_entry_new_static(Network *const network, const unsigned section, FdbEntry **ret);
b98b483bac585af754e8a22ea890db8486905d8aAlin RautaDEFINE_TRIVIAL_CLEANUP_FUNC(FdbEntry*, fdb_entry_free);
b98b483bac585af754e8a22ea890db8486905d8aAlin Rauta#define _cleanup_fdbentry_free_ _cleanup_(fdb_entry_freep)
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 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);
ed942a9eb22d50f667909ad6184b45015d28d054Tom Gundersen/* DHCP support */
ed942a9eb22d50f667909ad6184b45015d28d054Tom Gundersenconst char* dhcp_support_to_string(DHCPSupport i) _const_;
ed942a9eb22d50f667909ad6184b45015d28d054Tom GundersenDHCPSupport dhcp_support_from_string(const char *s) _pure_;
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);
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersen/* LLMNR support */
bd8f65387673e29f46136a4ed172097035002c23Tom Gundersenconst char* llmnr_support_to_string(LLMNRSupport i) _const_;
bd8f65387673e29f46136a4ed172097035002c23Tom GundersenLLMNRSupport llmnr_support_from_string(const char *s) _pure_;
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);
11bf3cced13c885ca215c108cb0bdb7a148520d6Lennart Poettering/* Address Pool */
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 Poetteringint address_pool_acquire(AddressPool *p, unsigned prefixlen, union in_addr_union *found);