networkd.h revision a245ced0d7b0af9ae5438d978e24183672a0a4d9
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering This file is part of systemd.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering Copyright 2013 Tom Gundersen <teg@jklm.no>
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering systemd is free software; you can redistribute it and/or modify it
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering under the terms of the GNU Lesser General Public License as published by
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering (at your option) any later version.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering systemd is distributed in the hope that it will be useful, but
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering Lesser General Public License for more details.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering You should have received a copy of the GNU Lesser General Public License
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering#define CACHE_INFO_INFINITY_LIFE_TIME 0xFFFFFFFFU
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering /* This is a bitmask, though it usually doesn't feel that way! */
cd61c3bfd718fb398cc53ced906266a9297782c9Lennart Poettering unsigned char scope;
cd61c3bfd718fb398cc53ced906266a9297782c9Lennart Poettering unsigned char flags;
10f9c75519671e7c7ab8993b54fe22da7c2d0c38Lennart Poettering unsigned char scope;
cd61c3bfd718fb398cc53ced906266a9297782c9Lennart Poetteringextern const char* const network_dirs[];
cd61c3bfd718fb398cc53ced906266a9297782c9Lennart Poetteringextern const sd_bus_vtable manager_vtable[];
cd61c3bfd718fb398cc53ced906266a9297782c9Lennart Poetteringint manager_rtnl_enumerate_links(Manager *m);
89f7c8465cd1ab37347dd0c15920bce31e8225dfLennart Poetteringint manager_rtnl_enumerate_addresses(Manager *m);
a1da85830bfaa77b9eb9c54693e5573559c97e50Tom Gundersenint manager_send_changed(Manager *m, const char *property, ...) _sentinel_;
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poetteringint manager_address_pool_acquire(Manager *m, int family, unsigned prefixlen, union in_addr_union *found);
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart PoetteringDEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_free);
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poettering#define _cleanup_manager_free_ _cleanup_(manager_freep)
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart PoetteringDEFINE_TRIVIAL_CLEANUP_FUNC(Network*, network_free);
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poettering#define _cleanup_network_free_ _cleanup_(network_freep)
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poetteringint network_get_by_name(Manager *manager, const char *name, Network **ret);
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poetteringint network_get(Manager *manager, struct udev_device *device,
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poettering const char *ifname, const struct ether_addr *mac,
a7893c6b28772edbc7e1fea3c209caa54d465648Lennart Poetteringint network_apply(Manager *manager, Network *network, Link *link);
a1da85830bfaa77b9eb9c54693e5573559c97e50Tom Gundersenint config_parse_netdev(const char *unit, const char *filename, unsigned line,
a7893c6b28772edbc7e1fea3c209caa54d465648Lennart Poettering const char *section, unsigned section_line, const char *lvalue,
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poettering int ltype, const char *rvalue, void *data, void *userdata);
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poetteringint config_parse_domains(const char *unit,
aa1936ea1a89c2bb968ba33e3274898a4eeae771Lennart Poetteringint config_parse_tunnel_address(const char *unit,
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poetteringint config_parse_vxlan_group_address(const char *unit,
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poetteringextern const sd_bus_vtable network_vtable[];
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poetteringint network_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error);
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poetteringint network_object_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error);
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poetteringconst struct ConfigPerfItem* network_network_gperf_lookup(const char *key, unsigned length);
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poetteringint route_new_static(Network *network, unsigned section, Route **ret);
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poetteringint route_new_dynamic(Route **ret, unsigned char rtm_protocol);
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poetteringint route_configure(Route *route, Link *link, sd_rtnl_message_handler_t callback);
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poetteringint route_drop(Route *route, Link *link, sd_rtnl_message_handler_t callback);
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart PoetteringDEFINE_TRIVIAL_CLEANUP_FUNC(Route*, route_free);
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poettering#define _cleanup_route_free_ _cleanup_(route_freep)
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poetteringint config_parse_gateway(const char *unit, const char *filename, unsigned line,
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poettering const char *section, unsigned section_line, const char *lvalue,
f48e75cb9a8112d35855c44a156934f2ee0edb2eLennart Poettering int ltype, const char *rvalue, void *data, void *userdata);
f48e75cb9a8112d35855c44a156934f2ee0edb2eLennart Poetteringint config_parse_destination(const char *unit, const char *filename, unsigned line,
f48e75cb9a8112d35855c44a156934f2ee0edb2eLennart Poettering const char *section, unsigned section_line, const char *lvalue,
f48e75cb9a8112d35855c44a156934f2ee0edb2eLennart Poettering int ltype, const char *rvalue, void *data, void *userdata);
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poetteringint config_parse_route_priority(const char *unit, const char *filename, unsigned line,
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poettering const char *section, unsigned section_line, const char *lvalue,
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poettering int ltype, const char *rvalue, void *data, void *userdata);
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poetteringint config_parse_route_scope(const char *unit, const char *filename, unsigned line,
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poettering const char *section, unsigned section_line, const char *lvalue,
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poettering int ltype, const char *rvalue, void *data, void *userdata);
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poetteringint address_new_static(Network *network, unsigned section, Address **ret);
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poetteringint address_configure(Address *address, Link *link, sd_rtnl_message_handler_t callback);
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poetteringint address_update(Address *address, Link *link, sd_rtnl_message_handler_t callback);
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poetteringint address_drop(Address *address, Link *link, sd_rtnl_message_handler_t callback);
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poetteringint address_establish(Address *address, Link *link);
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poetteringint address_release(Address *address, Link *link);
878cd7e95ca303f9851d227a22d2022bd49944b0Lennart Poetteringbool address_equal(Address *a1, Address *a2);
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart PoetteringDEFINE_TRIVIAL_CLEANUP_FUNC(Address*, address_free);
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering#define _cleanup_address_free_ _cleanup_(address_freep)
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poetteringint config_parse_address(const char *unit, const char *filename, unsigned line,
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering const char *section, unsigned section_line, const char *lvalue,
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering int ltype, const char *rvalue, void *data, void *userdata);
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poetteringint config_parse_broadcast(const char *unit, const char *filename, unsigned line,
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering const char *section, unsigned section_line, const char *lvalue,
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering int ltype, const char *rvalue, void *data, void *userdata);
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poetteringint config_parse_label(const char *unit, const char *filename, unsigned line,
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering const char *section, unsigned section_line, const char *lvalue,
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering int ltype, const char *rvalue, void *data, void *userdata);
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering/* Forwarding database table. */
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poetteringint fdb_entry_configure(Link *const link, FdbEntry *const fdb_entry);
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poetteringint fdb_entry_new_static(Network *const network, const unsigned section, FdbEntry **ret);
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart PoetteringDEFINE_TRIVIAL_CLEANUP_FUNC(FdbEntry*, fdb_entry_free);
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering#define _cleanup_fdbentry_free_ _cleanup_(fdb_entry_freep)
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poetteringint config_parse_fdb_hwaddr(const char *unit, const char *filename, unsigned line,
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering const char *section, unsigned section_line, const char *lvalue,
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering int ltype, const char *rvalue, void *data, void *userdata);
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poetteringint config_parse_fdb_vlan_id(const char *unit, const char *filename, unsigned line,
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering const char *section, unsigned section_line, const char *lvalue,
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering int ltype, const char *rvalue, void *data, void *userdata);
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering/* DHCP support */
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poetteringint config_parse_dhcp(const char *unit, const char *filename, unsigned line,
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering const char *section, unsigned section_line, const char *lvalue,
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering int ltype, const char *rvalue, void *data, void *userdata);
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering/* IPv4LL support (legacy) */
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poetteringint config_parse_ipv4ll(const char *unit, const char *filename, unsigned line,
717603e391b52983ca1fd218e7333a1b9dfc5c05Lennart Poettering const char *section, unsigned section_line, const char *lvalue,
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering int ltype, const char *rvalue, void *data, void *userdata);
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering/* IPv6 support */
9f6eb1cd58f2ddf2eb6ba0e4de056e13d938af75Kay Sieversint config_parse_token(const char *unit, const char *filename, unsigned line,
9f6eb1cd58f2ddf2eb6ba0e4de056e13d938af75Kay Sievers const char *section, unsigned section_line, const char *lvalue,
89f7c8465cd1ab37347dd0c15920bce31e8225dfLennart Poettering int ltype, const char *rvalue, void *data, void *userdata);
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering/* LLMNR support */
f48e75cb9a8112d35855c44a156934f2ee0edb2eLennart Poetteringconst char* llmnr_support_to_string(LLMNRSupport i) _const_;
f48e75cb9a8112d35855c44a156934f2ee0edb2eLennart PoetteringLLMNRSupport llmnr_support_from_string(const char *s) _pure_;
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poetteringint config_parse_llmnr(const char *unit, const char *filename, unsigned line,
a1da85830bfaa77b9eb9c54693e5573559c97e50Tom Gundersen const char *section, unsigned section_line, const char *lvalue,
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering int ltype, const char *rvalue, void *data, void *userdata);
f48e75cb9a8112d35855c44a156934f2ee0edb2eLennart Poettering/* Address Pool */
56159e0d918e9a9be07988133bb2847779325de0Lennart Poetteringint address_pool_new(Manager *m, AddressPool **ret, int family, const union in_addr_union *u, unsigned prefixlen);
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poetteringint address_pool_new_from_string(Manager *m, AddressPool **ret, int family, const char *p, unsigned prefixlen);
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poetteringint address_pool_acquire(AddressPool *p, unsigned prefixlen, union in_addr_union *found);
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poetteringconst char *address_family_boolean_to_string(AddressFamilyBoolean b) _const_;
1ee306e1248866617c96ed9f4263f375588ad838Lennart PoetteringAddressFamilyBoolean address_family_boolean_from_string(const char *s) _const_;
1ee306e1248866617c96ed9f4263f375588ad838Lennart 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);
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering/* Opeartional State */
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poetteringconst char* link_operstate_to_string(LinkOperationalState s) _const_;