2008-11-14 17:41:16 +00:00
|
|
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
|
|
|
* 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 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 Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301 USA.
|
|
|
|
*
|
2014-07-04 17:33:18 +00:00
|
|
|
* Copyright 2007 - 2011 Novell, Inc.
|
|
|
|
* Copyright 2008 Red Hat, Inc.
|
2008-11-14 17:41:16 +00:00
|
|
|
*/
|
|
|
|
|
2016-02-19 13:57:48 +00:00
|
|
|
#include "nm-default.h"
|
2014-11-13 15:07:02 +00:00
|
|
|
|
2008-03-24 15:17:30 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2016-02-19 13:57:48 +00:00
|
|
|
#include "nm-setting-ip4-config.h"
|
2007-02-16 11:23:49 +00:00
|
|
|
#include "nm-ip4-config.h"
|
2007-06-22 15:09:02 +00:00
|
|
|
#include "NetworkManager.h"
|
2008-03-24 15:17:30 +00:00
|
|
|
#include "nm-types-private.h"
|
|
|
|
#include "nm-object-private.h"
|
2008-05-06 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c
- (nm_dhcp_manager_get_ip4_config): clean up; update for changes to
NMIP4Config to support multiple IP addresses
* src/NetworkManagerUtils.c
- (nm_utils_merge_ip4_config): update for multiple IP addresses
* src/nm-ip4-config.c
src/nm-ip4-config.h
- Store a list of IPv4 address/netmask/gateway tuples
- (nm_ip4_config_get_gateway, nm_ip4_config_set_gateway,
nm_ip4_config_get_netmask, nm_ip4_config_set_netmask,
nm_ip4_config_get_broadcast, nm_ip4_config_set_broadcast,
nm_ip4_config_set_address): remove
- (nm_ip4_config_take_address, nm_ip4_config_add_address,
nm_ip4_config_replace_address, nm_ip4_config_get_num_addresses):
new functions; handle multiple IPv4 addresses
* src/nm-device.c
src/ppp-manager/nm-ppp-manager.c
src/vpn-manager/nm-vpn-connection.c
src/NetworkManagerPolicy.c
test/nm-tool.c
libnm-glib/libnm-glib-test.c
- update for changes to NMIP4Config for multiple IPv4 addresses
* src/NetworkManagerSystem.c
- (nm_system_device_set_ip4_route): don't add the route if any address
is on the same subnet as the destination
- (check_one_address): ignore the exact match, just match family and
interface index
- (add_ip4_addresses): add all IPv4 addresses in an NMIP4Config to
an interface
- (nm_system_device_set_from_ip4_config): use add_ip4_addresses()
- (nm_system_vpn_device_set_from_ip4_config): use add_ip4_addresses()
* introspection/nm-ip4-config.xml
- Remove 'address', 'gateway', 'netmask', and 'broadcast' properties
- Add 'addresses' property which is an array of (uuu) tuples of
address/netmask/gateway
* libnm-util/nm-setting-ip4-config.c
- (set_property): use ip-address <-> GValue converters from nm-utils.c
* libnm-glib/nm-ip4-config.c
libnm-glib/nm-ip4-config.h
- Handle D-Bus interface changes to support multiple IP addresses
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3637 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-06 21:53:22 +00:00
|
|
|
#include "nm-utils.h"
|
2007-02-16 11:23:49 +00:00
|
|
|
|
2007-06-22 15:09:02 +00:00
|
|
|
G_DEFINE_TYPE (NMIP4Config, nm_ip4_config, NM_TYPE_OBJECT)
|
2007-02-16 11:23:49 +00:00
|
|
|
|
2008-03-24 15:17:30 +00:00
|
|
|
#define NM_IP4_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_IP4_CONFIG, NMIP4ConfigPrivate))
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
DBusGProxy *proxy;
|
|
|
|
|
2013-09-06 09:56:41 +00:00
|
|
|
char *gateway;
|
2008-05-06 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c
- (nm_dhcp_manager_get_ip4_config): clean up; update for changes to
NMIP4Config to support multiple IP addresses
* src/NetworkManagerUtils.c
- (nm_utils_merge_ip4_config): update for multiple IP addresses
* src/nm-ip4-config.c
src/nm-ip4-config.h
- Store a list of IPv4 address/netmask/gateway tuples
- (nm_ip4_config_get_gateway, nm_ip4_config_set_gateway,
nm_ip4_config_get_netmask, nm_ip4_config_set_netmask,
nm_ip4_config_get_broadcast, nm_ip4_config_set_broadcast,
nm_ip4_config_set_address): remove
- (nm_ip4_config_take_address, nm_ip4_config_add_address,
nm_ip4_config_replace_address, nm_ip4_config_get_num_addresses):
new functions; handle multiple IPv4 addresses
* src/nm-device.c
src/ppp-manager/nm-ppp-manager.c
src/vpn-manager/nm-vpn-connection.c
src/NetworkManagerPolicy.c
test/nm-tool.c
libnm-glib/libnm-glib-test.c
- update for changes to NMIP4Config for multiple IPv4 addresses
* src/NetworkManagerSystem.c
- (nm_system_device_set_ip4_route): don't add the route if any address
is on the same subnet as the destination
- (check_one_address): ignore the exact match, just match family and
interface index
- (add_ip4_addresses): add all IPv4 addresses in an NMIP4Config to
an interface
- (nm_system_device_set_from_ip4_config): use add_ip4_addresses()
- (nm_system_vpn_device_set_from_ip4_config): use add_ip4_addresses()
* introspection/nm-ip4-config.xml
- Remove 'address', 'gateway', 'netmask', and 'broadcast' properties
- Add 'addresses' property which is an array of (uuu) tuples of
address/netmask/gateway
* libnm-util/nm-setting-ip4-config.c
- (set_property): use ip-address <-> GValue converters from nm-utils.c
* libnm-glib/nm-ip4-config.c
libnm-glib/nm-ip4-config.h
- Handle D-Bus interface changes to support multiple IP addresses
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3637 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-06 21:53:22 +00:00
|
|
|
GSList *addresses;
|
2013-09-06 09:56:41 +00:00
|
|
|
GSList *routes;
|
2008-03-24 15:17:30 +00:00
|
|
|
GArray *nameservers;
|
|
|
|
GPtrArray *domains;
|
2013-09-06 09:56:41 +00:00
|
|
|
GPtrArray *searches;
|
2008-12-19 22:01:06 +00:00
|
|
|
GArray *wins;
|
2008-03-24 15:17:30 +00:00
|
|
|
} NMIP4ConfigPrivate;
|
|
|
|
|
|
|
|
enum {
|
|
|
|
PROP_0,
|
2013-09-06 09:56:41 +00:00
|
|
|
PROP_GATEWAY,
|
2008-05-06 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c
- (nm_dhcp_manager_get_ip4_config): clean up; update for changes to
NMIP4Config to support multiple IP addresses
* src/NetworkManagerUtils.c
- (nm_utils_merge_ip4_config): update for multiple IP addresses
* src/nm-ip4-config.c
src/nm-ip4-config.h
- Store a list of IPv4 address/netmask/gateway tuples
- (nm_ip4_config_get_gateway, nm_ip4_config_set_gateway,
nm_ip4_config_get_netmask, nm_ip4_config_set_netmask,
nm_ip4_config_get_broadcast, nm_ip4_config_set_broadcast,
nm_ip4_config_set_address): remove
- (nm_ip4_config_take_address, nm_ip4_config_add_address,
nm_ip4_config_replace_address, nm_ip4_config_get_num_addresses):
new functions; handle multiple IPv4 addresses
* src/nm-device.c
src/ppp-manager/nm-ppp-manager.c
src/vpn-manager/nm-vpn-connection.c
src/NetworkManagerPolicy.c
test/nm-tool.c
libnm-glib/libnm-glib-test.c
- update for changes to NMIP4Config for multiple IPv4 addresses
* src/NetworkManagerSystem.c
- (nm_system_device_set_ip4_route): don't add the route if any address
is on the same subnet as the destination
- (check_one_address): ignore the exact match, just match family and
interface index
- (add_ip4_addresses): add all IPv4 addresses in an NMIP4Config to
an interface
- (nm_system_device_set_from_ip4_config): use add_ip4_addresses()
- (nm_system_vpn_device_set_from_ip4_config): use add_ip4_addresses()
* introspection/nm-ip4-config.xml
- Remove 'address', 'gateway', 'netmask', and 'broadcast' properties
- Add 'addresses' property which is an array of (uuu) tuples of
address/netmask/gateway
* libnm-util/nm-setting-ip4-config.c
- (set_property): use ip-address <-> GValue converters from nm-utils.c
* libnm-glib/nm-ip4-config.c
libnm-glib/nm-ip4-config.h
- Handle D-Bus interface changes to support multiple IP addresses
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3637 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-06 21:53:22 +00:00
|
|
|
PROP_ADDRESSES,
|
2013-09-06 09:56:41 +00:00
|
|
|
PROP_ROUTES,
|
2008-03-24 15:17:30 +00:00
|
|
|
PROP_NAMESERVERS,
|
|
|
|
PROP_DOMAINS,
|
2013-09-06 09:56:41 +00:00
|
|
|
PROP_SEARCHES,
|
2008-12-19 22:01:06 +00:00
|
|
|
PROP_WINS_SERVERS,
|
2008-03-24 15:17:30 +00:00
|
|
|
|
|
|
|
LAST_PROP
|
|
|
|
};
|
|
|
|
|
2007-02-16 11:23:49 +00:00
|
|
|
static void
|
|
|
|
nm_ip4_config_init (NMIP4Config *config)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-05-06 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c
- (nm_dhcp_manager_get_ip4_config): clean up; update for changes to
NMIP4Config to support multiple IP addresses
* src/NetworkManagerUtils.c
- (nm_utils_merge_ip4_config): update for multiple IP addresses
* src/nm-ip4-config.c
src/nm-ip4-config.h
- Store a list of IPv4 address/netmask/gateway tuples
- (nm_ip4_config_get_gateway, nm_ip4_config_set_gateway,
nm_ip4_config_get_netmask, nm_ip4_config_set_netmask,
nm_ip4_config_get_broadcast, nm_ip4_config_set_broadcast,
nm_ip4_config_set_address): remove
- (nm_ip4_config_take_address, nm_ip4_config_add_address,
nm_ip4_config_replace_address, nm_ip4_config_get_num_addresses):
new functions; handle multiple IPv4 addresses
* src/nm-device.c
src/ppp-manager/nm-ppp-manager.c
src/vpn-manager/nm-vpn-connection.c
src/NetworkManagerPolicy.c
test/nm-tool.c
libnm-glib/libnm-glib-test.c
- update for changes to NMIP4Config for multiple IPv4 addresses
* src/NetworkManagerSystem.c
- (nm_system_device_set_ip4_route): don't add the route if any address
is on the same subnet as the destination
- (check_one_address): ignore the exact match, just match family and
interface index
- (add_ip4_addresses): add all IPv4 addresses in an NMIP4Config to
an interface
- (nm_system_device_set_from_ip4_config): use add_ip4_addresses()
- (nm_system_vpn_device_set_from_ip4_config): use add_ip4_addresses()
* introspection/nm-ip4-config.xml
- Remove 'address', 'gateway', 'netmask', and 'broadcast' properties
- Add 'addresses' property which is an array of (uuu) tuples of
address/netmask/gateway
* libnm-util/nm-setting-ip4-config.c
- (set_property): use ip-address <-> GValue converters from nm-utils.c
* libnm-glib/nm-ip4-config.c
libnm-glib/nm-ip4-config.h
- Handle D-Bus interface changes to support multiple IP addresses
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3637 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-06 21:53:22 +00:00
|
|
|
static gboolean
|
|
|
|
demarshal_ip4_address_array (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field)
|
|
|
|
{
|
|
|
|
NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object);
|
|
|
|
|
2013-10-18 14:07:26 +00:00
|
|
|
g_slist_free_full (priv->addresses, (GDestroyNotify) nm_ip4_address_unref);
|
2008-05-06 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c
- (nm_dhcp_manager_get_ip4_config): clean up; update for changes to
NMIP4Config to support multiple IP addresses
* src/NetworkManagerUtils.c
- (nm_utils_merge_ip4_config): update for multiple IP addresses
* src/nm-ip4-config.c
src/nm-ip4-config.h
- Store a list of IPv4 address/netmask/gateway tuples
- (nm_ip4_config_get_gateway, nm_ip4_config_set_gateway,
nm_ip4_config_get_netmask, nm_ip4_config_set_netmask,
nm_ip4_config_get_broadcast, nm_ip4_config_set_broadcast,
nm_ip4_config_set_address): remove
- (nm_ip4_config_take_address, nm_ip4_config_add_address,
nm_ip4_config_replace_address, nm_ip4_config_get_num_addresses):
new functions; handle multiple IPv4 addresses
* src/nm-device.c
src/ppp-manager/nm-ppp-manager.c
src/vpn-manager/nm-vpn-connection.c
src/NetworkManagerPolicy.c
test/nm-tool.c
libnm-glib/libnm-glib-test.c
- update for changes to NMIP4Config for multiple IPv4 addresses
* src/NetworkManagerSystem.c
- (nm_system_device_set_ip4_route): don't add the route if any address
is on the same subnet as the destination
- (check_one_address): ignore the exact match, just match family and
interface index
- (add_ip4_addresses): add all IPv4 addresses in an NMIP4Config to
an interface
- (nm_system_device_set_from_ip4_config): use add_ip4_addresses()
- (nm_system_vpn_device_set_from_ip4_config): use add_ip4_addresses()
* introspection/nm-ip4-config.xml
- Remove 'address', 'gateway', 'netmask', and 'broadcast' properties
- Add 'addresses' property which is an array of (uuu) tuples of
address/netmask/gateway
* libnm-util/nm-setting-ip4-config.c
- (set_property): use ip-address <-> GValue converters from nm-utils.c
* libnm-glib/nm-ip4-config.c
libnm-glib/nm-ip4-config.h
- Handle D-Bus interface changes to support multiple IP addresses
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3637 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-06 21:53:22 +00:00
|
|
|
priv->addresses = NULL;
|
|
|
|
|
|
|
|
priv->addresses = nm_utils_ip4_addresses_from_gvalue (value);
|
2008-08-26 09:34:31 +00:00
|
|
|
_nm_object_queue_notify (object, NM_IP4_CONFIG_ADDRESSES);
|
2008-05-06 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c
- (nm_dhcp_manager_get_ip4_config): clean up; update for changes to
NMIP4Config to support multiple IP addresses
* src/NetworkManagerUtils.c
- (nm_utils_merge_ip4_config): update for multiple IP addresses
* src/nm-ip4-config.c
src/nm-ip4-config.h
- Store a list of IPv4 address/netmask/gateway tuples
- (nm_ip4_config_get_gateway, nm_ip4_config_set_gateway,
nm_ip4_config_get_netmask, nm_ip4_config_set_netmask,
nm_ip4_config_get_broadcast, nm_ip4_config_set_broadcast,
nm_ip4_config_set_address): remove
- (nm_ip4_config_take_address, nm_ip4_config_add_address,
nm_ip4_config_replace_address, nm_ip4_config_get_num_addresses):
new functions; handle multiple IPv4 addresses
* src/nm-device.c
src/ppp-manager/nm-ppp-manager.c
src/vpn-manager/nm-vpn-connection.c
src/NetworkManagerPolicy.c
test/nm-tool.c
libnm-glib/libnm-glib-test.c
- update for changes to NMIP4Config for multiple IPv4 addresses
* src/NetworkManagerSystem.c
- (nm_system_device_set_ip4_route): don't add the route if any address
is on the same subnet as the destination
- (check_one_address): ignore the exact match, just match family and
interface index
- (add_ip4_addresses): add all IPv4 addresses in an NMIP4Config to
an interface
- (nm_system_device_set_from_ip4_config): use add_ip4_addresses()
- (nm_system_vpn_device_set_from_ip4_config): use add_ip4_addresses()
* introspection/nm-ip4-config.xml
- Remove 'address', 'gateway', 'netmask', and 'broadcast' properties
- Add 'addresses' property which is an array of (uuu) tuples of
address/netmask/gateway
* libnm-util/nm-setting-ip4-config.c
- (set_property): use ip-address <-> GValue converters from nm-utils.c
* libnm-glib/nm-ip4-config.c
libnm-glib/nm-ip4-config.h
- Handle D-Bus interface changes to support multiple IP addresses
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3637 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-06 21:53:22 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2008-03-24 15:17:30 +00:00
|
|
|
static gboolean
|
|
|
|
demarshal_ip4_array (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field)
|
|
|
|
{
|
2008-08-26 09:34:31 +00:00
|
|
|
if (!_nm_uint_array_demarshal (value, (GArray **) field))
|
2008-03-24 15:17:30 +00:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (!strcmp (pspec->name, NM_IP4_CONFIG_NAMESERVERS))
|
2008-08-26 09:34:31 +00:00
|
|
|
_nm_object_queue_notify (object, NM_IP4_CONFIG_NAMESERVERS);
|
2008-12-19 22:01:06 +00:00
|
|
|
else if (!strcmp (pspec->name, NM_IP4_CONFIG_WINS_SERVERS))
|
|
|
|
_nm_object_queue_notify (object, NM_IP4_CONFIG_WINS_SERVERS);
|
|
|
|
|
2008-03-24 15:17:30 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2013-09-06 09:56:41 +00:00
|
|
|
demarshal_string_array (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field)
|
2008-03-24 15:17:30 +00:00
|
|
|
{
|
2008-08-26 09:34:31 +00:00
|
|
|
if (!_nm_string_array_demarshal (value, (GPtrArray **) field))
|
2008-03-24 15:17:30 +00:00
|
|
|
return FALSE;
|
|
|
|
|
2013-09-06 09:56:41 +00:00
|
|
|
_nm_object_queue_notify (object, pspec->name);
|
2008-03-24 15:17:30 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2008-08-06 22:23:48 +00:00
|
|
|
static gboolean
|
|
|
|
demarshal_ip4_routes_array (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field)
|
|
|
|
{
|
|
|
|
NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object);
|
|
|
|
|
2013-10-18 14:07:26 +00:00
|
|
|
g_slist_free_full (priv->routes, (GDestroyNotify) nm_ip4_route_unref);
|
2008-08-06 22:23:48 +00:00
|
|
|
priv->routes = NULL;
|
|
|
|
|
|
|
|
priv->routes = nm_utils_ip4_routes_from_gvalue (value);
|
2008-08-26 09:34:31 +00:00
|
|
|
_nm_object_queue_notify (object, NM_IP4_CONFIG_ROUTES);
|
2008-08-06 22:23:48 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2008-03-24 15:17:30 +00:00
|
|
|
static void
|
2012-01-20 12:52:17 +00:00
|
|
|
register_properties (NMIP4Config *config)
|
2008-03-24 15:17:30 +00:00
|
|
|
{
|
|
|
|
NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (config);
|
2012-01-20 12:52:17 +00:00
|
|
|
const NMPropertiesInfo property_info[] = {
|
2013-09-06 09:56:41 +00:00
|
|
|
{ NM_IP4_CONFIG_GATEWAY, &priv->gateway, },
|
2012-01-20 12:52:17 +00:00
|
|
|
{ NM_IP4_CONFIG_ADDRESSES, &priv->addresses, demarshal_ip4_address_array },
|
|
|
|
{ NM_IP4_CONFIG_ROUTES, &priv->routes, demarshal_ip4_routes_array },
|
2013-09-06 09:56:41 +00:00
|
|
|
{ NM_IP4_CONFIG_NAMESERVERS, &priv->nameservers, demarshal_ip4_array },
|
|
|
|
{ NM_IP4_CONFIG_DOMAINS, &priv->domains, demarshal_string_array },
|
|
|
|
{ NM_IP4_CONFIG_SEARCHES, &priv->searches, demarshal_string_array },
|
2012-01-20 12:52:17 +00:00
|
|
|
{ NM_IP4_CONFIG_WINS_SERVERS, &priv->wins, demarshal_ip4_array },
|
2008-03-24 15:17:30 +00:00
|
|
|
{ NULL },
|
|
|
|
};
|
|
|
|
|
2012-01-20 12:52:17 +00:00
|
|
|
_nm_object_register_properties (NM_OBJECT (config),
|
|
|
|
priv->proxy,
|
|
|
|
property_info);
|
2008-03-24 15:17:30 +00:00
|
|
|
}
|
|
|
|
|
2011-12-20 20:15:42 +00:00
|
|
|
static void
|
|
|
|
constructed (GObject *object)
|
2008-03-24 15:17:30 +00:00
|
|
|
{
|
2013-03-01 21:58:31 +00:00
|
|
|
NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object);
|
2008-03-24 15:17:30 +00:00
|
|
|
|
2011-12-20 20:15:42 +00:00
|
|
|
G_OBJECT_CLASS (nm_ip4_config_parent_class)->constructed (object);
|
2008-03-24 15:17:30 +00:00
|
|
|
|
2013-03-01 21:58:31 +00:00
|
|
|
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_IP4_CONFIG);
|
2012-01-20 12:52:17 +00:00
|
|
|
register_properties (NM_IP4_CONFIG (object));
|
2008-03-24 15:17:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
finalize (GObject *object)
|
|
|
|
{
|
|
|
|
NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object);
|
|
|
|
|
2013-09-06 09:56:41 +00:00
|
|
|
g_free (priv->gateway);
|
|
|
|
|
2013-10-18 14:07:26 +00:00
|
|
|
g_slist_free_full (priv->addresses, (GDestroyNotify) nm_ip4_address_unref);
|
|
|
|
g_slist_free_full (priv->routes, (GDestroyNotify) nm_ip4_route_unref);
|
2008-08-06 22:23:48 +00:00
|
|
|
|
2008-03-24 15:17:30 +00:00
|
|
|
if (priv->nameservers)
|
|
|
|
g_array_free (priv->nameservers, TRUE);
|
|
|
|
|
2008-12-19 22:01:06 +00:00
|
|
|
if (priv->wins)
|
|
|
|
g_array_free (priv->wins, TRUE);
|
|
|
|
|
2008-03-24 15:17:30 +00:00
|
|
|
if (priv->domains) {
|
2013-10-18 14:07:26 +00:00
|
|
|
g_ptr_array_set_free_func (priv->domains, g_free);
|
2008-03-24 15:17:30 +00:00
|
|
|
g_ptr_array_free (priv->domains, TRUE);
|
|
|
|
}
|
|
|
|
|
2013-09-06 09:56:41 +00:00
|
|
|
if (priv->searches) {
|
2013-10-18 14:07:26 +00:00
|
|
|
g_ptr_array_set_free_func (priv->searches, g_free);
|
2013-09-06 09:56:41 +00:00
|
|
|
g_ptr_array_free (priv->searches, TRUE);
|
|
|
|
}
|
|
|
|
|
2008-09-05 15:10:52 +00:00
|
|
|
g_object_unref (priv->proxy);
|
|
|
|
|
2008-03-24 15:17:30 +00:00
|
|
|
G_OBJECT_CLASS (nm_ip4_config_parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
get_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
NMIP4Config *self = NM_IP4_CONFIG (object);
|
2008-05-06 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c
- (nm_dhcp_manager_get_ip4_config): clean up; update for changes to
NMIP4Config to support multiple IP addresses
* src/NetworkManagerUtils.c
- (nm_utils_merge_ip4_config): update for multiple IP addresses
* src/nm-ip4-config.c
src/nm-ip4-config.h
- Store a list of IPv4 address/netmask/gateway tuples
- (nm_ip4_config_get_gateway, nm_ip4_config_set_gateway,
nm_ip4_config_get_netmask, nm_ip4_config_set_netmask,
nm_ip4_config_get_broadcast, nm_ip4_config_set_broadcast,
nm_ip4_config_set_address): remove
- (nm_ip4_config_take_address, nm_ip4_config_add_address,
nm_ip4_config_replace_address, nm_ip4_config_get_num_addresses):
new functions; handle multiple IPv4 addresses
* src/nm-device.c
src/ppp-manager/nm-ppp-manager.c
src/vpn-manager/nm-vpn-connection.c
src/NetworkManagerPolicy.c
test/nm-tool.c
libnm-glib/libnm-glib-test.c
- update for changes to NMIP4Config for multiple IPv4 addresses
* src/NetworkManagerSystem.c
- (nm_system_device_set_ip4_route): don't add the route if any address
is on the same subnet as the destination
- (check_one_address): ignore the exact match, just match family and
interface index
- (add_ip4_addresses): add all IPv4 addresses in an NMIP4Config to
an interface
- (nm_system_device_set_from_ip4_config): use add_ip4_addresses()
- (nm_system_vpn_device_set_from_ip4_config): use add_ip4_addresses()
* introspection/nm-ip4-config.xml
- Remove 'address', 'gateway', 'netmask', and 'broadcast' properties
- Add 'addresses' property which is an array of (uuu) tuples of
address/netmask/gateway
* libnm-util/nm-setting-ip4-config.c
- (set_property): use ip-address <-> GValue converters from nm-utils.c
* libnm-glib/nm-ip4-config.c
libnm-glib/nm-ip4-config.h
- Handle D-Bus interface changes to support multiple IP addresses
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3637 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-06 21:53:22 +00:00
|
|
|
NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (self);
|
2008-03-24 15:17:30 +00:00
|
|
|
|
2012-03-28 13:06:12 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (object));
|
|
|
|
|
2008-03-24 15:17:30 +00:00
|
|
|
switch (prop_id) {
|
2013-09-06 09:56:41 +00:00
|
|
|
case PROP_GATEWAY:
|
|
|
|
g_value_set_string (value, nm_ip4_config_get_gateway (self));
|
|
|
|
break;
|
2008-05-06 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c
- (nm_dhcp_manager_get_ip4_config): clean up; update for changes to
NMIP4Config to support multiple IP addresses
* src/NetworkManagerUtils.c
- (nm_utils_merge_ip4_config): update for multiple IP addresses
* src/nm-ip4-config.c
src/nm-ip4-config.h
- Store a list of IPv4 address/netmask/gateway tuples
- (nm_ip4_config_get_gateway, nm_ip4_config_set_gateway,
nm_ip4_config_get_netmask, nm_ip4_config_set_netmask,
nm_ip4_config_get_broadcast, nm_ip4_config_set_broadcast,
nm_ip4_config_set_address): remove
- (nm_ip4_config_take_address, nm_ip4_config_add_address,
nm_ip4_config_replace_address, nm_ip4_config_get_num_addresses):
new functions; handle multiple IPv4 addresses
* src/nm-device.c
src/ppp-manager/nm-ppp-manager.c
src/vpn-manager/nm-vpn-connection.c
src/NetworkManagerPolicy.c
test/nm-tool.c
libnm-glib/libnm-glib-test.c
- update for changes to NMIP4Config for multiple IPv4 addresses
* src/NetworkManagerSystem.c
- (nm_system_device_set_ip4_route): don't add the route if any address
is on the same subnet as the destination
- (check_one_address): ignore the exact match, just match family and
interface index
- (add_ip4_addresses): add all IPv4 addresses in an NMIP4Config to
an interface
- (nm_system_device_set_from_ip4_config): use add_ip4_addresses()
- (nm_system_vpn_device_set_from_ip4_config): use add_ip4_addresses()
* introspection/nm-ip4-config.xml
- Remove 'address', 'gateway', 'netmask', and 'broadcast' properties
- Add 'addresses' property which is an array of (uuu) tuples of
address/netmask/gateway
* libnm-util/nm-setting-ip4-config.c
- (set_property): use ip-address <-> GValue converters from nm-utils.c
* libnm-glib/nm-ip4-config.c
libnm-glib/nm-ip4-config.h
- Handle D-Bus interface changes to support multiple IP addresses
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3637 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-06 21:53:22 +00:00
|
|
|
case PROP_ADDRESSES:
|
|
|
|
nm_utils_ip4_addresses_to_gvalue (priv->addresses, value);
|
2008-03-24 15:17:30 +00:00
|
|
|
break;
|
2013-09-06 09:56:41 +00:00
|
|
|
case PROP_ROUTES:
|
|
|
|
nm_utils_ip4_routes_to_gvalue (priv->routes, value);
|
|
|
|
break;
|
2008-03-24 15:17:30 +00:00
|
|
|
case PROP_NAMESERVERS:
|
|
|
|
g_value_set_boxed (value, nm_ip4_config_get_nameservers (self));
|
|
|
|
break;
|
|
|
|
case PROP_DOMAINS:
|
|
|
|
g_value_set_boxed (value, nm_ip4_config_get_domains (self));
|
|
|
|
break;
|
2013-09-06 09:56:41 +00:00
|
|
|
case PROP_SEARCHES:
|
|
|
|
g_value_set_boxed (value, nm_ip4_config_get_searches (self));
|
2008-08-06 22:23:48 +00:00
|
|
|
break;
|
2008-12-19 22:01:06 +00:00
|
|
|
case PROP_WINS_SERVERS:
|
|
|
|
g_value_set_boxed (value, nm_ip4_config_get_wins_servers (self));
|
|
|
|
break;
|
2008-03-24 15:17:30 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-02-16 11:23:49 +00:00
|
|
|
static void
|
|
|
|
nm_ip4_config_class_init (NMIP4ConfigClass *config_class)
|
|
|
|
{
|
2008-03-24 15:17:30 +00:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (config_class);
|
|
|
|
|
|
|
|
g_type_class_add_private (config_class, sizeof (NMIP4ConfigPrivate));
|
|
|
|
|
|
|
|
/* virtual methods */
|
2011-12-20 20:15:42 +00:00
|
|
|
object_class->constructed = constructed;
|
2008-03-24 15:17:30 +00:00
|
|
|
object_class->get_property = get_property;
|
|
|
|
object_class->finalize = finalize;
|
|
|
|
|
|
|
|
/* properties */
|
2008-08-12 12:59:33 +00:00
|
|
|
|
2013-09-06 09:56:41 +00:00
|
|
|
/**
|
|
|
|
* NMIP4Config:gateway:
|
|
|
|
*
|
|
|
|
* The IP4 gateway address of the configuration as string.
|
|
|
|
*
|
|
|
|
* Since: 0.9.10
|
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_GATEWAY,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_string (NM_IP4_CONFIG_GATEWAY, "", "",
|
2013-09-06 09:56:41 +00:00
|
|
|
NULL,
|
2014-06-09 20:17:37 +00:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2013-09-06 09:56:41 +00:00
|
|
|
|
2008-08-12 12:59:33 +00:00
|
|
|
/**
|
|
|
|
* NMIP4Config:addresses:
|
|
|
|
*
|
2013-10-11 14:12:44 +00:00
|
|
|
* The #GPtrArray containing #NMIP4Address<!-- -->es of the configuration.
|
2008-08-12 12:59:33 +00:00
|
|
|
**/
|
2008-03-24 15:17:30 +00:00
|
|
|
g_object_class_install_property
|
2013-09-21 17:57:09 +00:00
|
|
|
(object_class, PROP_ADDRESSES,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_pointer (NM_IP4_CONFIG_ADDRESSES, "", "",
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2008-03-24 15:17:30 +00:00
|
|
|
|
2013-09-06 09:56:41 +00:00
|
|
|
/**
|
|
|
|
* NMIP4Config:routes:
|
|
|
|
*
|
2013-10-11 14:12:44 +00:00
|
|
|
* The #GPtrArray containing #NMSettingIP4Routes of the configuration.
|
2013-09-06 09:56:41 +00:00
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_ROUTES,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_pointer (NM_IP4_CONFIG_ROUTES, "", "",
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2013-09-06 09:56:41 +00:00
|
|
|
|
2008-08-12 12:59:33 +00:00
|
|
|
/**
|
|
|
|
* NMIP4Config:nameservers:
|
|
|
|
*
|
2013-10-11 14:12:44 +00:00
|
|
|
* The #GArray containing name servers (#guint32s) of the configuration.
|
2008-08-12 12:59:33 +00:00
|
|
|
**/
|
2008-03-24 15:17:30 +00:00
|
|
|
g_object_class_install_property
|
2013-09-21 17:57:09 +00:00
|
|
|
(object_class, PROP_NAMESERVERS,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_boxed (NM_IP4_CONFIG_NAMESERVERS, "", "",
|
2013-09-21 17:57:09 +00:00
|
|
|
NM_TYPE_UINT_ARRAY,
|
2014-06-09 20:17:37 +00:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2008-03-24 15:17:30 +00:00
|
|
|
|
2008-08-12 12:59:33 +00:00
|
|
|
/**
|
|
|
|
* NMIP4Config:domains:
|
|
|
|
*
|
|
|
|
* The #GPtrArray containing domain strings of the configuration.
|
|
|
|
**/
|
2008-03-24 15:17:30 +00:00
|
|
|
g_object_class_install_property
|
2013-09-21 17:57:09 +00:00
|
|
|
(object_class, PROP_DOMAINS,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_boxed (NM_IP4_CONFIG_DOMAINS, "", "",
|
2013-09-21 17:57:09 +00:00
|
|
|
NM_TYPE_STRING_ARRAY,
|
2014-06-09 20:17:37 +00:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2008-03-24 15:17:30 +00:00
|
|
|
|
2008-08-12 12:59:33 +00:00
|
|
|
/**
|
2013-09-06 09:56:41 +00:00
|
|
|
* NMIP4Config:searches:
|
2008-08-12 12:59:33 +00:00
|
|
|
*
|
2013-09-06 09:56:41 +00:00
|
|
|
* The #GPtrArray containing dns search strings of the configuration.
|
|
|
|
*
|
|
|
|
* Since: 0.9.10
|
2008-08-12 12:59:33 +00:00
|
|
|
**/
|
2008-08-06 22:23:48 +00:00
|
|
|
g_object_class_install_property
|
2013-09-06 09:56:41 +00:00
|
|
|
(object_class, PROP_SEARCHES,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_boxed (NM_IP4_CONFIG_SEARCHES, "", "",
|
2013-09-06 09:56:41 +00:00
|
|
|
NM_TYPE_STRING_ARRAY,
|
2014-06-09 20:17:37 +00:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2008-12-19 22:01:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* NMIP4Config:wins-servers:
|
|
|
|
*
|
2013-10-11 14:12:44 +00:00
|
|
|
* The #GArray containing WINS servers (#guint32s) of the configuration.
|
2008-12-19 22:01:06 +00:00
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
2013-09-21 17:57:09 +00:00
|
|
|
(object_class, PROP_WINS_SERVERS,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_boxed (NM_IP4_CONFIG_WINS_SERVERS, "", "",
|
2013-09-21 17:57:09 +00:00
|
|
|
NM_TYPE_UINT_ARRAY,
|
2014-06-09 20:17:37 +00:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2007-02-16 11:23:49 +00:00
|
|
|
}
|
|
|
|
|
2008-08-12 12:59:33 +00:00
|
|
|
/**
|
|
|
|
* nm_ip4_config_new:
|
|
|
|
* @connection: the #DBusGConnection
|
|
|
|
* @object_path: the DBus object path of the device
|
|
|
|
*
|
|
|
|
* Creates a new #NMIP4Config.
|
|
|
|
*
|
2011-03-10 18:35:43 +00:00
|
|
|
* Returns: (transfer full): a new IP4 configuration
|
2008-08-12 12:59:33 +00:00
|
|
|
**/
|
2008-03-24 15:17:30 +00:00
|
|
|
GObject *
|
2007-02-16 11:23:49 +00:00
|
|
|
nm_ip4_config_new (DBusGConnection *connection, const char *object_path)
|
|
|
|
{
|
2017-02-14 12:43:37 +00:00
|
|
|
g_return_val_if_fail (connection != NULL, NULL);
|
|
|
|
g_return_val_if_fail (object_path != NULL, NULL);
|
|
|
|
|
2008-03-24 15:17:30 +00:00
|
|
|
return (GObject *) g_object_new (NM_TYPE_IP4_CONFIG,
|
2013-09-21 17:57:09 +00:00
|
|
|
NM_OBJECT_DBUS_CONNECTION, connection,
|
|
|
|
NM_OBJECT_DBUS_PATH, object_path,
|
|
|
|
NULL);
|
2007-02-16 11:23:49 +00:00
|
|
|
}
|
|
|
|
|
2013-09-06 09:56:41 +00:00
|
|
|
/**
|
|
|
|
* nm_ip4_config_get_gateway:
|
|
|
|
* @config: a #NMIP4Config
|
|
|
|
*
|
|
|
|
* Gets the IP4 gateway address.
|
|
|
|
*
|
|
|
|
* Returns: the IP4 address of the gateway.
|
|
|
|
*
|
|
|
|
* Since: 0.9.10
|
|
|
|
**/
|
|
|
|
const char *
|
|
|
|
nm_ip4_config_get_gateway (NMIP4Config *config)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL);
|
|
|
|
|
|
|
|
_nm_object_ensure_inited (NM_OBJECT (config));
|
|
|
|
return NM_IP4_CONFIG_GET_PRIVATE (config)->gateway;
|
|
|
|
}
|
|
|
|
|
2008-08-12 12:59:33 +00:00
|
|
|
/**
|
|
|
|
* nm_ip4_config_get_addresses:
|
|
|
|
* @config: a #NMIP4Config
|
|
|
|
*
|
|
|
|
* Gets the IP4 addresses (containing the address, prefix, and gateway).
|
|
|
|
*
|
2014-07-07 18:09:04 +00:00
|
|
|
* Returns: (element-type NMIP4Address): the #GSList containing #NMIP4Address<!-- -->es.
|
2011-01-21 20:46:09 +00:00
|
|
|
* This is the internal copy used by the configuration and must not be modified.
|
2008-08-12 12:59:33 +00:00
|
|
|
**/
|
2008-05-06 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c
- (nm_dhcp_manager_get_ip4_config): clean up; update for changes to
NMIP4Config to support multiple IP addresses
* src/NetworkManagerUtils.c
- (nm_utils_merge_ip4_config): update for multiple IP addresses
* src/nm-ip4-config.c
src/nm-ip4-config.h
- Store a list of IPv4 address/netmask/gateway tuples
- (nm_ip4_config_get_gateway, nm_ip4_config_set_gateway,
nm_ip4_config_get_netmask, nm_ip4_config_set_netmask,
nm_ip4_config_get_broadcast, nm_ip4_config_set_broadcast,
nm_ip4_config_set_address): remove
- (nm_ip4_config_take_address, nm_ip4_config_add_address,
nm_ip4_config_replace_address, nm_ip4_config_get_num_addresses):
new functions; handle multiple IPv4 addresses
* src/nm-device.c
src/ppp-manager/nm-ppp-manager.c
src/vpn-manager/nm-vpn-connection.c
src/NetworkManagerPolicy.c
test/nm-tool.c
libnm-glib/libnm-glib-test.c
- update for changes to NMIP4Config for multiple IPv4 addresses
* src/NetworkManagerSystem.c
- (nm_system_device_set_ip4_route): don't add the route if any address
is on the same subnet as the destination
- (check_one_address): ignore the exact match, just match family and
interface index
- (add_ip4_addresses): add all IPv4 addresses in an NMIP4Config to
an interface
- (nm_system_device_set_from_ip4_config): use add_ip4_addresses()
- (nm_system_vpn_device_set_from_ip4_config): use add_ip4_addresses()
* introspection/nm-ip4-config.xml
- Remove 'address', 'gateway', 'netmask', and 'broadcast' properties
- Add 'addresses' property which is an array of (uuu) tuples of
address/netmask/gateway
* libnm-util/nm-setting-ip4-config.c
- (set_property): use ip-address <-> GValue converters from nm-utils.c
* libnm-glib/nm-ip4-config.c
libnm-glib/nm-ip4-config.h
- Handle D-Bus interface changes to support multiple IP addresses
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3637 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-06 21:53:22 +00:00
|
|
|
const GSList *
|
|
|
|
nm_ip4_config_get_addresses (NMIP4Config *config)
|
2007-02-16 11:23:49 +00:00
|
|
|
{
|
2011-03-14 06:05:51 +00:00
|
|
|
g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL);
|
2007-02-16 11:23:49 +00:00
|
|
|
|
2012-01-19 23:23:28 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (config));
|
|
|
|
return NM_IP4_CONFIG_GET_PRIVATE (config)->addresses;
|
2007-02-16 11:23:49 +00:00
|
|
|
}
|
|
|
|
|
2008-08-12 12:59:33 +00:00
|
|
|
/**
|
|
|
|
* nm_ip4_config_get_nameservers:
|
|
|
|
* @config: a #NMIP4Config
|
|
|
|
*
|
|
|
|
* Gets the domain name servers (DNS).
|
|
|
|
*
|
2013-10-11 14:12:44 +00:00
|
|
|
* Returns: (element-type guint32): the #GArray containing #guint32s.
|
|
|
|
* This is the internal copy used by the configuration and must not be
|
|
|
|
* modified.
|
2008-08-12 12:59:33 +00:00
|
|
|
**/
|
2008-03-24 15:17:30 +00:00
|
|
|
const GArray *
|
2007-02-16 11:23:49 +00:00
|
|
|
nm_ip4_config_get_nameservers (NMIP4Config *config)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL);
|
|
|
|
|
2012-01-19 23:23:28 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (config));
|
|
|
|
return NM_IP4_CONFIG_GET_PRIVATE (config)->nameservers;
|
2007-02-16 11:23:49 +00:00
|
|
|
}
|
2008-12-19 22:01:06 +00:00
|
|
|
|
2008-08-12 12:59:33 +00:00
|
|
|
/**
|
|
|
|
* nm_ip4_config_get_domains:
|
|
|
|
* @config: a #NMIP4Config
|
|
|
|
*
|
|
|
|
* Gets the domain names.
|
|
|
|
*
|
2014-05-09 18:45:59 +00:00
|
|
|
* Returns: (element-type utf8): the #GPtrArray containing domains as strings. This is the
|
2008-08-12 12:59:33 +00:00
|
|
|
* internal copy used by the configuration, and must not be modified.
|
|
|
|
**/
|
2008-03-24 15:17:30 +00:00
|
|
|
const GPtrArray *
|
2007-02-16 11:23:49 +00:00
|
|
|
nm_ip4_config_get_domains (NMIP4Config *config)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL);
|
|
|
|
|
2012-01-19 23:23:28 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (config));
|
|
|
|
return handle_ptr_array_return (NM_IP4_CONFIG_GET_PRIVATE (config)->domains);
|
2007-02-16 11:23:49 +00:00
|
|
|
}
|
2013-09-06 09:56:41 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* nm_ip4_config_get_searches:
|
|
|
|
* @config: a #NMIP4Config
|
|
|
|
*
|
|
|
|
* Gets the dns searches.
|
|
|
|
*
|
|
|
|
* Returns: (element-type utf8): the #GPtrArray containing dns searches as strings. This is the
|
|
|
|
* internal copy used by the configuration, and must not be modified.
|
|
|
|
*
|
|
|
|
* Since: 0.9.10
|
|
|
|
**/
|
|
|
|
const GPtrArray *
|
|
|
|
nm_ip4_config_get_searches (NMIP4Config *config)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL);
|
|
|
|
|
|
|
|
_nm_object_ensure_inited (NM_OBJECT (config));
|
|
|
|
return handle_ptr_array_return (NM_IP4_CONFIG_GET_PRIVATE (config)->searches);
|
|
|
|
}
|
2007-02-16 11:23:49 +00:00
|
|
|
|
2008-12-19 22:01:06 +00:00
|
|
|
/**
|
|
|
|
* nm_ip4_config_get_wins_servers:
|
|
|
|
* @config: a #NMIP4Config
|
|
|
|
*
|
|
|
|
* Gets the Windows Internet Name Service servers (WINS).
|
|
|
|
*
|
2013-10-11 14:12:44 +00:00
|
|
|
* Returns: (element-type guint32): the #GArray containing #guint32s.
|
|
|
|
* This is the internal copy used by the configuration and must not be
|
|
|
|
* modified.
|
2008-12-19 22:01:06 +00:00
|
|
|
**/
|
|
|
|
const GArray *
|
|
|
|
nm_ip4_config_get_wins_servers (NMIP4Config *config)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL);
|
|
|
|
|
2012-01-19 23:23:28 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (config));
|
|
|
|
return NM_IP4_CONFIG_GET_PRIVATE (config)->wins;
|
2008-12-19 22:01:06 +00:00
|
|
|
}
|
|
|
|
|
2008-08-12 12:59:33 +00:00
|
|
|
/**
|
|
|
|
* nm_ip4_config_get_routes:
|
|
|
|
* @config: a #NMIP4Config
|
|
|
|
*
|
|
|
|
* Gets the routes.
|
|
|
|
*
|
2014-07-07 18:09:04 +00:00
|
|
|
* Returns: (element-type NMIP4Route): the #GSList containing
|
2013-10-11 14:12:44 +00:00
|
|
|
* #NMIP4Routes. This is the internal copy used by the configuration,
|
2011-01-21 20:46:09 +00:00
|
|
|
* and must not be modified.
|
2008-08-12 12:59:33 +00:00
|
|
|
**/
|
2008-08-06 22:23:48 +00:00
|
|
|
const GSList *
|
|
|
|
nm_ip4_config_get_routes (NMIP4Config *config)
|
|
|
|
{
|
2011-03-14 06:05:51 +00:00
|
|
|
g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL);
|
2008-08-06 22:23:48 +00:00
|
|
|
|
2012-01-19 23:23:28 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (config));
|
|
|
|
return NM_IP4_CONFIG_GET_PRIVATE (config)->routes;
|
2008-08-06 22:23:48 +00:00
|
|
|
}
|