本文整理汇总了C++中NM_SETTING_WIRELESS_GET_PRIVATE函数的典型用法代码示例。如果您正苦于以下问题:C++ NM_SETTING_WIRELESS_GET_PRIVATE函数的具体用法?C++ NM_SETTING_WIRELESS_GET_PRIVATE怎么用?C++ NM_SETTING_WIRELESS_GET_PRIVATE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NM_SETTING_WIRELESS_GET_PRIVATE函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: get_property
static void
get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
NMSettingWireless *setting = NM_SETTING_WIRELESS (object);
switch (prop_id) {
case PROP_SSID:
g_value_set_boxed (value, nm_setting_wireless_get_ssid (setting));
break;
case PROP_MODE:
g_value_set_string (value, nm_setting_wireless_get_mode (setting));
break;
case PROP_BAND:
g_value_set_string (value, nm_setting_wireless_get_band (setting));
break;
case PROP_CHANNEL:
g_value_set_uint (value, nm_setting_wireless_get_channel (setting));
break;
case PROP_BSSID:
g_value_set_boxed (value, nm_setting_wireless_get_bssid (setting));
break;
case PROP_RATE:
g_value_set_uint (value, nm_setting_wireless_get_rate (setting));
break;
case PROP_TX_POWER:
g_value_set_uint (value, nm_setting_wireless_get_tx_power (setting));
break;
case PROP_MAC_ADDRESS:
g_value_set_boxed (value, nm_setting_wireless_get_mac_address (setting));
break;
case PROP_CLONED_MAC_ADDRESS:
g_value_set_boxed (value, nm_setting_wireless_get_cloned_mac_address (setting));
break;
case PROP_MAC_ADDRESS_BLACKLIST:
g_value_set_boxed (value, nm_setting_wireless_get_mac_address_blacklist (setting));
break;
case PROP_MTU:
g_value_set_uint (value, nm_setting_wireless_get_mtu (setting));
break;
case PROP_SEEN_BSSIDS:
g_value_set_boxed (value, NM_SETTING_WIRELESS_GET_PRIVATE (setting)->seen_bssids);
break;
case PROP_SEC:
g_value_set_string (value, NM_SETTING_WIRELESS_GET_PRIVATE (setting)->security);
break;
case PROP_HIDDEN:
g_value_set_boolean (value, nm_setting_wireless_get_hidden (setting));
break;
case PROP_POWERSAVE:
g_value_set_uint (value, nm_setting_wireless_get_powersave (setting));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
开发者ID:GalliumOS,项目名称:network-manager,代码行数:57,代码来源:nm-setting-wireless.c
示例2: nm_setting_wireless_clear_mac_blacklist_items
/**
* nm_setting_wireless_clear_mac_blacklist_items:
* @setting: the #NMSettingWireless
*
* Removes all blacklisted MAC addresses.
*
* Since: 0.9.10
**/
void
nm_setting_wireless_clear_mac_blacklist_items (NMSettingWireless *setting)
{
g_return_if_fail (NM_IS_SETTING_WIRELESS (setting));
g_slist_free_full (NM_SETTING_WIRELESS_GET_PRIVATE (setting)->mac_address_blacklist, g_free);
NM_SETTING_WIRELESS_GET_PRIVATE (setting)->mac_address_blacklist = NULL;
g_object_notify (G_OBJECT (setting), NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST);
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:17,代码来源:nm-setting-wireless.c
示例3: nm_setting_wireless_add_seen_bssid
/**
* nm_setting_wireless_add_seen_bssid:
* @setting: the #NMSettingWireless
* @bssid: the new BSSID to add to the list
*
* Adds a new Wi-Fi AP's BSSID to the previously seen BSSID list of the setting.
* NetworkManager now tracks previously seen BSSIDs internally so this function
* no longer has much use. Actually, changes you make using this function will
* not be preserved.
*
* Returns: %TRUE if @bssid was already known, %FALSE if not
**/
gboolean
nm_setting_wireless_add_seen_bssid (NMSettingWireless *setting,
const char *bssid)
{
NMSettingWirelessPrivate *priv;
char *lower_bssid;
GSList *iter;
gboolean found = FALSE;
g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), FALSE);
g_return_val_if_fail (bssid != NULL, FALSE);
lower_bssid = g_ascii_strdown (bssid, -1);
if (!lower_bssid)
return FALSE;
priv = NM_SETTING_WIRELESS_GET_PRIVATE (setting);
for (iter = priv->seen_bssids; iter; iter = iter->next) {
if (!strcmp ((char *) iter->data, lower_bssid)) {
found = TRUE;
break;
}
}
if (!found) {
priv->seen_bssids = g_slist_prepend (priv->seen_bssids, lower_bssid);
g_object_notify (G_OBJECT (setting), NM_SETTING_WIRELESS_SEEN_BSSIDS);
} else
g_free (lower_bssid);
return !found;
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:45,代码来源:nm-setting-wireless.c
示例4: nm_setting_wireless_get_hidden
/**
* nm_setting_wireless_get_hidden:
* @setting: the #NMSettingWireless
*
* Returns: the #NMSettingWireless:hidden property of the setting
**/
gboolean
nm_setting_wireless_get_hidden (NMSettingWireless *setting)
{
g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), FALSE);
return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->hidden;
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:13,代码来源:nm-setting-wireless.c
示例5: nm_setting_wireless_get_security
/**
* nm_setting_wireless_get_security:
* @setting: the #NMSettingWireless
*
* Returns: the #NMSettingWireless:security property of the setting
*
* Deprecated: 0.9.10: No longer used. Security rescrictions are recognized by
* the presence of NM_SETTING_WIRELESS_SECURITY_SETTING_NAME in the connection.
**/
const char *
nm_setting_wireless_get_security (NMSettingWireless *setting)
{
g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), NULL);
return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->security;
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:16,代码来源:nm-setting-wireless.c
示例6: nm_setting_wireless_get_mtu
/**
* nm_setting_wireless_get_mtu:
* @setting: the #NMSettingWireless
*
* Returns: the #NMSettingWireless:mtu property of the setting
**/
guint32
nm_setting_wireless_get_mtu (NMSettingWireless *setting)
{
g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), 0);
return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->mtu;
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:13,代码来源:nm-setting-wireless.c
示例7: nm_setting_wireless_get_num_mac_blacklist_items
/**
* nm_setting_wireless_get_num_mac_blacklist_items:
* @setting: the #NMSettingWireless
*
* Returns: the number of blacklisted MAC addresses
*
* Since: 0.9.10
**/
guint32
nm_setting_wireless_get_num_mac_blacklist_items (NMSettingWireless *setting)
{
g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), 0);
return g_slist_length (NM_SETTING_WIRELESS_GET_PRIVATE (setting)->mac_address_blacklist);
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:15,代码来源:nm-setting-wireless.c
示例8: nm_setting_wireless_get_mac_address_blacklist
/**
* nm_setting_wireless_get_mac_address_blacklist:
* @setting: the #NMSettingWireless
*
* Returns: (element-type GLib.ByteArray): the
* #NMSettingWireless:mac-address-blacklist property of the setting
**/
const GSList *
nm_setting_wireless_get_mac_address_blacklist (NMSettingWireless *setting)
{
g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), NULL);
return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->mac_address_blacklist;
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:14,代码来源:nm-setting-wireless.c
示例9: nm_setting_wireless_get_cloned_mac_address
/**
* nm_setting_wireless_get_cloned_mac_address:
* @setting: the #NMSettingWireless
*
* Returns: the #NMSettingWireless:cloned-mac-address property of the setting
**/
const GByteArray *
nm_setting_wireless_get_cloned_mac_address (NMSettingWireless *setting)
{
g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), NULL);
return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->cloned_mac_address;
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:13,代码来源:nm-setting-wireless.c
示例10: nm_setting_wireless_get_bssid
/**
* nm_setting_wireless_get_bssid:
* @setting: the #NMSettingWireless
*
* Returns: the #NMSettingWireless:bssid property of the setting
**/
const GByteArray *
nm_setting_wireless_get_bssid (NMSettingWireless *setting)
{
g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), NULL);
return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->bssid;
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:13,代码来源:nm-setting-wireless.c
示例11: nm_setting_wireless_get_num_seen_bssids
/**
* nm_setting_wireless_get_num_seen_bssids:
* @setting: the #NMSettingWireless
*
* Returns: the number of BSSIDs in the previously seen BSSID list
**/
guint32
nm_setting_wireless_get_num_seen_bssids (NMSettingWireless *setting)
{
g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), 0);
return g_slist_length (NM_SETTING_WIRELESS_GET_PRIVATE (setting)->seen_bssids);
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:13,代码来源:nm-setting-wireless.c
示例12: nm_setting_wireless_get_seen_bssid
/**
* nm_setting_wireless_get_seen_bssid:
* @setting: the #NMSettingWireless
* @i: index of a BSSID in the previously seen BSSID list
*
* Returns: the BSSID at index @i
**/
const char *
nm_setting_wireless_get_seen_bssid (NMSettingWireless *setting,
guint32 i)
{
g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), NULL);
return (const char *) g_slist_nth_data (NM_SETTING_WIRELESS_GET_PRIVATE (setting)->seen_bssids, i);
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:15,代码来源:nm-setting-wireless.c
示例13: nm_setting_wireless_get_mac_blacklist_item
/**
* nm_setting_wireless_get_mac_blacklist_item:
* @setting: the #NMSettingWireless
* @idx: the zero-based index of the MAC address entry
*
* Returns: the blacklisted MAC address string (hex-digits-and-colons notation)
* at index @idx
*
* Since: 0.9.10
**/
const char *
nm_setting_wireless_get_mac_blacklist_item (NMSettingWireless *setting, guint32 idx)
{
NMSettingWirelessPrivate *priv;
g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), NULL);
priv = NM_SETTING_WIRELESS_GET_PRIVATE (setting);
g_return_val_if_fail (idx <= g_slist_length (priv->mac_address_blacklist), NULL);
return (const char *) g_slist_nth_data (priv->mac_address_blacklist, idx);
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:22,代码来源:nm-setting-wireless.c
示例14: nm_setting_wireless_remove_mac_blacklist_item
/**
* nm_setting_wireless_remove_mac_blacklist_item:
* @setting: the #NMSettingWireless
* @idx: index number of the MAC address
*
* Removes the MAC address at index @idx from the blacklist.
*
* Since: 0.9.10
**/
void
nm_setting_wireless_remove_mac_blacklist_item (NMSettingWireless *setting, guint32 idx)
{
NMSettingWirelessPrivate *priv;
GSList *elt;
g_return_if_fail (NM_IS_SETTING_WIRELESS (setting));
priv = NM_SETTING_WIRELESS_GET_PRIVATE (setting);
elt = g_slist_nth (priv->mac_address_blacklist, idx);
g_return_if_fail (elt != NULL);
g_free (elt->data);
priv->mac_address_blacklist = g_slist_delete_link (priv->mac_address_blacklist, elt);
g_object_notify (G_OBJECT (setting), NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST);
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:25,代码来源:nm-setting-wireless.c
示例15: finalize
static void
finalize (GObject *object)
{
NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE (object);
g_free (priv->mode);
g_free (priv->band);
g_free (priv->security);
if (priv->ssid)
g_byte_array_free (priv->ssid, TRUE);
if (priv->bssid)
g_byte_array_free (priv->bssid, TRUE);
if (priv->device_mac_address)
g_byte_array_free (priv->device_mac_address, TRUE);
if (priv->cloned_mac_address)
g_byte_array_free (priv->cloned_mac_address, TRUE);
g_slist_free_full (priv->mac_address_blacklist, g_free);
g_slist_free_full (priv->seen_bssids, g_free);
G_OBJECT_CLASS (nm_setting_wireless_parent_class)->finalize (object);
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:22,代码来源:nm-setting-wireless.c
示例16: nm_setting_wireless_remove_mac_blacklist_item_by_value
/**
* nm_setting_wireless_remove_mac_blacklist_item_by_value:
* @setting: the #NMSettingWireless
* @mac: the MAC address string (hex-digits-and-colons notation) to remove from
* the blacklist
*
* Removes the MAC address @mac from the blacklist.
*
* Returns: %TRUE if the MAC address was found and removed; %FALSE if it was not.
*
* Since: 0.9.10
**/
gboolean
nm_setting_wireless_remove_mac_blacklist_item_by_value (NMSettingWireless *setting, const char *mac)
{
NMSettingWirelessPrivate *priv;
GSList *iter;
guint8 buf[32];
g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), FALSE);
g_return_val_if_fail (mac != NULL, FALSE);
if (!nm_utils_hwaddr_aton (mac, ARPHRD_ETHER, buf))
return FALSE;
priv = NM_SETTING_WIRELESS_GET_PRIVATE (setting);
for (iter = priv->mac_address_blacklist; iter; iter = g_slist_next (iter)) {
if (!strcasecmp (mac, (char *) iter->data)) {
priv->mac_address_blacklist = g_slist_delete_link (priv->mac_address_blacklist, iter);
g_object_notify (G_OBJECT (setting), NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST);
return TRUE;
}
}
return FALSE;
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:35,代码来源:nm-setting-wireless.c
示例17: verify
static gboolean
verify (NMSetting *setting, GSList *all_settings, GError **error)
{
NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE (setting);
const char *valid_modes[] = { NM_SETTING_WIRELESS_MODE_INFRA, NM_SETTING_WIRELESS_MODE_ADHOC, NM_SETTING_WIRELESS_MODE_AP, NULL };
const char *valid_bands[] = { "a", "bg", NULL };
GSList *iter;
if (!priv->ssid) {
g_set_error_literal (error,
NM_SETTING_WIRELESS_ERROR,
NM_SETTING_WIRELESS_ERROR_MISSING_PROPERTY,
_("property is missing"));
g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_SSID);
return FALSE;
}
if (!priv->ssid->len || priv->ssid->len > 32) {
g_set_error_literal (error,
NM_SETTING_WIRELESS_ERROR,
NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY,
_("SSID length is out of range <1-32> bytes"));
g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_SSID);
return FALSE;
}
if (priv->mode && !_nm_utils_string_in_list (priv->mode, valid_modes)) {
g_set_error (error,
NM_SETTING_WIRELESS_ERROR,
NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY,
_("'%s' is not a valid Wi-Fi mode"),
priv->mode);
g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_MODE);
return FALSE;
}
if (priv->band && !_nm_utils_string_in_list (priv->band, valid_bands)) {
g_set_error (error,
NM_SETTING_WIRELESS_ERROR,
NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY,
_("'%s' is not a valid band"),
priv->band);
g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_BAND);
return FALSE;
}
if (priv->channel && !priv->band) {
g_set_error (error,
NM_SETTING_WIRELESS_ERROR,
NM_SETTING_WIRELESS_ERROR_CHANNEL_REQUIRES_BAND,
_("requires setting '%s' property"),
NM_SETTING_WIRELESS_BAND);
g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_CHANNEL);
return FALSE;
}
if (priv->channel) {
if (!nm_utils_wifi_is_channel_valid (priv->channel, priv->band)) {
g_set_error (error,
NM_SETTING_WIRELESS_ERROR,
NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY,
_("'%d' is not a valid channel"),
priv->channel);
g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_CHANNEL);
return FALSE;
}
}
if (priv->bssid && priv->bssid->len != ETH_ALEN) {
g_set_error_literal (error,
NM_SETTING_WIRELESS_ERROR,
NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY,
_("property is invalid"));
g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_BSSID);
return FALSE;
}
if (priv->device_mac_address && priv->device_mac_address->len != ETH_ALEN) {
g_set_error_literal (error,
NM_SETTING_WIRELESS_ERROR,
NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY,
_("property is invalid"));
g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_MAC_ADDRESS);
return FALSE;
}
if (priv->cloned_mac_address && priv->cloned_mac_address->len != ETH_ALEN) {
g_set_error_literal (error,
NM_SETTING_WIRELESS_ERROR,
NM_SETTING_WIRELESS_ERROR_INVALID_PROPERTY,
_("property is invalid"));
g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS);
return FALSE;
}
for (iter = priv->mac_address_blacklist; iter; iter = iter->next) {
struct ether_addr addr;
if (!ether_aton_r (iter->data, &addr)) {
g_set_error (error,
//.........这里部分代码省略.........
开发者ID:heftig,项目名称:NetworkManager,代码行数:101,代码来源:nm-setting-wireless.c
示例18: set_property
static void
set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec)
{
NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE (object);
switch (prop_id) {
case PROP_SSID:
if (priv->ssid)
g_byte_array_free (priv->ssid, TRUE);
priv->ssid = g_value_dup_boxed (value);
break;
case PROP_MODE:
g_free (priv->mode);
priv->mode = g_value_dup_string (value);
break;
case PROP_BAND:
g_free (priv->band);
priv->band = g_value_dup_string (value);
break;
case PROP_CHANNEL:
priv->channel = g_value_get_uint (value);
break;
case PROP_BSSID:
if (priv->bssid)
g_byte_array_free (priv->bssid, TRUE);
priv->bssid = g_value_dup_boxed (value);
break;
case PROP_RATE:
priv->rate = g_value_get_uint (value);
break;
case PROP_TX_POWER:
priv->tx_power = g_value_get_uint (value);
break;
case PROP_MAC_ADDRESS:
if (priv->device_mac_address)
g_byte_array_free (priv->device_mac_address, TRUE);
priv->device_mac_address = g_value_dup_boxed (value);
break;
case PROP_CLONED_MAC_ADDRESS:
if (priv->cloned_mac_address)
g_byte_array_free (priv->cloned_mac_address, TRUE);
priv->cloned_mac_address = g_value_dup_boxed (value);
break;
case PROP_MAC_ADDRESS_BLACKLIST:
g_slist_free_full (priv->mac_address_blacklist, g_free);
priv->mac_address_blacklist = g_value_dup_boxed (value);
break;
case PROP_MTU:
priv->mtu = g_value_get_uint (value);
break;
case PROP_SEEN_BSSIDS:
g_slist_free_full (priv->seen_bssids, g_free);
priv->seen_bssids = g_value_dup_boxed (value);
break;
case PROP_SEC:
g_free (priv->security);
priv->security = g_value_dup_string (value);
break;
case PROP_HIDDEN:
priv->hidden = g_value_get_boolean (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
开发者ID:heftig,项目名称:NetworkManager,代码行数:67,代码来源:nm-setting-wireless.c
注:本文中的NM_SETTING_WIRELESS_GET_PRIVATE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论