Commit 75e79b29 authored by Thomas Haller's avatar Thomas Haller

release: bump version to 1.11.1-dev after 1.10.0 release

After 1.10.0 is released, merge it back into master so that
1.10.0 is part of the history of master. That means,
  $ git log --first-parent master
will also traverse 1.10.0 and 1.10-rc*.

Also bump the micro version to 1.11.1-dev to indicate that this is
after 1.10.0 is out.
parents 1193fb1b 1e02ee4d
......@@ -6,7 +6,7 @@
*.gcno
*.gcda
*.la
*.gir
*-*.gir
*.typelib
**.stamp
.dirstamp
......@@ -177,6 +177,7 @@ test-*.trs
/libnm-util/tests/test-setting-8021x
/libnm-util/tests/test-setting-dcb
/libnm/fake-typelib/typelibs.c
/libnm/nm-settings-ifcfg-rh-docs.xml
/libnm/nm-property-docs.xml
/libnm/nm-settings-docs.xml
......
......@@ -26,7 +26,7 @@ addons:
coverity_scan:
project:
name: NetworkManager/NetworkManager
build_command_prepend: sh autogen.sh --with-systemd-logind=no --enable-more-warnings=no
build_command_prepend: sh autogen.sh --with-systemd-logind=no --enable-more-warnings=no --disable-ovs
build_command: make -j4
branch_pattern: .*coverity.*
......
......@@ -737,6 +737,7 @@ libnm_lib_h_pub_real = \
libnm/NetworkManager.h \
libnm/nm-access-point.h \
libnm/nm-active-connection.h \
libnm/nm-checkpoint.h \
libnm/nm-client.h \
libnm/nm-device-adsl.h \
libnm/nm-device-bond.h \
......@@ -792,6 +793,7 @@ libnm_lib_h_priv = \
libnm_lib_c_real = \
libnm/nm-access-point.c \
libnm/nm-active-connection.c \
libnm/nm-checkpoint.c \
libnm/nm-client.c \
libnm/nm-dbus-helpers.c \
libnm/nm-device-adsl.c \
......@@ -858,6 +860,7 @@ nodist_libnminclude_HEADERS += \
noinst_LTLIBRARIES += libnm/libnm-utils.la
libnm_libnm_utils_la_CPPFLAGS = \
$(INTROSPECTION_CFLAGS) \
$(libnm_lib_cppflags)
libnm_libnm_utils_la_SOURCES = \
......@@ -956,8 +959,34 @@ libnm/libnm.typelib: libnm/libnm.gir
$(INTROSPECTION_COMPILER) --includedir=$(srcdir)/libnm-core --includedir=$(builddir)/libnm-core --includedir=$(srcdir)/libnm --includedir=$(builddir)/libnm $< -o $@
INTROSPECTION_GIRS += libnm/NM-1.0.gir
if WITH_FAKE_TYPELIBS
libnm/fake-typelib/NetworkManager.typelib: libnm/fake-typelib/NetworkManager.gir libnm/fake-typelib/.dirstamp
$(AM_V_GEN) $(INTROSPECTION_COMPILER) $< -o $@
libnm/fake-typelib/NMClient.typelib: libnm/fake-typelib/NMClient.gir libnm/fake-typelib/.dirstamp
$(AM_V_GEN) $(INTROSPECTION_COMPILER) $< -o $@
libnm/fake-typelib/typelibs.c: libnm/fake-typelib/typelibs.gresource.xml libnm/fake-typelib/NetworkManager.typelib libnm/fake-typelib/NMClient.typelib
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ --sourcedir=$(builddir)/libnm/fake-typelib --generate-source --manual-register
nodist_libnm_libnm_utils_la_SOURCES = \
libnm/fake-typelib/typelibs.c
CLEANFILES += \
libnm/fake-typelib/typelibs.c \
libnm/fake-typelib/NMClient.typelib \
libnm/fake-typelib/NetworkManager.typelib
endif
endif
EXTRA_DIST += \
libnm/fake-typelib/NetworkManager.gir \
libnm/fake-typelib/NMClient.gir \
libnm/fake-typelib/typelibs.gresource.xml
if HAVE_INTROSPECTION
libnm_noinst_data = \
......@@ -2075,6 +2104,7 @@ EXTRA_DIST += \
src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-Test_Write_Wifi_LEAP.cexpected \
src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-Test_Write_Wifi_WEP_104_ASCII.cexpected \
src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-Test_Write_Wired_Auto-Negotiate.cexpected \
src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-Test_Write_Wired_Static_Routes.cexpected \
src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-Test_Write_Wired_Wake-on-LAN.cexpected \
src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-Vlan_test-vlan-interface.cexpected \
src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-dcb-test.cexpected \
......@@ -4537,6 +4567,7 @@ EXTRA_DIST += \
shared/nm-utils/c-list-util.h \
shared/nm-utils/gsystem-local-alloc.h \
shared/nm-utils/nm-glib.h \
shared/nm-utils/nm-jansson.h \
shared/nm-utils/nm-obj.h \
shared/nm-utils/nm-macros-internal.h \
shared/nm-utils/nm-shared-utils.c \
......
......@@ -133,6 +133,8 @@ EXTRA_DIST += \
examples/dispatcher/10-ifcfg-rh-routes.sh \
examples/dispatcher/70-wifi-wired-exclusive.sh \
\
examples/js/get_ips.js \
\
examples/lua/lgi/add-connection.lua \
examples/lua/lgi/list-connections.lua \
examples/lua/lgi/list-devices.lua \
......
......@@ -399,9 +399,11 @@ nmc_device_reason_to_string (NMDeviceStateReason reason)
return _("The device's parent changed");
case NM_DEVICE_STATE_REASON_PARENT_MANAGED_CHANGED:
return _("The device parent's management changed");
case NM_DEVICE_STATE_REASON_OVSDB_FAILED:
return _("OpenVSwitch database connection failed");
case NM_DEVICE_STATE_REASON_IP_ADDRESS_DUPLICATE:
return _("A duplicate IP address was detected");
}
/* TRANSLATORS: Unknown reason for a device state change (NMDeviceStateReason) */
......
......@@ -461,6 +461,7 @@ _get_text_hidden (NMMetaAccessorGetType get_type)
return NM_META_TEXT_HIDDEN;
}
/*****************************************************************************/
G_GNUC_PRINTF (4, 5)
......@@ -3642,6 +3643,60 @@ _validate_fcn_team_config (const char *value, char **out_to_free, GError **error
RETURN_STR_TO_FREE (json);
}
static gboolean
_is_valid_team_runner_tx_hash_element (const char *tx_hash_element)
{
const char *valid_tx_hashes[] = { "eth", "vlan", "ipv4", "ipv6", "ip",
"l3", "tcp", "udp", "sctp", "l4", NULL };
if (nmc_string_is_valid (tx_hash_element, valid_tx_hashes, NULL))
return TRUE;
return FALSE;
}
static gboolean
_set_fcn_team_runner_tx_hash (ARGS_SET_FCN)
{
char **strv = NULL;
guint i = 0;
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
strv = _nm_utils_strv_cleanup (g_strsplit_set (value, " \t,", 0),
TRUE, TRUE, TRUE);
if (!verify_string_list (strv, property_info->property_name,
_is_valid_team_runner_tx_hash_element,
error)) {
g_strfreev (strv);
return FALSE;
}
while (strv && strv[i])
nm_setting_team_add_runner_tx_hash (NM_SETTING_TEAM (setting), strv[i++]);
g_strfreev (strv);
return TRUE;
}
static gboolean
_validate_and_remove_team_runner_tx_hash (NMSettingTeam *setting,
const char *tx_hash,
GError **error)
{
if (!nm_setting_team_remove_runner_tx_hash_by_value (setting, tx_hash)) {
g_set_error (error, 1, 0,
_("the property doesn't contain string '%s'"),
tx_hash);
return FALSE;
}
return TRUE;
}
DEFINE_REMOVER_INDEX_OR_VALUE (_remove_fcn_team_runner_tx_hash,
NM_SETTING_TEAM,
nm_setting_team_get_num_runner_tx_hash,
nm_setting_team_remove_runner_tx_hash,
_validate_and_remove_team_runner_tx_hash)
static gconstpointer
_get_fcn_vlan_flags (ARGS_GET_FCN)
{
......@@ -6000,6 +6055,130 @@ static const NMMetaPropertyInfo *const property_infos_TEAM[] = {
.validate_fcn = _validate_fcn_team_config,
),
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_NOTIFY_PEERS_COUNT,
.property_type = &_pt_gobject_int,
.property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int,
.value_infos = INT_VALUE_INFOS (
{
.value = 0,
.nick = "disabled",
}
),
),
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_NOTIFY_PEERS_INTERVAL,
.property_type = &_pt_gobject_int,
.property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int,
.value_infos = INT_VALUE_INFOS (
{
.value = 0,
.nick = "default",
}
),
),
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_MCAST_REJOIN_COUNT,
.property_type = &_pt_gobject_int,
.property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int,
.value_infos = INT_VALUE_INFOS (
{
.value = 0,
.nick = "disabled",
}
),
),
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_MCAST_REJOIN_INTERVAL,
.property_type = &_pt_gobject_int,
.property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int,
.value_infos = INT_VALUE_INFOS (
{
.value = 0,
.nick = "default",
}
),
),
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_RUNNER,
.property_type = &_pt_gobject_string,
.property_typ_data = DEFINE_PROPERTY_TYP_DATA (
.values_static = VALUES_STATIC (NM_SETTING_TEAM_RUNNER_BROADCAST,
NM_SETTING_TEAM_RUNNER_ROUNDROBIN,
NM_SETTING_TEAM_RUNNER_ACTIVEBACKUP,
NM_SETTING_TEAM_RUNNER_LOADBALANCE,
NM_SETTING_TEAM_RUNNER_LACP),
),
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_RUNNER_HWADDR_POLICY,
.property_type = &_pt_gobject_string,
.property_typ_data = DEFINE_PROPERTY_TYP_DATA (
.values_static = VALUES_STATIC (NM_SETTING_TEAM_RUNNER_HWADDR_POLICY_SAME_ALL,
NM_SETTING_TEAM_RUNNER_HWADDR_POLICY_BY_ACTIVE,
NM_SETTING_TEAM_RUNNER_HWADDR_POLICY_ONLY_ACTIVE),
),
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_RUNNER_TX_HASH,
.property_type = DEFINE_PROPERTY_TYPE (
.get_fcn = _get_fcn_gobject,
.set_fcn = _set_fcn_team_runner_tx_hash,
.remove_fcn = _remove_fcn_team_runner_tx_hash,
),
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_RUNNER_TX_BALANCER,
.property_type = &_pt_gobject_string,
.property_typ_data = DEFINE_PROPERTY_TYP_DATA (
.values_static = VALUES_STATIC ("basic"),
),
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_RUNNER_TX_BALANCER_INTERVAL,
.property_type = &_pt_gobject_int,
.property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int,
.value_infos = INT_VALUE_INFOS (
{
.value = 50,
.nick = "default",
}
),
),
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_RUNNER_ACTIVE,
.property_type = & _pt_gobject_bool,
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_RUNNER_FAST_RATE,
.property_type = & _pt_gobject_bool,
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_RUNNER_SYS_PRIO,
.property_type = &_pt_gobject_int,
.property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int,
.value_infos = INT_VALUE_INFOS (
{
.value = 255,
.nick = "default",
}
),
),
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_RUNNER_MIN_PORTS,
.property_type = &_pt_gobject_int,
.property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int,
.value_infos = INT_VALUE_INFOS (
{
.value = 0,
.nick = "default",
}
),
),
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY,
.property_type = &_pt_gobject_string,
.property_typ_data = DEFINE_PROPERTY_TYP_DATA (
.values_static = VALUES_STATIC (NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY_LACP_PRIO,
NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY_LACP_PRIO_STABLE,
NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY_BANDWIDTH,
NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY_COUNT,
NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY_PORT_CONFIG),
),
),
NULL
};
......@@ -6016,6 +6195,53 @@ static const NMMetaPropertyInfo *const property_infos_TEAM_PORT[] = {
.validate_fcn = _validate_fcn_team_config,
),
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_PORT_QUEUE_ID,
.property_type = &_pt_gobject_int,
.property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int,
.value_infos = INT_VALUE_INFOS (
{
.value = -1,
.nick = "default",
}
),
),
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_PORT_PRIO,
.property_type = &_pt_gobject_int,
.property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int,
.value_infos = INT_VALUE_INFOS (
{
.value = 0,
.nick = "default",
}
),
),
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_PORT_STICKY,
.property_type = &_pt_gobject_bool,
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_PORT_LACP_PRIO,
.property_type = &_pt_gobject_int,
.property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int,
.value_infos = INT_VALUE_INFOS (
{
.value = 255,
.nick = "default",
}
),
),
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_PORT_LACP_KEY,
.property_type = &_pt_gobject_int,
.property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int,
.value_infos = INT_VALUE_INFOS (
{
.value = 0,
.nick = "default",
}
),
),
),
NULL
};
......
......@@ -316,9 +316,28 @@
#define DESCRIBE_DOC_NM_SETTING_SERIAL_SEND_DELAY N_("Time to delay between each byte sent to the modem, in microseconds.")
#define DESCRIBE_DOC_NM_SETTING_SERIAL_STOPBITS N_("Number of stop bits for communication on the serial port. Either 1 or 2. The 1 in \"8n1\" for example.")
#define DESCRIBE_DOC_NM_SETTING_TEAM_CONFIG N_("The JSON configuration for the team network interface. The property should contain raw JSON configuration data suitable for teamd, because the value is passed directly to teamd. If not specified, the default configuration is used. See man teamd.conf for the format details.")
#define DESCRIBE_DOC_NM_SETTING_TEAM_MCAST_REJOIN_COUNT N_("Corresponds to the teamd mcast_rejoin.count.")
#define DESCRIBE_DOC_NM_SETTING_TEAM_MCAST_REJOIN_INTERVAL N_("Corresponds to the teamd mcast_rejoin.interval.")
#define DESCRIBE_DOC_NM_SETTING_TEAM_NAME N_("The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\".")
#define DESCRIBE_DOC_NM_SETTING_TEAM_NOTIFY_PEERS_COUNT N_("Corresponds to the teamd notify_peers.count.")
#define DESCRIBE_DOC_NM_SETTING_TEAM_NOTIFY_PEERS_INTERVAL N_("Corresponds to the teamd notify_peers.interval.")
#define DESCRIBE_DOC_NM_SETTING_TEAM_RUNNER N_("Corresponds to the teamd runner.name. Permitted values are: \"roundrobin\", \"broadcast\", \"activebackup\", \"loadbalance\", \"lacp\".")
#define DESCRIBE_DOC_NM_SETTING_TEAM_RUNNER_ACTIVE N_("Corresponds to the teamd runner.active.")
#define DESCRIBE_DOC_NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY N_("Corresponds to the teamd runner.agg_select_policy.")
#define DESCRIBE_DOC_NM_SETTING_TEAM_RUNNER_FAST_RATE N_("Corresponds to the teamd runner.fast_rate.")
#define DESCRIBE_DOC_NM_SETTING_TEAM_RUNNER_HWADDR_POLICY N_("Corresponds to the teamd runner.hwaddr_policy.")
#define DESCRIBE_DOC_NM_SETTING_TEAM_RUNNER_MIN_PORTS N_("Corresponds to the teamd runner.min_ports.")
#define DESCRIBE_DOC_NM_SETTING_TEAM_RUNNER_SYS_PRIO N_("Corresponds to the teamd runner.sys_prio.")
#define DESCRIBE_DOC_NM_SETTING_TEAM_RUNNER_TX_BALANCER N_("Corresponds to the teamd runner.tx_balancer.name.")
#define DESCRIBE_DOC_NM_SETTING_TEAM_RUNNER_TX_BALANCER_INTERVAL N_("Corresponds to the teamd runner.tx_balancer.interval.")
#define DESCRIBE_DOC_NM_SETTING_TEAM_RUNNER_TX_HASH N_("Corresponds to the teamd runner.tx_hash.")
#define DESCRIBE_DOC_NM_SETTING_TEAM_PORT_CONFIG N_("The JSON configuration for the team port. The property should contain raw JSON configuration data suitable for teamd, because the value is passed directly to teamd. If not specified, the default configuration is used. See man teamd.conf for the format details.")
#define DESCRIBE_DOC_NM_SETTING_TEAM_PORT_LACP_KEY N_("Corresponds to the teamd ports.PORTIFNAME.lacp_key.")
#define DESCRIBE_DOC_NM_SETTING_TEAM_PORT_LACP_PRIO N_("Corresponds to the teamd ports.PORTIFNAME.lacp_prio.")
#define DESCRIBE_DOC_NM_SETTING_TEAM_PORT_NAME N_("The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\".")
#define DESCRIBE_DOC_NM_SETTING_TEAM_PORT_PRIO N_("Corresponds to the teamd ports.PORTIFNAME.prio.")
#define DESCRIBE_DOC_NM_SETTING_TEAM_PORT_QUEUE_ID N_("Corresponds to the teamd ports.PORTIFNAME.queue_id. When set to -1 means the parameter is skipped from the json config.")
#define DESCRIBE_DOC_NM_SETTING_TEAM_PORT_STICKY N_("Corresponds to the teamd ports.PORTIFNAME.sticky.")
#define DESCRIBE_DOC_NM_SETTING_TUN_GROUP N_("The group ID which will own the device. If set to NULL everyone will be able to use the device.")
#define DESCRIBE_DOC_NM_SETTING_TUN_MODE N_("The operating mode of the virtual device. Allowed values are NM_SETTING_TUN_MODE_TUN (1) to create a layer 3 device and NM_SETTING_TUN_MODE_TAP (2) to create an Ethernet-like layer 2 one.")
#define DESCRIBE_DOC_NM_SETTING_TUN_MULTI_QUEUE N_("If the property is set to TRUE, the interface will support multiple file descriptors (queues) to parallelize packet sending or receiving. Otherwise, the interface will only support a single queue.")
......
......@@ -2,8 +2,8 @@ AC_PREREQ([2.63])
dnl The NM version number
m4_define([nm_major_version], [1])
m4_define([nm_minor_version], [10])
m4_define([nm_micro_version], [0])
m4_define([nm_minor_version], [11])
m4_define([nm_micro_version], [1])
m4_define([nm_version],
[nm_major_version.nm_minor_version.nm_micro_version])
......@@ -322,9 +322,12 @@ GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32 -DGLIB_V
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
GOBJECT_INTROSPECTION_CHECK([0.9.6])
AC_ARG_WITH(libnm-glib,
AS_HELP_STRING([--without-libnm-glib],
[don't build legacy libraries]))
[don"'"t build legacy libraries]))
fake_typelibs=no
if test "$with_libnm_glib" != "no"; then
PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.1 dbus-glib-1 >= 0.94, :,
[AC_MSG_FAILURE([$DBUS_PKG_ERRORS
......@@ -333,13 +336,24 @@ Configure with --without-libnm-glib if you do not need the legacy libraries])
])
with_libnm_glib=yes
if test "${found_introspection}" = "yes"; then
AC_PATH_PROG(GLIB_COMPILE_RESOURCES, glib-compile-resources)
if ! test x"$GLIB_COMPILE_RESOURCES" = x""; then
fake_typelibs=yes
fi
fi
fi
AM_CONDITIONAL(WITH_LEGACY_LIBRARIES, test "$with_libnm_glib" != "no")
if test "$fake_typelibs" = "yes"; then
AC_DEFINE(WITH_FAKE_TYPELIBS, 1, [Define for libnm to prevent GIR from loading libnm-glib])
else
AC_DEFINE(WITH_FAKE_TYPELIBS, 0, [Define for libnm to prevent GIR from loading libnm-glib])
fi
AM_CONDITIONAL(WITH_FAKE_TYPELIBS, test "${fake_typelibs}" = "yes")
PKG_CHECK_MODULES([LIBUDEV], [libudev >= 175])
GOBJECT_INTROSPECTION_CHECK([0.9.6])
# Qt4
PKG_CHECK_MODULES(QT, [QtCore >= 4 QtDBus QtNetwork], [have_qt=yes],[have_qt=no])
AC_ARG_ENABLE(qt,
......@@ -1213,6 +1227,22 @@ fi
AC_SUBST(SANITIZERS, [$sanitizers])
AC_MSG_CHECKING([CC support C11 _Generic()])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int foo(void); int foo() { int a = 0; int b = _Generic (a, int: 4); return b + a; }]],
[[foo();]])],
[cc_support_generic=1],
[cc_support_generic=0])
AC_MSG_RESULT($cc_support_generic)
AC_DEFINE_UNQUOTED(_NM_CC_SUPPORT_GENERIC, $cc_support_generic, [Define whether the compiler supports C11 _Generic()])
AC_MSG_CHECKING([CC support gcc __auto_type])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int foo(void); int foo() { int a = 0; __auto_type b = a; return b + a; }]],
[[foo();]])],
[cc_support_auto_type=1],
[cc_support_auto_type=0])
AC_MSG_RESULT($cc_support_auto_type)
AC_DEFINE_UNQUOTED(_NM_CC_SUPPORT_AUTO_TYPE, $cc_support_auto_type, [Define whether the compiler support gcc __auto_type])
dnl -------------------------
dnl Vala bindings
dnl -------------------------
......
#!/usr/bin/env gjs
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright 2014,2017 Red Hat, Inc.
*/
const System = imports.system;
const NM = imports.gi.NM;
const GLib = imports.gi.GLib;
/*
* This example shows how to get addresses, routes and DNS information
* from NMIP4Config and NMIP6Config (got out of NMDevice)
*/
function show_addresses (dev, family)
{
let ip_cfg;
if (family == GLib.SYSDEF_AF_INET)
ip_cfg = dev.get_ip4_config ();
else
ip_cfg = dev.get_ip6_config ();
if (ip_cfg == null) {
print ("None");
return;
}
let nm_addresses = ip_cfg.get_addresses ();
if (nm_addresses.length == 0) {
print ("None");
return;
}
for (let nm_address of nm_addresses) {
let addr = nm_address.get_address ();
let prefix = nm_address.get_prefix ();
print (addr + "/" + prefix);
}
}
function show_gateway (dev, family)
{
let ip_cfg;
if ((family == GLib.SYSDEF_AF_INET))
ip_cfg = dev.get_ip4_config ();
else
ip_cfg = dev.get_ip6_config ();
let gw;
if (ip_cfg == null)
gw = "None"
else {
gw = ip_cfg.get_gateway ();
if (gw == '')
gw = "None"
}
print (gw);
}
function show_routes (dev, family)
{
let ip_cfg;
if ((family == GLib.SYSDEF_AF_INET))
ip_cfg = dev.get_ip4_config ();
else
ip_cfg = dev.get_ip6_config ();
if (ip_cfg == null) {
print ("None");
return;
}
let nm_routes = ip_cfg.get_routes ();
if (nm_routes.length == 0) {
print ("None");
return;
}
for (let nm_route of nm_routes) {
let dest = nm_route.get_dest ();
let prefix = nm_route.get_prefix ();
let next_hop = nm_route.get_next_hop ();
let metric = nm_route.get_metric ();
print (dest + "/" + prefix + " " + next_hop + " " + metric);
}
}
function show_dns (dev, family)
{
let ip_cfg;
if ((family == GLib.SYSDEF_AF_INET))
ip_cfg = dev.get_ip4_config ();
else
ip_cfg = dev.get_ip6_config ();
if (ip_cfg == null) {
print ("None");
return;
}
print ("Nameservers: " + ip_cfg.get_nameservers ());
print ("Domains: " + ip_cfg.get_domains ());
print ("Searches: " + ip_cfg.get_searches ());
if ((family == GLib.SYSDEF_AF_INET))
print ("WINS: " + ip_cfg.get_wins_servers ());
}
if (ARGV.length != 1) {
print ("Usage: get_ips.js <interface>");
System.exit (1);
}
let dev_iface = ARGV[0];
let c = NM.Client.new (null);
let dev = c.get_device_by_iface (dev_iface);
if (dev == null) {
print ("Device '%s' not found " + dev_iface);
System.exit (1);
}
print ("Device: " + dev_iface + " - " + dev.get_type_description ());
print ("---------------------------------------");
print ();
print ("IPv4 addresses:");
print ("---------------");
show_addresses (dev, GLib.SYSDEF_AF_INET);
print ();
print ("IPv4 gateway:");
print ("-------------");
show_gateway (dev, GLib.SYSDEF_AF_INET);
print ();
print ("IPv4 routes:");
print ("------------");
show_routes (dev, GLib.SYSDEF_AF_INET);
print ();
print ("IPv6 addresses:");
print ("---------------");