eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit 20466cd735d44c978fe544cddf2d91053b0290f3
parent bd4446070f233ae963a8423ed842ef29c59483e2
Author: Tim Kourt <tim.a.kourt@linux.intel.com>
Date:   Tue,  2 Jul 2019 16:14:50 -0700

resolve: Introduce resolve module

The module is responsible for the configuration of the address
resolution services. It will consist of the multiple service
specific plugins such as: systemd-resolved plugin, dnsmasq
plugin, etc.

Diffstat:
MMakefile.am | 1+
Msrc/netconfig.c | 9+++++++--
Asrc/resolve.c | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/resolve.h | 24++++++++++++++++++++++++
4 files changed, 90 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am @@ -207,6 +207,7 @@ src_iwd_SOURCES = src/main.c linux/nl80211.h src/iwd.h src/missing.h \ src/auth-proto.h \ src/anqp.h src/anqp.c \ src/netconfig.h src/netconfig.c\ + src/resolve.h src/resolve.c\ src/hotspot.h src/hotspot.c \ $(eap_sources) \ $(builtin_sources) diff --git a/src/netconfig.c b/src/netconfig.c @@ -38,6 +38,7 @@ #include "src/common.h" #include "src/network.h" #include "src/rtnlutil.h" +#include "src/resolve.h" #include "src/netconfig.h" struct netconfig { @@ -277,7 +278,9 @@ static bool netconfig_install_addresses(struct netconfig *netconfig, } gateway: - /* TODO: Add the routes and domain name servers. */ + /* TODO: Add the routes. */ + + resolve_add_dns(netconfig->ifindex, ifaddr->family, dns); return true; } @@ -299,7 +302,9 @@ static bool netconfig_uninstall_addresses(struct netconfig *netconfig, } gateway: - /* TODO: Remove the routes and domain name servers. */ + /* TODO: Remove the routes. */ + + resolve_remove(netconfig->ifindex); return true; } diff --git a/src/resolve.c b/src/resolve.c @@ -0,0 +1,58 @@ +/* + * + * Wireless daemon for Linux + * + * Copyright (C) 2019 Intel Corporation. All rights reserved. + * + * This library 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. + * + * This library 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 this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <errno.h> + +#include <ell/ell.h> + +#include "src/iwd.h" +#include "src/resolve.h" + +void resolve_add_dns(uint32_t ifindex, uint8_t type, char **dns_list) +{ +} + +void resolve_remove(uint32_t ifindex) +{ +} + +static int resolve_init(void) +{ + bool enabled; + + if (!l_settings_get_bool(iwd_get_config(), "General", + "enable_network_config", &enabled) || + !enabled) + return 0; + + return 0; +} + +static void resolve_exit(void) +{ +} + +IWD_MODULE(resolve, resolve_init, resolve_exit) diff --git a/src/resolve.h b/src/resolve.h @@ -0,0 +1,24 @@ +/* + * + * Wireless daemon for Linux + * + * Copyright (C) 2019 Intel Corporation. All rights reserved. + * + * This library 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. + * + * This library 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 this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +void resolve_add_dns(uint32_t ifindex, uint8_t type, char **dns_list); +void resolve_remove(uint32_t ifindex);