2013-10-17 03:18:36 +02:00
|
|
|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
|
|
|
|
|
|
|
/***
|
|
|
|
This file is part of systemd.
|
|
|
|
|
|
|
|
Copyright 2013 Tom Gundersen <teg@jklm.no>
|
|
|
|
|
|
|
|
systemd is free software; you can redistribute it and/or modify it
|
|
|
|
under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
systemd is distributed in the hope that it will be useful, but
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
|
|
|
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
***/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
|
|
|
|
#include "sd-event.h"
|
|
|
|
#include "sd-rtnl.h"
|
2014-01-13 23:48:28 +01:00
|
|
|
#include "sd-bus.h"
|
2014-01-01 15:16:34 +01:00
|
|
|
#include "sd-dhcp-client.h"
|
2014-03-05 08:13:30 +01:00
|
|
|
#include "sd-dhcp-server.h"
|
2014-02-28 16:10:20 +01:00
|
|
|
#include "sd-ipv4ll.h"
|
2014-06-19 14:40:01 +02:00
|
|
|
#include "sd-icmp6-nd.h"
|
|
|
|
#include "sd-dhcp6-client.h"
|
2013-10-17 03:18:36 +02:00
|
|
|
#include "udev.h"
|
2014-11-23 05:26:14 +01:00
|
|
|
#include "sd-lldp.h"
|
2013-10-17 03:18:36 +02:00
|
|
|
|
|
|
|
#include "rtnl-util.h"
|
|
|
|
#include "hashmap.h"
|
|
|
|
#include "list.h"
|
2014-03-13 20:46:45 +01:00
|
|
|
#include "set.h"
|
2014-11-06 14:19:05 +01:00
|
|
|
#include "condition.h"
|
2014-07-10 21:15:26 +02:00
|
|
|
#include "in-addr-util.h"
|
2013-10-17 03:18:36 +02:00
|
|
|
|
2014-04-02 21:31:12 +02:00
|
|
|
#define CACHE_INFO_INFINITY_LIFE_TIME 0xFFFFFFFFU
|
2014-07-10 21:32:44 +02:00
|
|
|
#define DHCP_ROUTE_METRIC 1024
|
|
|
|
#define IPV4LL_ROUTE_METRIC 2048
|
2014-04-02 21:31:12 +02:00
|
|
|
|
2014-02-07 17:03:23 +01:00
|
|
|
typedef struct NetDev NetDev;
|
2013-10-17 03:18:36 +02:00
|
|
|
typedef struct Network Network;
|
|
|
|
typedef struct Link Link;
|
|
|
|
typedef struct Address Address;
|
|
|
|
typedef struct Route Route;
|
|
|
|
typedef struct Manager Manager;
|
2014-06-18 18:22:14 +02:00
|
|
|
typedef struct AddressPool AddressPool;
|
2014-12-17 16:35:36 +01:00
|
|
|
typedef struct FdbEntry FdbEntry;
|
2013-10-17 03:18:36 +02:00
|
|
|
|
2015-01-13 19:48:19 +01:00
|
|
|
typedef enum AddressFamilyBoolean {
|
2015-01-13 20:07:13 +01:00
|
|
|
/* This is a bitmask, though it usually doesn't feel that way! */
|
|
|
|
ADDRESS_FAMILY_NO = 0,
|
|
|
|
ADDRESS_FAMILY_IPV4 = 1,
|
|
|
|
ADDRESS_FAMILY_IPV6 = 2,
|
|
|
|
ADDRESS_FAMILY_YES = 3,
|
2015-01-13 19:48:19 +01:00
|
|
|
_ADDRESS_FAMILY_BOOLEAN_MAX,
|
|
|
|
_ADDRESS_FAMILY_BOOLEAN_INVALID = -1,
|
|
|
|
} AddressFamilyBoolean;
|
2014-06-28 16:00:49 +02:00
|
|
|
|
2014-08-03 18:45:07 +02:00
|
|
|
typedef enum LLMNRSupport {
|
|
|
|
LLMNR_SUPPORT_NO,
|
|
|
|
LLMNR_SUPPORT_YES,
|
|
|
|
LLMNR_SUPPORT_RESOLVE,
|
|
|
|
_LLMNR_SUPPORT_MAX,
|
|
|
|
_LLMNR_SUPPORT_INVALID = -1,
|
|
|
|
} LLMNRSupport;
|
|
|
|
|
2014-12-17 16:35:36 +01:00
|
|
|
struct FdbEntry {
|
|
|
|
Network *network;
|
|
|
|
unsigned section;
|
|
|
|
|
|
|
|
struct ether_addr *mac_addr;
|
|
|
|
uint16_t vlan_id;
|
|
|
|
|
|
|
|
LIST_FIELDS(FdbEntry, static_fdb_entries);
|
|
|
|
};
|
|
|
|
|
2013-10-17 03:18:36 +02:00
|
|
|
struct Network {
|
|
|
|
Manager *manager;
|
|
|
|
|
|
|
|
char *filename;
|
|
|
|
|
|
|
|
struct ether_addr *match_mac;
|
|
|
|
char *match_path;
|
|
|
|
char *match_driver;
|
|
|
|
char *match_type;
|
|
|
|
char *match_name;
|
2014-07-14 10:04:18 +02:00
|
|
|
char *dhcp_vendor_class_identifier;
|
|
|
|
|
2014-02-20 19:39:49 +01:00
|
|
|
Condition *match_host;
|
|
|
|
Condition *match_virt;
|
|
|
|
Condition *match_kernel;
|
2014-02-21 14:51:19 +01:00
|
|
|
Condition *match_arch;
|
2013-10-17 03:18:36 +02:00
|
|
|
|
|
|
|
char *description;
|
2014-02-07 17:03:23 +01:00
|
|
|
NetDev *bridge;
|
|
|
|
NetDev *bond;
|
2014-07-28 12:10:37 +02:00
|
|
|
Hashmap *stacked_netdevs;
|
2015-01-13 19:48:19 +01:00
|
|
|
AddressFamilyBoolean dhcp;
|
2014-01-13 21:28:53 +01:00
|
|
|
bool dhcp_dns;
|
2014-05-19 18:42:14 +02:00
|
|
|
bool dhcp_ntp;
|
2014-01-13 23:07:59 +01:00
|
|
|
bool dhcp_mtu;
|
2014-01-13 23:48:28 +01:00
|
|
|
bool dhcp_hostname;
|
2014-08-15 12:45:59 +02:00
|
|
|
bool dhcp_domains;
|
2014-07-01 20:58:49 +02:00
|
|
|
bool dhcp_sendhost;
|
2014-07-15 18:55:31 +02:00
|
|
|
bool dhcp_broadcast;
|
2014-01-27 20:52:07 +01:00
|
|
|
bool dhcp_critical;
|
2014-06-28 00:00:06 +02:00
|
|
|
bool dhcp_routes;
|
2014-09-08 12:26:47 +02:00
|
|
|
unsigned dhcp_route_metric;
|
2014-02-28 16:10:20 +01:00
|
|
|
bool ipv4ll;
|
2014-07-25 02:09:29 +02:00
|
|
|
bool ipv4ll_route;
|
2013-10-17 03:18:36 +02:00
|
|
|
|
2014-03-05 08:13:30 +01:00
|
|
|
bool dhcp_server;
|
|
|
|
|
2014-11-15 04:17:16 +01:00
|
|
|
unsigned cost;
|
|
|
|
|
2015-01-13 20:07:13 +01:00
|
|
|
AddressFamilyBoolean ip_forward;
|
2015-01-13 13:47:08 +01:00
|
|
|
bool ip_masquerade;
|
|
|
|
|
2014-12-04 21:57:13 +01:00
|
|
|
struct ether_addr *mac;
|
|
|
|
unsigned mtu;
|
|
|
|
|
2014-11-23 05:26:14 +01:00
|
|
|
bool lldp;
|
|
|
|
|
2014-01-01 15:16:10 +01:00
|
|
|
LIST_HEAD(Address, static_addresses);
|
|
|
|
LIST_HEAD(Route, static_routes);
|
2014-12-17 16:35:36 +01:00
|
|
|
LIST_HEAD(FdbEntry, static_fdb_entries);
|
2013-10-17 03:18:36 +02:00
|
|
|
|
2013-11-19 16:54:42 +01:00
|
|
|
Hashmap *addresses_by_section;
|
|
|
|
Hashmap *routes_by_section;
|
2014-12-17 16:35:36 +01:00
|
|
|
Hashmap *fdb_entries_by_section;
|
2013-11-19 16:54:42 +01:00
|
|
|
|
2014-08-15 14:49:31 +02:00
|
|
|
bool wildcard_domain;
|
2014-08-15 14:21:08 +02:00
|
|
|
char **domains, **dns, **ntp;
|
2014-03-13 20:46:45 +01:00
|
|
|
|
2014-08-03 18:45:07 +02:00
|
|
|
LLMNRSupport llmnr;
|
|
|
|
|
2013-10-17 03:18:36 +02:00
|
|
|
LIST_FIELDS(Network, networks);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Address {
|
|
|
|
Network *network;
|
2014-07-28 12:21:51 +02:00
|
|
|
unsigned section;
|
2013-10-17 03:18:36 +02:00
|
|
|
|
2014-07-18 16:09:30 +02:00
|
|
|
int family;
|
2013-10-17 03:18:36 +02:00
|
|
|
unsigned char prefixlen;
|
2014-02-28 16:10:20 +01:00
|
|
|
unsigned char scope;
|
2014-08-19 18:59:28 +02:00
|
|
|
unsigned char flags;
|
2013-10-17 03:18:36 +02:00
|
|
|
char *label;
|
|
|
|
|
2014-01-28 20:01:37 +01:00
|
|
|
struct in_addr broadcast;
|
2014-04-02 21:31:12 +02:00
|
|
|
struct ifa_cacheinfo cinfo;
|
2013-11-17 21:01:20 +01:00
|
|
|
|
2014-06-18 12:34:02 +02:00
|
|
|
union in_addr_union in_addr;
|
2014-07-07 11:28:56 +02:00
|
|
|
union in_addr_union in_addr_peer;
|
2013-10-17 03:18:36 +02:00
|
|
|
|
2015-01-13 19:56:13 +01:00
|
|
|
bool ip_masquerade_done;
|
2015-01-13 13:47:08 +01:00
|
|
|
|
2014-05-15 20:10:33 +02:00
|
|
|
LIST_FIELDS(Address, addresses);
|
2013-10-17 03:18:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Route {
|
|
|
|
Network *network;
|
2014-07-28 12:21:51 +02:00
|
|
|
unsigned section;
|
2013-10-17 03:18:36 +02:00
|
|
|
|
2014-07-18 16:09:30 +02:00
|
|
|
int family;
|
2013-11-19 16:54:42 +01:00
|
|
|
unsigned char dst_prefixlen;
|
2014-12-04 15:52:21 +01:00
|
|
|
unsigned char src_prefixlen;
|
2014-02-28 16:10:20 +01:00
|
|
|
unsigned char scope;
|
|
|
|
uint32_t metrics;
|
2014-07-22 23:54:47 +02:00
|
|
|
unsigned char protocol; /* RTPROT_* */
|
2013-10-17 03:18:36 +02:00
|
|
|
|
2014-06-18 12:34:02 +02:00
|
|
|
union in_addr_union in_addr;
|
|
|
|
union in_addr_union dst_addr;
|
2014-12-04 15:52:21 +01:00
|
|
|
union in_addr_union src_addr;
|
2014-09-05 11:56:02 +02:00
|
|
|
union in_addr_union prefsrc_addr;
|
2013-11-19 16:54:42 +01:00
|
|
|
|
2014-05-15 20:10:33 +02:00
|
|
|
LIST_FIELDS(Route, routes);
|
2013-10-17 03:18:36 +02:00
|
|
|
};
|
|
|
|
|
2014-06-18 18:22:14 +02:00
|
|
|
struct AddressPool {
|
|
|
|
Manager *manager;
|
|
|
|
|
2014-07-18 16:09:30 +02:00
|
|
|
int family;
|
2014-06-18 18:22:14 +02:00
|
|
|
unsigned prefixlen;
|
|
|
|
|
|
|
|
union in_addr_union in_addr;
|
|
|
|
|
|
|
|
LIST_FIELDS(AddressPool, address_pools);
|
|
|
|
};
|
|
|
|
|
2013-10-17 03:18:36 +02:00
|
|
|
struct Manager {
|
|
|
|
sd_rtnl *rtnl;
|
|
|
|
sd_event *event;
|
2015-02-03 15:44:12 +01:00
|
|
|
sd_event_source *bus_retry_event_source;
|
2014-01-13 23:48:28 +01:00
|
|
|
sd_bus *bus;
|
2015-02-03 15:44:12 +01:00
|
|
|
sd_bus_slot *prepare_for_sleep_slot;
|
2013-10-17 03:18:36 +02:00
|
|
|
struct udev *udev;
|
|
|
|
struct udev_monitor *udev_monitor;
|
|
|
|
sd_event_source *udev_event_source;
|
|
|
|
|
2014-05-08 17:21:37 +02:00
|
|
|
char *state_file;
|
|
|
|
|
2013-10-17 03:18:36 +02:00
|
|
|
Hashmap *links;
|
2014-01-21 21:58:08 +01:00
|
|
|
Hashmap *netdevs;
|
2013-10-17 03:18:36 +02:00
|
|
|
LIST_HEAD(Network, networks);
|
2014-06-18 18:22:14 +02:00
|
|
|
LIST_HEAD(AddressPool, address_pools);
|
2013-10-17 03:18:36 +02:00
|
|
|
|
|
|
|
usec_t network_dirs_ts_usec;
|
|
|
|
};
|
|
|
|
|
2014-01-08 23:41:41 +01:00
|
|
|
extern const char* const network_dirs[];
|
|
|
|
|
2013-10-17 03:18:36 +02:00
|
|
|
/* Manager */
|
|
|
|
|
|
|
|
int manager_new(Manager **ret);
|
|
|
|
void manager_free(Manager *m);
|
|
|
|
|
2013-11-24 23:37:56 +01:00
|
|
|
int manager_load_config(Manager *m);
|
|
|
|
bool manager_should_reload(Manager *m);
|
|
|
|
|
2014-04-15 14:21:44 +02:00
|
|
|
int manager_rtnl_enumerate_links(Manager *m);
|
2014-12-08 19:54:06 +01:00
|
|
|
int manager_rtnl_enumerate_addresses(Manager *m);
|
2013-10-17 03:18:36 +02:00
|
|
|
|
2014-05-08 17:21:37 +02:00
|
|
|
int manager_save(Manager *m);
|
2014-01-05 23:01:10 +01:00
|
|
|
|
2014-07-18 16:09:30 +02:00
|
|
|
int manager_address_pool_acquire(Manager *m, int family, unsigned prefixlen, union in_addr_union *found);
|
2014-06-18 18:22:14 +02:00
|
|
|
|
2013-10-17 03:18:36 +02:00
|
|
|
DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_free);
|
|
|
|
#define _cleanup_manager_free_ _cleanup_(manager_freep)
|
|
|
|
|
|
|
|
/* Network */
|
|
|
|
|
|
|
|
int network_load(Manager *manager);
|
|
|
|
|
|
|
|
void network_free(Network *network);
|
|
|
|
|
|
|
|
DEFINE_TRIVIAL_CLEANUP_FUNC(Network*, network_free);
|
|
|
|
#define _cleanup_network_free_ _cleanup_(network_freep)
|
|
|
|
|
2014-04-15 14:21:44 +02:00
|
|
|
int network_get(Manager *manager, struct udev_device *device,
|
|
|
|
const char *ifname, const struct ether_addr *mac,
|
|
|
|
Network **ret);
|
2013-10-17 03:18:36 +02:00
|
|
|
int network_apply(Manager *manager, Network *network, Link *link);
|
|
|
|
|
2014-05-08 19:22:53 +02:00
|
|
|
int config_parse_netdev(const char *unit, const char *filename, unsigned line,
|
2013-11-24 23:37:56 +01:00
|
|
|
const char *section, unsigned section_line, const char *lvalue,
|
|
|
|
int ltype, const char *rvalue, void *data, void *userdata);
|
|
|
|
|
2014-08-15 14:21:08 +02:00
|
|
|
int config_parse_domains(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);
|
|
|
|
|
2014-05-12 07:18:24 +02:00
|
|
|
int config_parse_tunnel(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);
|
|
|
|
|
|
|
|
int config_parse_tunnel_address(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);
|
|
|
|
|
2014-11-15 03:54:59 +01:00
|
|
|
int config_parse_vxlan_group_address(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);
|
|
|
|
|
2013-11-24 23:37:56 +01:00
|
|
|
/* gperf */
|
2014-02-20 19:56:50 +01:00
|
|
|
const struct ConfigPerfItem* network_network_gperf_lookup(const char *key, unsigned length);
|
2013-10-17 03:18:36 +02:00
|
|
|
|
|
|
|
/* Route */
|
2014-01-01 15:16:10 +01:00
|
|
|
int route_new_static(Network *network, unsigned section, Route **ret);
|
2014-07-22 23:54:47 +02:00
|
|
|
int route_new_dynamic(Route **ret, unsigned char rtm_protocol);
|
2013-10-17 03:18:36 +02:00
|
|
|
void route_free(Route *route);
|
2013-11-14 16:22:51 +01:00
|
|
|
int route_configure(Route *route, Link *link, sd_rtnl_message_handler_t callback);
|
2014-02-28 16:10:20 +01:00
|
|
|
int route_drop(Route *route, Link *link, sd_rtnl_message_handler_t callback);
|
|
|
|
|
2013-10-17 03:18:36 +02:00
|
|
|
|
|
|
|
DEFINE_TRIVIAL_CLEANUP_FUNC(Route*, route_free);
|
|
|
|
#define _cleanup_route_free_ _cleanup_(route_freep)
|
|
|
|
|
|
|
|
int config_parse_gateway(const char *unit, const char *filename, unsigned line,
|
2013-11-19 16:17:55 +01:00
|
|
|
const char *section, unsigned section_line, const char *lvalue,
|
|
|
|
int ltype, const char *rvalue, void *data, void *userdata);
|
2013-10-17 03:18:36 +02:00
|
|
|
|
2013-11-19 16:54:42 +01:00
|
|
|
int config_parse_destination(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);
|
|
|
|
|
2014-07-10 19:39:58 +02:00
|
|
|
int config_parse_route_priority(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);
|
2013-10-17 03:18:36 +02:00
|
|
|
/* Address */
|
2014-01-01 15:16:10 +01:00
|
|
|
int address_new_static(Network *network, unsigned section, Address **ret);
|
|
|
|
int address_new_dynamic(Address **ret);
|
2013-10-17 03:18:36 +02:00
|
|
|
void address_free(Address *address);
|
2013-11-14 16:22:51 +01:00
|
|
|
int address_configure(Address *address, Link *link, sd_rtnl_message_handler_t callback);
|
2014-04-02 21:31:12 +02:00
|
|
|
int address_update(Address *address, Link *link, sd_rtnl_message_handler_t callback);
|
2013-12-31 17:31:50 +01:00
|
|
|
int address_drop(Address *address, Link *link, sd_rtnl_message_handler_t callback);
|
2015-01-13 13:47:08 +01:00
|
|
|
int address_establish(Address *address, Link *link);
|
|
|
|
int address_release(Address *address, Link *link);
|
2014-05-16 00:27:56 +02:00
|
|
|
bool address_equal(Address *a1, Address *a2);
|
2013-10-17 03:18:36 +02:00
|
|
|
|
|
|
|
DEFINE_TRIVIAL_CLEANUP_FUNC(Address*, address_free);
|
|
|
|
#define _cleanup_address_free_ _cleanup_(address_freep)
|
|
|
|
|
|
|
|
int config_parse_address(const char *unit, const char *filename, unsigned line,
|
2013-11-19 16:17:55 +01:00
|
|
|
const char *section, unsigned section_line, const char *lvalue,
|
|
|
|
int ltype, const char *rvalue, void *data, void *userdata);
|
2013-10-17 03:18:36 +02:00
|
|
|
|
2014-01-28 20:01:37 +01:00
|
|
|
int config_parse_broadcast(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);
|
|
|
|
|
2013-11-19 16:54:42 +01:00
|
|
|
int config_parse_label(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);
|
|
|
|
|
2014-12-17 16:35:36 +01:00
|
|
|
/* Forwarding database table. */
|
|
|
|
int fdb_entry_configure(sd_rtnl *const rtnl, FdbEntry *const fdb_entry, const int ifindex);
|
|
|
|
void fdb_entry_free(FdbEntry *fdb_entry);
|
|
|
|
int fdb_entry_new_static(Network *const network, const unsigned section, FdbEntry **ret);
|
|
|
|
|
|
|
|
DEFINE_TRIVIAL_CLEANUP_FUNC(FdbEntry*, fdb_entry_free);
|
|
|
|
#define _cleanup_fdbentry_free_ _cleanup_(fdb_entry_freep)
|
|
|
|
|
|
|
|
int config_parse_fdb_hwaddr(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);
|
|
|
|
|
|
|
|
int config_parse_fdb_vlan_id(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);
|
|
|
|
|
2014-06-28 16:00:49 +02:00
|
|
|
/* DHCP support */
|
|
|
|
|
|
|
|
int config_parse_dhcp(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);
|
|
|
|
|
2014-08-03 18:45:07 +02:00
|
|
|
/* LLMNR support */
|
|
|
|
|
|
|
|
const char* llmnr_support_to_string(LLMNRSupport i) _const_;
|
|
|
|
LLMNRSupport llmnr_support_from_string(const char *s) _pure_;
|
|
|
|
|
|
|
|
int config_parse_llmnr(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);
|
|
|
|
|
2014-06-18 18:22:14 +02:00
|
|
|
/* Address Pool */
|
|
|
|
|
2014-07-18 16:09:30 +02:00
|
|
|
int address_pool_new(Manager *m, AddressPool **ret, int family, const union in_addr_union *u, unsigned prefixlen);
|
|
|
|
int address_pool_new_from_string(Manager *m, AddressPool **ret, int family, const char *p, unsigned prefixlen);
|
2014-06-18 18:22:14 +02:00
|
|
|
void address_pool_free(AddressPool *p);
|
|
|
|
|
|
|
|
int address_pool_acquire(AddressPool *p, unsigned prefixlen, union in_addr_union *found);
|
2015-01-13 19:48:19 +01:00
|
|
|
|
|
|
|
const char *address_family_boolean_to_string(AddressFamilyBoolean b) _const_;
|
|
|
|
AddressFamilyBoolean address_family_boolean_from_string(const char *s) _const_;
|
2015-01-13 20:07:13 +01:00
|
|
|
|
|
|
|
int 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);
|