Commit c447d841 authored by Lorn Potter's avatar Lorn Potter

Squashed 'connman/' changes from 075e1bb..97c3189

97c3189 Release 1.22
86373b4 dnsproxy: Check split routing when creating a server
27dba28 gdbus: Add g_dbus_client_set_ready_watch()
8bc2a4e dnsproxy: Destroy list using g_list_free_full
a33522d AUTHORS: Mention Maneesh's contributions
5ecc2a1 doc: Add API documentation about WiFi P2P Peer
48d43a8 test: Add method related to P2P services
73f8579 gsupplicant: Fix WPS sync-up error with wpa_supplicant
e5c6a34 session: Set state to disconnected when deactivating a session
ee485f6 service: Use connect reason from the failed service
90334bf session: Don't sent disconnects to sessions when updating
9d727fd session: Disconnect on configuration or session change
dd3492f session: Allow Session Connect and Disconnect be called multiple times
3b6f9c2 client: Allow Session Connect and Disconnect be called multiple times
e377722 session: Remove session, not service, from session list
2dba966 session: Do not remove non existing policy routing tables
aae5825 session: Do no create two instances of struct connman_service_info
76cb209 session: Update active sessions only on Session Connect and Disconnect
ddf176a nfacct: Remove support for NFACCT
fa4176b session: Remove unused NFACCT rules
32e260c session_policy_local: Do not use NULL as key to do a hash table lookup
404c4a4 stats: Use bool type instead integer
47b56b8 session: Update session state only after activation has been tried
3cf2e18 session: Expand '*' to all bearer types
027cbb0 AUTHORS: Mention Andrew's contributions
844286e doc: Update connection managment algorithm
4990bf7 test: Add a script to test P2P through wpa_supplicant DBus if
a1d11b7 test: Remove useless supplicant's old DBus interface test script
095a8f7 gdhcp: Refactor renew/rebind method
cd2c5c5 gdbus: Replace g_timeout_add with g_idle_add
c42a5f9 gdbus: Fix incorrect DBusConnection reference counting
72cc087 gdbus: Fix memory leak
12aad90 ntp: Exponential backoff when timeouting a sent message
eef5afa ntp: Support Kiss-of-Death packet
aed46d8 service: Check session policy before autoconnect is run.
0f76471 session: Add session policy autoconnect support
0e8b339 session: Make session policy global
1f7f926 session: Assign a service to sessions
d4cadd8 service: Disconnect on when last session is deactivated
5280685 service: Add connect reason to debug out in auto connnect
1a24280 service: Add connect reason to __connman_serice_auto_connect()
afd8f2d service: Add connect reason to __connman_service_connect()
88b837e session: Mark session active or inactive
470013d session: Remove service selection implementation
ec09003 Add Gadget session and weighting support.
1a831b6 AUTHORS: Mention Glenn's and Jonathan's contributions
996cbf1 src: Let systemd unmount remote filesystems before stopping connman
a587af9 src: Add D-Bus autostart configuration file
6ad4048 plugins: Add networking support to gadget plugin.
c09371c src: Introduce define for CONNMAN_NETWORK_TYPE_GADGET.
9abdf5f plugins: Refactor Gadget into separate plugin and file.
1e4e965 AUTHORS: Mention Hannu's contributions
30e16a1 ntp: Only accept NTP packets from the defined time server
a29da8c wispr: Handle wispr redirect properly
23fdeed inet: Eliminate misleading error logging
cb88f96 AUTHORS: Mention Philippe's contributions
089e52f README: Update recommended wpa_supplicant version and web page info
3bb94d4 gdhcp: Factor out DHCP Request sending
bd37ce0 Add REBOOTING state support for dhcp client
289c7fc gsupplicant: Rely on wpa_supplicant retry mechanism
9e59cc8 AUTHORS: Mention Alban's contributions
82ad017 config: add ifb in NetworkInterfaceBlacklist default
63aeaf6 src: Add Eduroam network .config file
0d7ad08 doc: Fix formatting
2ca6fb4 dnsproxy: Enable added DNS servers only for the default service
4f04f75 service: Add helper function for detecting a default service index
7b415b9 test: Add script for setting timezone
fefd145 client: Add initial completion for config and session commands
bd03493 client: Add support for monitor command completion
12c6a7a client: Add completion for tether command
f27040c client: Add on/off completion support for agent modes
95d42a7 client: Complete only one service or technology where appropriate
bee4ba8 client: Add helper function for ending readline completion
27088b9 client: Remove extra string duplication when completing commands
0f1dee2 client: Export command line word count function

git-subtree-dir: connman
git-subtree-split: 97c31890592867cc047154bc385d97620c3bb2f0
parent cbb12cfd
[submodule "upstream"]
path = upstream
url = git://git.kernel.org/pub/scm/network/connman/connman.git
......@@ -64,3 +64,10 @@ Mateusz Potrola <mateuszx.potrola@intel.com>
Jaehyun Kim <jeik01.kim@samsung.com>
Zhang Zhengguang <zhengguang.zhang@intel.com>
Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Alban Crequy <alban.crequy@collabora.co.uk>
Philippe Coval <philippe.coval@open.eurogiciel.org>
Hannu Mallat <hannu.mallat@jollamobile.com>
Glenn Schmottlach <Glenn.Schmottlach@xs-embedded.com>
Jonathan Liu <net147@gmail.com>
Andrew LeCain <electricalpanel@gmail.com>
Maneesh Jain <maneesh.jain@samsung.com>
ver 1.22:
Fix issue with WPS state synchronization.
Fix issue with DNS servers and default service.
Fix issue with DHCP client and rebooting state.
Add support for NTP exponential backoff handling.
Add support for NTP kiss-of-death packet handling.
Add support for Ethernet gadget networking.
ver 1.21:
Fix issue with WiFi networks and zero SSID length.
Fix issue with security details for hidden WiFi networks.
......
......@@ -43,9 +43,7 @@ gweb_sources += gweb/giognutls.h gweb/gionotls.c
endif
shared_sources = src/shared/util.h src/shared/util.c \
src/shared/netlink.h src/shared/netlink.c \
src/shared/nfacct.h src/shared/nfacct.c \
src/shared/nfnetlink_acct_copy.h
src/shared/netlink.h src/shared/netlink.c
if DATAFILES
......@@ -107,7 +105,7 @@ src_connmand_SOURCES = $(gdhcp_sources) $(gweb_sources) \
src/session.c src/tethering.c src/wpad.c src/wispr.c \
src/stats.c src/iptables.c src/dnsproxy.c src/6to4.c \
src/ippool.c src/bridge.c src/nat.c src/ipaddress.c \
src/inotify.c src/firewall.c src/nfacct.c src/ipv6pd.c
src/inotify.c src/firewall.c src/ipv6pd.c
src_connmand_LDADD = gdbus/libgdbus-internal.la $(builtin_libadd) \
@GLIB_LIBS@ @DBUS_LIBS@ @XTABLES_LIBS@ @GNUTLS_LIBS@ \
......@@ -347,7 +345,7 @@ test_scripts = test/get-state test/list-services \
test/test-counter test/set-ipv4-method test/set-ipv6-method \
test/get-services test/get-proxy-autoconfig test/set-proxy \
test/enable-tethering test/disable-tethering test/backtrace \
test/test-session test/test-supplicant \
test/test-session test/p2p-on-supplicant \
test/test-new-supplicant test/service-move-before \
test/set-global-timeservers test/get-global-timeservers \
test/set-nameservers test/set-domains test/set-timeservers \
......@@ -375,7 +373,8 @@ EXTRA_DIST += doc/overview-api.txt doc/behavior-api.txt \
doc/vpn-manager-api.txt doc/vpn-overview.txt \
doc/session-policy-format.txt
EXTRA_DIST += src/main.conf
EXTRA_DIST += src/main.conf \
src/eduroam.config
MANUAL_PAGES += doc/connman.8 doc/connman.conf.5
......
......@@ -16,6 +16,11 @@ builtin_modules += ethernet
builtin_sources += plugins/ethernet.c
endif
if GADGET
builtin_modules += gadget
builtin_sources += plugins/gadget.c
endif
gsupplicant_sources = gsupplicant/gsupplicant.h gsupplicant/dbus.h \
gsupplicant/supplicant.c gsupplicant/dbus.c
......
......@@ -71,6 +71,14 @@ For a working system, certain configuration options need to be enabled:
enabled. This option can be used to build a small daemon
for a specific system if Ethernet support is not required.
--disable-gadget
Disable support for USB Ethernet Gadget devices
By default USB Ethernet Gadget technology support is built-in and
enabled. This option can be used to build a small daemon
for a specific system if USB Ethernet Gadget support is not required.
--disable-wifi
Disable support for WiFi devices
......@@ -286,6 +294,7 @@ options need to be enabled:
CONFIG_USB_GADGET
CONFIG_USB_ETH
wpa_supplicant configuration
============================
......@@ -310,7 +319,7 @@ CONFIG_AUTOSCAN_EXPONENTIAL=y
This will enable the exact same function as bgscan but while being
disconnected.
It is recommended to use wpa_supplicant 1.x or later.
It is recommended to use wpa_supplicant 2.x or later.
If wpa_supplicant is configured to D-Bus autostart, then ConnMan will
trigger the autostart of wpa_supplicant. However please keep in mind
......@@ -351,6 +360,7 @@ Mailing list:
connman@connman.net
For additional information about the project visit ConnMan web site:
https://01.org/connman
http://www.connman.net
You can report bugs at https://01.org/jira/browse/CM
......@@ -1733,11 +1733,6 @@ static int cmd_session(char *args[], int num, struct connman_option *options)
if (!session_path)
return session_create(TRUE);
if (session_connected == true) {
fprintf(stdout, "Session already connected\n");
return 0;
}
return session_connect();
} else if (!strcmp(command, "disconnect")) {
......@@ -1747,12 +1742,6 @@ static int cmd_session(char *args[], int num, struct connman_option *options)
return 0;
}
if (session_connected == false) {
fprintf(stdout, "Session already "
"disconnected\n");
return 0;
}
return session_disconnect();
} else if (!strcmp(command, "config")) {
if (!session_path) {
......@@ -1796,6 +1785,16 @@ static char *lookup_service(const char *text, int state)
return NULL;
}
static char *lookup_service_arg(const char *text, int state)
{
if (__connmanctl_input_calc_level() > 1) {
__connmanctl_input_lookup_end();
return NULL;
}
return lookup_service(text, state);
}
static char *lookup_technology(const char *text, int state)
{
static int len = 0;
......@@ -1816,12 +1815,27 @@ static char *lookup_technology(const char *text, int state)
return NULL;
}
static char *lookup_technology_arg(const char *text, int state)
{
if (__connmanctl_input_calc_level() > 1) {
__connmanctl_input_lookup_end();
return NULL;
}
return lookup_technology(text, state);
}
static char *lookup_technology_offline(const char *text, int state)
{
static int len = 0;
static bool end = false;
char *str;
if (__connmanctl_input_calc_level() > 1) {
__connmanctl_input_lookup_end();
return NULL;
}
if (state == 0) {
len = strlen(text);
end = false;
......@@ -1842,6 +1856,56 @@ static char *lookup_technology_offline(const char *text, int state)
return NULL;
}
static char *lookup_on_off(const char *text, int state)
{
char *onoff[] = { "on", "off", NULL };
static int idx = 0;
static int len = 0;
char *str;
if (!state) {
idx = 0;
len = strlen(text);
}
while (onoff[idx]) {
str = onoff[idx];
idx++;
if (!strncmp(text, str, len))
return strdup(str);
}
return NULL;
}
static char *lookup_tether(const char *text, int state)
{
int level;
level = __connmanctl_input_calc_level();
if (level < 2)
return lookup_technology(text, state);
if (level == 2)
return lookup_on_off(text, state);
__connmanctl_input_lookup_end();
return NULL;
}
static char *lookup_agent(const char *text, int state)
{
if (__connmanctl_input_calc_level() > 1) {
__connmanctl_input_lookup_end();
return NULL;
}
return lookup_on_off(text, state);
}
static struct connman_option service_options[] = {
{"properties", 'p', "[<service>] (obsolete)"},
{ NULL, }
......@@ -1878,6 +1942,58 @@ static struct connman_option session_options[] = {
{ NULL, }
};
static char *lookup_options(struct connman_option *options, const char *text,
int state)
{
static int idx = 0;
static int len = 0;
const char *str;
if (state == 0) {
idx = 0;
len = strlen(text);
}
while (options[idx].name) {
str = options[idx].name;
idx++;
if (str && strncmp(text, str, len) == 0)
return strdup(str);
}
return NULL;
}
static char *lookup_monitor(const char *text, int state)
{
int level;
level = __connmanctl_input_calc_level();
if (level < 2)
return lookup_options(monitor_options, text, state);
if (level == 2)
return lookup_on_off(text, state);
__connmanctl_input_lookup_end();
return NULL;
}
static char *lookup_config(const char *text, int state)
{
if (__connmanctl_input_calc_level() < 2)
return lookup_service(text, state);
return lookup_options(config_options, text, state);
}
static char *lookup_session(const char *text, int state)
{
return lookup_options(session_options, text, state);
}
static const struct {
const char *cmd;
const char *argument;
......@@ -1900,27 +2016,28 @@ static const struct {
" wifi [on|off] <ssid> <passphrase> ",
NULL, cmd_tether,
"Enable, disable tethering, set SSID and passphrase for wifi",
lookup_technology },
lookup_tether },
{ "services", "[<service>]", service_options, cmd_services,
"Display services", lookup_service },
"Display services", lookup_service_arg },
{ "scan", "<technology>", NULL, cmd_scan,
"Scans for new services for given technology", lookup_technology },
"Scans for new services for given technology",
lookup_technology_arg },
{ "connect", "<service>", NULL, cmd_connect,
"Connect a given service", lookup_service },
"Connect a given service", lookup_service_arg },
{ "disconnect", "<service>", NULL, cmd_disconnect,
"Disconnect a given service", lookup_service },
"Disconnect a given service", lookup_service_arg },
{ "config", "<service>", config_options, cmd_config,
"Set service configuration options", lookup_service },
"Set service configuration options", lookup_config },
{ "monitor", "[off]", monitor_options, cmd_monitor,
"Monitor signals from interfaces", NULL },
"Monitor signals from interfaces", lookup_monitor },
{ "agent", "on|off", NULL, cmd_agent,
"Agent mode", NULL },
"Agent mode", lookup_agent },
{"vpnconnections", "[<connection>]", NULL, cmd_vpnconnections,
"Display VPN connections", NULL },
{ "vpnagent", "on|off", NULL, cmd_vpnagent,
"VPN Agent mode", NULL },
"VPN Agent mode", lookup_agent },
{ "session", "on|off|connect|disconnect|config", session_options,
cmd_session, "Enable or disable a session", NULL },
cmd_session, "Enable or disable a session", lookup_session },
{ "help", NULL, NULL, cmd_help,
"Show help", NULL },
{ "exit", NULL, NULL, cmd_exit,
......@@ -1970,10 +2087,20 @@ static int cmd_help(char *args[], int num, struct connman_option *options)
__connmanctl_lookup_cb __connmanctl_get_lookup_func(const char *text)
{
int i;
int i, cmdlen, textlen;
if (!text)
return NULL;
textlen = strlen(text);
for (i = 0; cmd_table[i].cmd; i++) {
if (g_strcmp0(cmd_table[i].cmd, text) == 0)
cmdlen = strlen(cmd_table[i].cmd);
if (textlen > cmdlen && text[cmdlen] != ' ')
continue;
if (strncmp(cmd_table[i].cmd, text, cmdlen) == 0)
return cmd_table[i].cb;
}
......
......@@ -136,10 +136,12 @@ static char **complete_agent(const char *text, int start, int end)
}
/* Return how many parameters we have typed */
static int calc_level(char *line)
int __connmanctl_input_calc_level(void)
{
int count = 0;
char *ptr = line;
char *ptr;
ptr = rl_line_buffer;
while (*ptr) {
if (*ptr == ' ') {
......@@ -155,16 +157,9 @@ static int calc_level(char *line)
return count;
}
static char *get_command_name(char *line)
void __connmanctl_input_lookup_end(void)
{
char *start, *ptr;
start = ptr = line;
while (*ptr && *ptr != ' ')
ptr++;
return g_strndup(start, ptr - start);
rl_attempted_completion_over = 1;
}
static char **complete_command(const char *text, int start, int end)
......@@ -175,24 +170,14 @@ static char **complete_command(const char *text, int start, int end)
} else {
__connmanctl_lookup_cb cb;
char *current_command;
char **str = NULL;
if (calc_level(rl_line_buffer) > 1) {
rl_attempted_completion_over = 1;
return NULL;
}
current_command = get_command_name(rl_line_buffer);
cb = __connmanctl_get_lookup_func(current_command);
cb = __connmanctl_get_lookup_func(rl_line_buffer);
if (cb)
str = rl_completion_matches(text, cb);
else
rl_attempted_completion_over = 1;
g_free(current_command);
return str;
}
}
......
......@@ -33,6 +33,8 @@ void __connmanctl_quit(void);
bool __connmanctl_is_interactive(void);
void __connmanctl_save_rl(void);
void __connmanctl_redraw_rl(void);
int __connmanctl_input_calc_level(void);
void __connmanctl_input_lookup_end(void);
typedef void (* connmanctl_input_func_t) (char *input, void *user_data);
void __connmanctl_agent_mode(const char *prompt,
connmanctl_input_func_t input_handler, void *user_data);
......
AC_PREREQ(2.60)
AC_INIT(connman, 1.21)
AC_INIT(connman, 1.22)
AM_INIT_AUTOMAKE([foreign subdir-objects color-tests])
AC_CONFIG_HEADERS([config.h])
......@@ -203,13 +203,6 @@ if (test -z "${stats_max_file_size}"); then
stats_max_file_size="16 * 8 * 128"
fi
AC_ARG_ENABLE(systemd, AC_HELP_STRING([--enable-systemd],
[enable systemd notify on start]), [
if (test "${enableval}" = "yes"); then
CFLAGS="$CFLAGS -DSYSTEMD -lsystemd-daemon"
fi
])
AC_DEFINE_UNQUOTED([STATS_MAX_FILE_SIZE], (${stats_max_file_size}), [Maximal size of a statistics round robin file])
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes,
......@@ -293,6 +286,11 @@ AC_ARG_ENABLE(ethernet, AC_HELP_STRING([--disable-ethernet],
[enable_ethernet=${enableval}])
AM_CONDITIONAL(ETHERNET, test "${enable_ethernet}" != "no")
AC_ARG_ENABLE(gadget, AC_HELP_STRING([--disable-gadget],
[disable USB Gadget support]),
[enable_gadget=${enableval}])
AM_CONDITIONAL(GADGET, test "${enable_gadget}" != "no")
AC_ARG_ENABLE(wifi, AC_HELP_STRING([--disable-wifi],
[disable WiFi support]),
[enable_wifi=${enableval}])
......@@ -388,4 +386,4 @@ AM_CONDITIONAL(VPN, test "${enable_openconnect}" != "no" -o \
AC_OUTPUT(Makefile include/version.h src/connman.service
vpn/connman-vpn.service vpn/net.connman.vpn.service
scripts/connman connman.pc)
scripts/connman connman.pc src/net.connman.service)
#!/usr/bin/python
import dbus
import time
WPA_NAME='fi.epitest.hostap.WPASupplicant'
WPA_INTF='fi.epitest.hostap.WPASupplicant'
WPA_PATH='/fi/epitest/hostap/WPASupplicant'
bus = dbus.SystemBus()
dummy = dbus.Interface(bus.get_object(WPA_NAME, WPA_PATH),
'org.freedesktop.DBus.Introspectable')
#print dummy.Introspect()
manager = dbus.Interface(bus.get_object(WPA_NAME, WPA_PATH), WPA_INTF)
try:
path = manager.getInterface("wlan0")
except:
path = manager.addInterface("wlan0")
interface = dbus.Interface(bus.get_object(WPA_NAME, path),
WPA_INTF + ".Interface")
print "state = %s" % (interface.state())
try:
print "scanning = %s" % (interface.scanning())
except:
pass
print "[ %s ]" % (path)
capabilities = interface.capabilities()
for key in capabilities.keys():
list = ""
for value in capabilities[key]:
list += " " + value
print " %s =%s" % (key, list)
interface.scan()
time.sleep(1)
try:
print "scanning = %s" % (interface.scanning())
except:
pass
time.sleep(1)
print "state = %s" % (interface.state())
results = interface.scanResults()
print results
path = results[0]
print "[ %s ]" % (path)
bssid = dbus.Interface(bus.get_object(WPA_NAME, path),
WPA_INTF + ".BSSID")
properties = bssid.properties()
for key in properties.keys():
print " %s = %s" % (key, properties[key])
......@@ -91,18 +91,17 @@ The following options are valid if Type is "wifi"
then AP is not hidden.
Example
=======
Examples
========
This is a configuration file for a network providing EAP-TLS, EAP-TTLS and
EAP-PEAP services.
The respective SSIDs are tls_ssid, ttls_ssid and peap_ssid and the file name
is example.config.
EAP-PEAP services. The respective SSIDs are tls_ssid, ttls_ssid and peap_ssid
and the file name is example.config.
Please note that the SSID entry is for hexadecimal encoded SSID (e.g. "SSID =
746c735f73736964"). If your SSID does not contain any exotic character then
you should use the Name entry instead (e.g. "Name = tls_ssid").
example@example:[~]$ cat /var/lib/connman/example.config
[global]
Name = Example
......
......@@ -91,7 +91,7 @@ List of blacklisted network interfaces separated by ",".
Found interfaces will be compared to the list and will
not be handled by connman, if their first characters
match any of the list entries. Default value is
vmnet,vboxnet,virbr.
vmnet,vboxnet,virbr,ifb.
.TP
.B AllowHostnameUpdates=\fPtrue|false\fP
Allow connman to change the system hostname. This can
......
......@@ -39,6 +39,13 @@ Methods dict GetProperties()
Possible Errors: [service].Error.InvalidArguments