• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ NM_IP4_CONFIG_GET_PRIVATE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中NM_IP4_CONFIG_GET_PRIVATE函数的典型用法代码示例。如果您正苦于以下问题:C++ NM_IP4_CONFIG_GET_PRIVATE函数的具体用法?C++ NM_IP4_CONFIG_GET_PRIVATE怎么用?C++ NM_IP4_CONFIG_GET_PRIVATE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了NM_IP4_CONFIG_GET_PRIVATE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: nm_ip4_config_diff

NMIP4ConfigCompareFlags
nm_ip4_config_diff (NMIP4Config *a, NMIP4Config *b)
{
	NMIP4ConfigPrivate *a_priv;
	NMIP4ConfigPrivate *b_priv;
	NMIP4ConfigCompareFlags flags = NM_IP4_COMPARE_FLAG_NONE;

	if ((a && !b) || (b && !a))
		return 0xFFFFFFFF;
	if (!a && !b)
		return NM_IP4_COMPARE_FLAG_NONE;

	a_priv = NM_IP4_CONFIG_GET_PRIVATE (a);
	b_priv = NM_IP4_CONFIG_GET_PRIVATE (b);

	if (   !addr_slist_compare (a_priv->addresses, b_priv->addresses)
	    || !addr_slist_compare (b_priv->addresses, a_priv->addresses))
		flags |= NM_IP4_COMPARE_FLAG_ADDRESSES;

	if (a_priv->ptp_address != b_priv->ptp_address)
		flags |= NM_IP4_COMPARE_FLAG_PTP_ADDRESS;

	if (   (a_priv->nameservers->len != b_priv->nameservers->len)
	    || !addr_array_compare (a_priv->nameservers, b_priv->nameservers)
	    || !addr_array_compare (b_priv->nameservers, a_priv->nameservers))
		flags |= NM_IP4_COMPARE_FLAG_NAMESERVERS;

	if (   (a_priv->wins->len != b_priv->wins->len)
	    || !addr_array_compare (a_priv->wins, b_priv->wins)
	    || !addr_array_compare (b_priv->wins, a_priv->wins))
		flags |= NM_IP4_COMPARE_FLAG_WINS_SERVERS;

	if (   !route_slist_compare (a_priv->routes, b_priv->routes)
	    || !route_slist_compare (b_priv->routes, a_priv->routes))
		flags |= NM_IP4_COMPARE_FLAG_ROUTES;

	if (   (a_priv->domains->len != b_priv->domains->len)
	    || !string_array_compare (a_priv->domains, b_priv->domains)
	    || !string_array_compare (b_priv->domains, a_priv->domains))
		flags |= NM_IP4_COMPARE_FLAG_DOMAINS;

	if (   (a_priv->searches->len != b_priv->searches->len)
	    || !string_array_compare (a_priv->searches, b_priv->searches)
	    || !string_array_compare (b_priv->searches, a_priv->searches))
		flags |= NM_IP4_COMPARE_FLAG_SEARCHES;

	if (a_priv->mtu != b_priv->mtu)
		flags |= NM_IP4_COMPARE_FLAG_MTU;

	if (a_priv->mss != b_priv->mss)
		flags |= NM_IP4_COMPARE_FLAG_MSS;

	return flags;
}
开发者ID:wsowa,项目名称:NetworkManager-gsoc2009,代码行数:54,代码来源:nm-ip4-config.c


示例2: get_property

static void
get_property (GObject *object, guint prop_id,
              GValue *value, GParamSpec *pspec)
{
    NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object);

    switch (prop_id) {
    case PROP_ADDRESSES:
        nm_utils_ip4_addresses_to_gvalue (priv->addresses, value);
        break;
    case PROP_NAMESERVERS:
        g_value_set_boxed (value, priv->nameservers);
        break;
    case PROP_DOMAINS:
        g_value_set_boxed (value, priv->domains);
        break;
    case PROP_ROUTES:
        nm_utils_ip4_routes_to_gvalue (priv->routes, value);
        break;
    case PROP_WINS_SERVERS:
        g_value_set_boxed (value, priv->wins);
        break;
    default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
        break;
    }
}
开发者ID:eugeni,项目名称:NetworkManager-mdv,代码行数:27,代码来源:nm-ip4-config.c


示例3: finalize

static void
finalize (GObject *object)
{
	NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object);

	g_free (priv->gateway);

	g_slist_free_full (priv->addresses, (GDestroyNotify) nm_ip4_address_unref);
	g_slist_free_full (priv->routes, (GDestroyNotify) nm_ip4_route_unref);

	if (priv->nameservers)
		g_array_free (priv->nameservers, TRUE);

	if (priv->wins)
		g_array_free (priv->wins, TRUE);

	if (priv->domains) {
		g_ptr_array_set_free_func (priv->domains, g_free);
		g_ptr_array_free (priv->domains, TRUE);
	}

	if (priv->searches) {
		g_ptr_array_set_free_func (priv->searches, g_free);
		g_ptr_array_free (priv->searches, TRUE);
	}

	g_object_unref (priv->proxy);

	G_OBJECT_CLASS (nm_ip4_config_parent_class)->finalize (object);
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:30,代码来源:nm-ip4-config.c


示例4: nm_ip4_config_get_dbus_path

const char *
nm_ip4_config_get_dbus_path (NMIP4Config *config)
{
    g_return_val_if_fail (NM_IS_IP4_CONFIG (config), FALSE);

    return NM_IP4_CONFIG_GET_PRIVATE (config)->path;
}
开发者ID:eugeni,项目名称:NetworkManager-mdv,代码行数:7,代码来源:nm-ip4-config.c


示例5: nm_ip4_config_get_routes

/**
 * nm_ip4_config_get_routes:
 * @config: a #NMIP4Config
 *
 * Gets the routes.
 *
 * Returns: (element-type NetworkManager.IP4Route): the #GSList containing
 * #NMIP4Route<!-- -->s. This is the internal copy used by the configuration,
 * and must not be modified.
 **/
const GSList *
nm_ip4_config_get_routes (NMIP4Config *config)
{
	NMIP4ConfigPrivate *priv;
	GValue value = { 0, };

	g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL);

	priv = NM_IP4_CONFIG_GET_PRIVATE (config);
	if (priv->routes)
		return priv->routes;

	if (!_nm_object_get_property (NM_OBJECT (config),
	                              NM_DBUS_INTERFACE_IP4_CONFIG,
	                              "Routes",
	                              &value,
	                              NULL)) {
		return NULL;
	}

	demarshal_ip4_routes_array (NM_OBJECT (config), NULL, &value, &priv->routes);
	g_value_unset (&value);

	return priv->routes;
}
开发者ID:alfmatos,项目名称:NetworkManager,代码行数:35,代码来源:nm-ip4-config.c


示例6: nm_ip4_config_get_domains

/**
 * nm_ip4_config_get_domains:
 * @config: a #NMIP4Config
 *
 * Gets the domain names.
 *
 * Returns: (element-type utf8): the #GPtrArray containing domains as strings. This is the 
 * internal copy used by the configuration, and must not be modified.
 **/
const GPtrArray *
nm_ip4_config_get_domains (NMIP4Config *config)
{
	NMIP4ConfigPrivate *priv;
	GValue value = {0,};

	g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL);

	priv = NM_IP4_CONFIG_GET_PRIVATE (config);
	if (priv->domains)
		return handle_ptr_array_return (priv->domains);

	if (_nm_object_get_property (NM_OBJECT (config),
	                             NM_DBUS_INTERFACE_IP4_CONFIG,
	                             "Domains",
	                             &value,
	                             NULL)) {
		char **array = NULL, **p;

		array = (char **) g_value_get_boxed (&value);
		if (array && g_strv_length (array)) {
			priv->domains = g_ptr_array_sized_new (g_strv_length (array));
			for (p = array; *p; p++)
				g_ptr_array_add (priv->domains, g_strdup (*p));
		}
		g_value_unset (&value);
	}

	return handle_ptr_array_return (priv->domains);
}
开发者ID:alfmatos,项目名称:NetworkManager,代码行数:39,代码来源:nm-ip4-config.c


示例7: nm_ip4_config_get_route

NMIP4Route *
nm_ip4_config_get_route (NMIP4Config *config, guint i)
{
    g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL);

    return (NMIP4Route *) g_slist_nth_data (NM_IP4_CONFIG_GET_PRIVATE (config)->routes, i);
}
开发者ID:eugeni,项目名称:NetworkManager-mdv,代码行数:7,代码来源:nm-ip4-config.c


示例8: nm_ip4_config_get_never_default

gboolean
nm_ip4_config_get_never_default (NMIP4Config *config)
{
    g_return_val_if_fail (NM_IS_IP4_CONFIG (config), FALSE);

    return NM_IP4_CONFIG_GET_PRIVATE (config)->never_default;
}
开发者ID:eugeni,项目名称:NetworkManager-mdv,代码行数:7,代码来源:nm-ip4-config.c


示例9: nm_ip4_config_set_never_default

void
nm_ip4_config_set_never_default (NMIP4Config *config, gboolean never_default)
{
    g_return_if_fail (NM_IS_IP4_CONFIG (config));

    NM_IP4_CONFIG_GET_PRIVATE (config)->never_default = never_default;
}
开发者ID:eugeni,项目名称:NetworkManager-mdv,代码行数:7,代码来源:nm-ip4-config.c


示例10: nm_ip4_config_get_wins_servers

/**
 * nm_ip4_config_get_wins_servers:
 * @config: a #NMIP4Config
 *
 * Gets the Windows Internet Name Service servers (WINS).
 *
 * Returns: (element-type guint32): the #GArray containing %guint32<!-- -->s.
 * This is the internal copy used by the configuration and must not be modified.
 **/
const GArray *
nm_ip4_config_get_wins_servers (NMIP4Config *config)
{
	NMIP4ConfigPrivate *priv;
	GArray *array = NULL;
	GValue value = {0,};

	g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL);

	priv = NM_IP4_CONFIG_GET_PRIVATE (config);
	if (!priv->wins) {
		if (_nm_object_get_property (NM_OBJECT (config),
		                             NM_DBUS_INTERFACE_IP4_CONFIG,
		                             "WinsServers",
		                             &value,
		                             NULL)) {
			array = (GArray *) g_value_get_boxed (&value);
			if (array && array->len) {
				priv->wins = g_array_sized_new (FALSE, TRUE, sizeof (guint32), array->len);
				g_array_append_vals (priv->wins, array->data, array->len);
			}
			g_value_unset (&value);
		}
	}

	return priv->wins;
}
开发者ID:alfmatos,项目名称:NetworkManager,代码行数:36,代码来源:nm-ip4-config.c


示例11: finalize

static void
finalize (GObject *object)
{
	NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object);

	g_slist_foreach (priv->addresses, (GFunc) g_free, NULL);
	g_slist_free (priv->addresses);

	g_slist_foreach (priv->routes, (GFunc) g_free, NULL);
	g_slist_free (priv->routes);

	if (priv->nameservers)
		g_array_free (priv->nameservers, TRUE);

	if (priv->wins)
		g_array_free (priv->wins, TRUE);

	if (priv->domains) {
		g_ptr_array_foreach (priv->domains, (GFunc) g_free, NULL);
		g_ptr_array_free (priv->domains, TRUE);
	}

	g_object_unref (priv->proxy);

	G_OBJECT_CLASS (nm_ip4_config_parent_class)->finalize (object);
}
开发者ID:alfmatos,项目名称:NetworkManager,代码行数:26,代码来源:nm-ip4-config.c


示例12: constructor

static GObject*
constructor (GType type,
		   guint n_construct_params,
		   GObjectConstructParam *construct_params)
{
	NMObject *object;
	DBusGConnection *connection;
	NMIP4ConfigPrivate *priv;

	object = (NMObject *) G_OBJECT_CLASS (nm_ip4_config_parent_class)->constructor (type,
																 n_construct_params,
																 construct_params);
	if (!object)
		return NULL;

	priv = NM_IP4_CONFIG_GET_PRIVATE (object);
	connection = nm_object_get_connection (object);

	priv->proxy = dbus_g_proxy_new_for_name (connection,
										   NM_DBUS_SERVICE,
										   nm_object_get_path (object),
										   NM_DBUS_INTERFACE_IP4_CONFIG);

	register_for_property_changed (NM_IP4_CONFIG (object));

	return G_OBJECT (object);
}
开发者ID:alfmatos,项目名称:NetworkManager,代码行数:27,代码来源:nm-ip4-config.c


示例13: nm_ip4_config_get_nis_domain

const char *
nm_ip4_config_get_nis_domain (NMIP4Config *config)
{
    g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0);

    return NM_IP4_CONFIG_GET_PRIVATE (config)->nis_domain;
}
开发者ID:eugeni,项目名称:NetworkManager-mdv,代码行数:7,代码来源:nm-ip4-config.c


示例14: nm_ip4_config_get_gateway

/**
 * 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;
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:18,代码来源:nm-ip4-config.c


示例15: nm_ip4_config_get_searches

/**
 * 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);
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:19,代码来源:nm-ip4-config.c


示例16: nm_ip4_config_get_routes

/**
 * nm_ip4_config_get_routes:
 * @config: a #NMIP4Config
 *
 * Gets the routes.
 *
 * Returns: (element-type NetworkManager.IP4Route): the #GSList containing
 * #NMIP4Routes. This is the internal copy used by the configuration,
 * and must not be modified.
 **/
const GSList *
nm_ip4_config_get_routes (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)->routes;
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:18,代码来源:nm-ip4-config.c


示例17: nm_ip4_config_get_wins_servers

/**
 * nm_ip4_config_get_wins_servers:
 * @config: a #NMIP4Config
 *
 * Gets the Windows Internet Name Service servers (WINS).
 *
 * Returns: (element-type guint32): the #GArray containing #guint32s.
 * This is the internal copy used by the configuration and must not be
 * modified.
 **/
const GArray *
nm_ip4_config_get_wins_servers (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)->wins;
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:18,代码来源:nm-ip4-config.c


示例18: constructed

static void
constructed (GObject *object)
{
	NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object);

	G_OBJECT_CLASS (nm_ip4_config_parent_class)->constructed (object);

	priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_IP4_CONFIG);
	register_properties (NM_IP4_CONFIG (object));
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:10,代码来源:nm-ip4-config.c


示例19: nm_ip4_config_init

static void
nm_ip4_config_init (NMIP4Config *config)
{
	NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (config);

	priv->nameservers = g_array_new (FALSE, TRUE, sizeof (guint32));
	priv->wins = g_array_new (FALSE, TRUE, sizeof (guint32));
	priv->domains = g_ptr_array_sized_new (3);
	priv->searches = g_ptr_array_sized_new (3);
}
开发者ID:wsowa,项目名称:NetworkManager-gsoc2009,代码行数:10,代码来源:nm-ip4-config.c


示例20: nm_ip4_config_reset_routes

void nm_ip4_config_reset_routes (NMIP4Config *config)
{
    NMIP4ConfigPrivate *priv;

    g_return_if_fail (NM_IS_IP4_CONFIG (config));

    priv = NM_IP4_CONFIG_GET_PRIVATE (config);
    g_slist_foreach (priv->routes, (GFunc) g_free, NULL);
    priv->routes = NULL;
}
开发者ID:eugeni,项目名称:NetworkManager-mdv,代码行数:10,代码来源:nm-ip4-config.c



注:本文中的NM_IP4_CONFIG_GET_PRIVATE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ NM_IS_AP函数代码示例发布时间:2022-05-30
下一篇:
C++ NM_DEVICE_WIMAX_GET_PRIVATE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap