diff options
Diffstat (limited to 'docs/libnm-util/html/libnm-util-nm-utils.html')
| -rw-r--r-- | docs/libnm-util/html/libnm-util-nm-utils.html | 1250 |
1 files changed, 685 insertions, 565 deletions
diff --git a/docs/libnm-util/html/libnm-util-nm-utils.html b/docs/libnm-util/html/libnm-util-nm-utils.html index b7ff71ec..91e04c2d 100644 --- a/docs/libnm-util/html/libnm-util-nm-utils.html +++ b/docs/libnm-util/html/libnm-util-nm-utils.html @@ -3,12 +3,12 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>nm-utils</title> -<meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> +<meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> <link rel="home" href="index.html" title="libnm-util Reference Manual"> <link rel="up" href="ch01.html" title="libnm-util API Reference"> <link rel="prev" href="NMSettingVPN.html" title="NMSettingVPN"> <link rel="next" href="object-tree.html" title="Object Hierarchy"> -<meta name="generator" content="GTK-Doc V1.18 (XML mode)"> +<meta name="generator" content="GTK-Doc V1.19 (XML mode)"> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> @@ -42,77 +42,77 @@ <a name="NMUtilsSecurityType"></a><pre class="synopsis"> #include <nm-utils.h> -enum <a class="link" href="libnm-util-nm-utils.html#NMUtilsSecurityType-enum" title="enum NMUtilsSecurityType">NMUtilsSecurityType</a>; -#define <a class="link" href="libnm-util-nm-utils.html#NM-UTILS-HWADDR-LEN-MAX:CAPS" title="NM_UTILS_HWADDR_LEN_MAX">NM_UTILS_HWADDR_LEN_MAX</a> -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-ap-mode-security-valid" title="nm_utils_ap_mode_security_valid ()">nm_utils_ap_mode_security_valid</a> (<em class="parameter"><code><a class="link" href="libnm-util-nm-utils.html#NMUtilsSecurityType"><span class="type">NMUtilsSecurityType</span></a> type</code></em>, - <em class="parameter"><code><span class="type">NMDeviceWifiCapabilities</span> wifi_caps</code></em>); +<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-init" title="nm_utils_init ()">nm_utils_init</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>); <span class="returnvalue">void</span> <a class="link" href="libnm-util-nm-utils.html#nm-utils-deinit" title="nm_utils_deinit ()">nm_utils_deinit</a> (<em class="parameter"><code><span class="type">void</span></code></em>); +<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-is-empty-ssid" title="nm_utils_is_empty_ssid ()">nm_utils_is_empty_ssid</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *ssid</code></em>, + <em class="parameter"><code><span class="type">int</span> len</code></em>); const <span class="returnvalue">char</span> * <a class="link" href="libnm-util-nm-utils.html#nm-utils-escape-ssid" title="nm_utils_escape_ssid ()">nm_utils_escape_ssid</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *ssid</code></em>, <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> len</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-file-is-pkcs12" title="nm_utils_file_is_pkcs12 ()">nm_utils_file_is_pkcs12</a> (<em class="parameter"><code>const <span class="type">char</span> *filename</code></em>); +<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-same-ssid" title="nm_utils_same_ssid ()">nm_utils_same_ssid</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a> *ssid1</code></em>, + <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a> *ssid2</code></em>, + <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> ignore_trailing_null</code></em>); +<span class="returnvalue">char</span> * <a class="link" href="libnm-util-nm-utils.html#nm-utils-ssid-to-utf8" title="nm_utils_ssid_to_utf8 ()">nm_utils_ssid_to_utf8</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a> *ssid</code></em>); <a href="http://library.gnome.org/devel/glib/unstable/glib-Hash-Tables.html#GHashTable"><span class="returnvalue">GHashTable</span></a> * <a class="link" href="libnm-util-nm-utils.html#nm-utils-gvalue-hash-dup" title="nm_utils_gvalue_hash_dup ()">nm_utils_gvalue_hash_dup</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a> *hash</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="returnvalue">GByteArray</span></a> * <a class="link" href="libnm-util-nm-utils.html#nm-utils-hwaddr-atoba" title="nm_utils_hwaddr_atoba ()">nm_utils_hwaddr_atoba</a> (<em class="parameter"><code>const <span class="type">char</span> *asc</code></em>, - <em class="parameter"><code><span class="type">int</span> type</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="returnvalue">guint8</span></a> * <a class="link" href="libnm-util-nm-utils.html#nm-utils-hwaddr-aton" title="nm_utils_hwaddr_aton ()">nm_utils_hwaddr_aton</a> (<em class="parameter"><code>const <span class="type">char</span> *asc</code></em>, - <em class="parameter"><code><span class="type">int</span> type</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> buffer</code></em>); -<span class="returnvalue">int</span> <a class="link" href="libnm-util-nm-utils.html#nm-utils-hwaddr-len" title="nm_utils_hwaddr_len ()">nm_utils_hwaddr_len</a> (<em class="parameter"><code><span class="type">int</span> type</code></em>); -<span class="returnvalue">char</span> * <a class="link" href="libnm-util-nm-utils.html#nm-utils-hwaddr-ntoa" title="nm_utils_hwaddr_ntoa ()">nm_utils_hwaddr_ntoa</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gconstpointer"><span class="type">gconstpointer</span></a> addr</code></em>, - <em class="parameter"><code><span class="type">int</span> type</code></em>); -<span class="returnvalue">int</span> <a class="link" href="libnm-util-nm-utils.html#nm-utils-hwaddr-type" title="nm_utils_hwaddr_type ()">nm_utils_hwaddr_type</a> (<em class="parameter"><code><span class="type">int</span> len</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-iface-valid-name" title="nm_utils_iface_valid_name ()">nm_utils_iface_valid_name</a> (<em class="parameter"><code>const <span class="type">char</span> *name</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-init" title="nm_utils_init ()">nm_utils_init</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>); +<span class="returnvalue">void</span> <a class="link" href="libnm-util-nm-utils.html#nm-utils-slist-free" title="nm_utils_slist_free ()">nm_utils_slist_free</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *list</code></em>, + <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> elem_destroy_fn</code></em>); +enum <a class="link" href="libnm-util-nm-utils.html#NMUtilsSecurityType-enum" title="enum NMUtilsSecurityType">NMUtilsSecurityType</a>; +<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-security-valid" title="nm_utils_security_valid ()">nm_utils_security_valid</a> (<em class="parameter"><code><a class="link" href="libnm-util-nm-utils.html#NMUtilsSecurityType"><span class="type">NMUtilsSecurityType</span></a> type</code></em>, + <em class="parameter"><code><span class="type">NMDeviceWifiCapabilities</span> wifi_caps</code></em>, + <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> have_ap</code></em>, + <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> adhoc</code></em>, + <em class="parameter"><code><span class="type">NM80211ApFlags</span> ap_flags</code></em>, + <em class="parameter"><code><span class="type">NM80211ApSecurityFlags</span> ap_wpa</code></em>, + <em class="parameter"><code><span class="type">NM80211ApSecurityFlags</span> ap_rsn</code></em>); +<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-ap-mode-security-valid" title="nm_utils_ap_mode_security_valid ()">nm_utils_ap_mode_security_valid</a> (<em class="parameter"><code><a class="link" href="libnm-util-nm-utils.html#NMUtilsSecurityType"><span class="type">NMUtilsSecurityType</span></a> type</code></em>, + <em class="parameter"><code><span class="type">NMDeviceWifiCapabilities</span> wifi_caps</code></em>); +<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-wep-key-valid" title="nm_utils_wep_key_valid ()">nm_utils_wep_key_valid</a> (<em class="parameter"><code>const <span class="type">char</span> *key</code></em>, + <em class="parameter"><code><a class="link" href="NMSettingWirelessSecurity.html#NMWepKeyType"><span class="type">NMWepKeyType</span></a> wep_type</code></em>); +<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-wpa-psk-valid" title="nm_utils_wpa_psk_valid ()">nm_utils_wpa_psk_valid</a> (<em class="parameter"><code>const <span class="type">char</span> *psk</code></em>); <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> * <a class="link" href="libnm-util-nm-utils.html#nm-utils-ip4-addresses-from-gvalue" title="nm_utils_ip4_addresses_from_gvalue ()">nm_utils_ip4_addresses_from_gvalue</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>); <span class="returnvalue">void</span> <a class="link" href="libnm-util-nm-utils.html#nm-utils-ip4-addresses-to-gvalue" title="nm_utils_ip4_addresses_to_gvalue ()">nm_utils_ip4_addresses_to_gvalue</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *list</code></em>, <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-ip4-get-default-prefix" title="nm_utils_ip4_get_default_prefix ()">nm_utils_ip4_get_default_prefix</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> ip</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-ip4-netmask-to-prefix" title="nm_utils_ip4_netmask_to_prefix ()">nm_utils_ip4_netmask_to_prefix</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> netmask</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-ip4-prefix-to-netmask" title="nm_utils_ip4_prefix_to_netmask ()">nm_utils_ip4_prefix_to_netmask</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> prefix</code></em>); <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> * <a class="link" href="libnm-util-nm-utils.html#nm-utils-ip4-routes-from-gvalue" title="nm_utils_ip4_routes_from_gvalue ()">nm_utils_ip4_routes_from_gvalue</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>); <span class="returnvalue">void</span> <a class="link" href="libnm-util-nm-utils.html#nm-utils-ip4-routes-to-gvalue" title="nm_utils_ip4_routes_to_gvalue ()">nm_utils_ip4_routes_to_gvalue</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *list</code></em>, <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>); +<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-ip4-netmask-to-prefix" title="nm_utils_ip4_netmask_to_prefix ()">nm_utils_ip4_netmask_to_prefix</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> netmask</code></em>); +<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-ip4-prefix-to-netmask" title="nm_utils_ip4_prefix_to_netmask ()">nm_utils_ip4_prefix_to_netmask</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> prefix</code></em>); +<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-ip4-get-default-prefix" title="nm_utils_ip4_get_default_prefix ()">nm_utils_ip4_get_default_prefix</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> ip</code></em>); <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> * <a class="link" href="libnm-util-nm-utils.html#nm-utils-ip6-addresses-from-gvalue" title="nm_utils_ip6_addresses_from_gvalue ()">nm_utils_ip6_addresses_from_gvalue</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>); <span class="returnvalue">void</span> <a class="link" href="libnm-util-nm-utils.html#nm-utils-ip6-addresses-to-gvalue" title="nm_utils_ip6_addresses_to_gvalue ()">nm_utils_ip6_addresses_to_gvalue</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *list</code></em>, <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> * <a class="link" href="libnm-util-nm-utils.html#nm-utils-ip6-dns-from-gvalue" title="nm_utils_ip6_dns_from_gvalue ()">nm_utils_ip6_dns_from_gvalue</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>); -<span class="returnvalue">void</span> <a class="link" href="libnm-util-nm-utils.html#nm-utils-ip6-dns-to-gvalue" title="nm_utils_ip6_dns_to_gvalue ()">nm_utils_ip6_dns_to_gvalue</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *list</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>); <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> * <a class="link" href="libnm-util-nm-utils.html#nm-utils-ip6-routes-from-gvalue" title="nm_utils_ip6_routes_from_gvalue ()">nm_utils_ip6_routes_from_gvalue</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>); <span class="returnvalue">void</span> <a class="link" href="libnm-util-nm-utils.html#nm-utils-ip6-routes-to-gvalue" title="nm_utils_ip6_routes_to_gvalue ()">nm_utils_ip6_routes_to_gvalue</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *list</code></em>, <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-is-empty-ssid" title="nm_utils_is_empty_ssid ()">nm_utils_is_empty_ssid</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *ssid</code></em>, - <em class="parameter"><code><span class="type">int</span> len</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-is-uuid" title="nm_utils_is_uuid ()">nm_utils_is_uuid</a> (<em class="parameter"><code>const <span class="type">char</span> *str</code></em>); +<a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> * <a class="link" href="libnm-util-nm-utils.html#nm-utils-ip6-dns-from-gvalue" title="nm_utils_ip6_dns_from_gvalue ()">nm_utils_ip6_dns_from_gvalue</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>); +<span class="returnvalue">void</span> <a class="link" href="libnm-util-nm-utils.html#nm-utils-ip6-dns-to-gvalue" title="nm_utils_ip6_dns_to_gvalue ()">nm_utils_ip6_dns_to_gvalue</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *list</code></em>, + <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>); +<span class="returnvalue">char</span> * <a class="link" href="libnm-util-nm-utils.html#nm-utils-uuid-generate" title="nm_utils_uuid_generate ()">nm_utils_uuid_generate</a> (<em class="parameter"><code><span class="type">void</span></code></em>); +<span class="returnvalue">char</span> * <a class="link" href="libnm-util-nm-utils.html#nm-utils-uuid-generate-from-string" title="nm_utils_uuid_generate_from_string ()">nm_utils_uuid_generate_from_string</a> (<em class="parameter"><code>const <span class="type">char</span> *s</code></em>); <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="returnvalue">GByteArray</span></a> * <a class="link" href="libnm-util-nm-utils.html#nm-utils-rsa-key-encrypt" title="nm_utils_rsa_key_encrypt ()">nm_utils_rsa_key_encrypt</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a> *data</code></em>, <em class="parameter"><code>const <span class="type">char</span> *in_password</code></em>, <em class="parameter"><code><span class="type">char</span> **out_password</code></em>, <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-same-ssid" title="nm_utils_same_ssid ()">nm_utils_same_ssid</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a> *ssid1</code></em>, - <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a> *ssid2</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> ignore_trailing_null</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-security-valid" title="nm_utils_security_valid ()">nm_utils_security_valid</a> (<em class="parameter"><code><a class="link" href="libnm-util-nm-utils.html#NMUtilsSecurityType"><span class="type">NMUtilsSecurityType</span></a> type</code></em>, - <em class="parameter"><code><span class="type">NMDeviceWifiCapabilities</span> wifi_caps</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> have_ap</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> adhoc</code></em>, - <em class="parameter"><code><span class="type">NM80211ApFlags</span> ap_flags</code></em>, - <em class="parameter"><code><span class="type">NM80211ApSecurityFlags</span> ap_wpa</code></em>, - <em class="parameter"><code><span class="type">NM80211ApSecurityFlags</span> ap_rsn</code></em>); -<span class="returnvalue">void</span> <a class="link" href="libnm-util-nm-utils.html#nm-utils-slist-free" title="nm_utils_slist_free ()">nm_utils_slist_free</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *list</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> elem_destroy_fn</code></em>); -<span class="returnvalue">char</span> * <a class="link" href="libnm-util-nm-utils.html#nm-utils-ssid-to-utf8" title="nm_utils_ssid_to_utf8 ()">nm_utils_ssid_to_utf8</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a> *ssid</code></em>); -<span class="returnvalue">char</span> * <a class="link" href="libnm-util-nm-utils.html#nm-utils-uuid-generate" title="nm_utils_uuid_generate ()">nm_utils_uuid_generate</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -<span class="returnvalue">char</span> * <a class="link" href="libnm-util-nm-utils.html#nm-utils-uuid-generate-from-string" title="nm_utils_uuid_generate_from_string ()">nm_utils_uuid_generate_from_string</a> (<em class="parameter"><code>const <span class="type">char</span> *s</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-wep-key-valid" title="nm_utils_wep_key_valid ()">nm_utils_wep_key_valid</a> (<em class="parameter"><code>const <span class="type">char</span> *key</code></em>, - <em class="parameter"><code><a class="link" href="NMSettingWirelessSecurity.html#NMWepKeyType"><span class="type">NMWepKeyType</span></a> wep_type</code></em>); +<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-file-is-pkcs12" title="nm_utils_file_is_pkcs12 ()">nm_utils_file_is_pkcs12</a> (<em class="parameter"><code>const <span class="type">char</span> *filename</code></em>); +<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-wifi-freq-to-channel" title="nm_utils_wifi_freq_to_channel ()">nm_utils_wifi_freq_to_channel</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> freq</code></em>); <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-wifi-channel-to-freq" title="nm_utils_wifi_channel_to_freq ()">nm_utils_wifi_channel_to_freq</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> channel</code></em>, <em class="parameter"><code>const <span class="type">char</span> *band</code></em>); <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-wifi-find-next-channel" title="nm_utils_wifi_find_next_channel ()">nm_utils_wifi_find_next_channel</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> channel</code></em>, <em class="parameter"><code><span class="type">int</span> direction</code></em>, <em class="parameter"><code><span class="type">char</span> *band</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-wifi-freq-to-channel" title="nm_utils_wifi_freq_to_channel ()">nm_utils_wifi_freq_to_channel</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> freq</code></em>); <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-wifi-is-channel-valid" title="nm_utils_wifi_is_channel_valid ()">nm_utils_wifi_is_channel_valid</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> channel</code></em>, <em class="parameter"><code>const <span class="type">char</span> *band</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-wpa-psk-valid" title="nm_utils_wpa_psk_valid ()">nm_utils_wpa_psk_valid</a> (<em class="parameter"><code>const <span class="type">char</span> *psk</code></em>); +#define <a class="link" href="libnm-util-nm-utils.html#NM-UTILS-HWADDR-LEN-MAX:CAPS" title="NM_UTILS_HWADDR_LEN_MAX">NM_UTILS_HWADDR_LEN_MAX</a> +<span class="returnvalue">int</span> <a class="link" href="libnm-util-nm-utils.html#nm-utils-hwaddr-len" title="nm_utils_hwaddr_len ()">nm_utils_hwaddr_len</a> (<em class="parameter"><code><span class="type">int</span> type</code></em>); +<span class="returnvalue">int</span> <a class="link" href="libnm-util-nm-utils.html#nm-utils-hwaddr-type" title="nm_utils_hwaddr_type ()">nm_utils_hwaddr_type</a> (<em class="parameter"><code><span class="type">int</span> len</code></em>); +<span class="returnvalue">char</span> * <a class="link" href="libnm-util-nm-utils.html#nm-utils-hwaddr-ntoa" title="nm_utils_hwaddr_ntoa ()">nm_utils_hwaddr_ntoa</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gconstpointer"><span class="type">gconstpointer</span></a> addr</code></em>, + <em class="parameter"><code><span class="type">int</span> type</code></em>); +<a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="returnvalue">GByteArray</span></a> * <a class="link" href="libnm-util-nm-utils.html#nm-utils-hwaddr-atoba" title="nm_utils_hwaddr_atoba ()">nm_utils_hwaddr_atoba</a> (<em class="parameter"><code>const <span class="type">char</span> *asc</code></em>, + <em class="parameter"><code><span class="type">int</span> type</code></em>); +<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="returnvalue">guint8</span></a> * <a class="link" href="libnm-util-nm-utils.html#nm-utils-hwaddr-aton" title="nm_utils_hwaddr_aton ()">nm_utils_hwaddr_aton</a> (<em class="parameter"><code>const <span class="type">char</span> *asc</code></em>, + <em class="parameter"><code><span class="type">int</span> type</code></em>, + <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> buffer</code></em>); +<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-iface-valid-name" title="nm_utils_iface_valid_name ()">nm_utils_iface_valid_name</a> (<em class="parameter"><code>const <span class="type">char</span> *name</code></em>); +<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libnm-util-nm-utils.html#nm-utils-is-uuid" title="nm_utils_is_uuid ()">nm_utils_is_uuid</a> (<em class="parameter"><code>const <span class="type">char</span> *str</code></em>); </pre> </div> <div class="refsect1"> @@ -132,132 +132,74 @@ access points and devices, among other things. <div class="refsect1"> <a name="libnm-util-nm-utils.details"></a><h2>Details</h2> <div class="refsect2"> -<a name="NMUtilsSecurityType-enum"></a><h3>enum NMUtilsSecurityType</h3> -<pre class="programlisting">typedef enum { - NMU_SEC_INVALID = 0, - NMU_SEC_NONE, - NMU_SEC_STATIC_WEP, - NMU_SEC_LEAP, - NMU_SEC_DYNAMIC_WEP, - NMU_SEC_WPA_PSK, - NMU_SEC_WPA_ENTERPRISE, - NMU_SEC_WPA2_PSK, - NMU_SEC_WPA2_ENTERPRISE -} NMUtilsSecurityType; -</pre> +<a name="nm-utils-init"></a><h3>nm_utils_init ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_init (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> <p> -Describes generic security mechanisms that 802.11 access points may offer. -Used with <a class="link" href="libnm-util-nm-utils.html#nm-utils-security-valid" title="nm_utils_security_valid ()"><code class="function">nm_utils_security_valid()</code></a> for checking whether a given access -point is compatible with a network device. +Initializes libnm-util; should be called when starting and program that +uses libnm-util. Sets up an <code class="function">atexit()</code> handler to ensure de-initialization +is performed, but calling <a class="link" href="libnm-util-nm-utils.html#nm-utils-deinit" title="nm_utils_deinit ()"><code class="function">nm_utils_deinit()</code></a> to explicitly deinitialize +libnm-util can also be done. This function can be called more than once. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><a name="NMU-SEC-INVALID:CAPS"></a><span class="term"><code class="literal">NMU_SEC_INVALID</code></span></p></td> -<td>unknown or invalid security, placeholder and not used -</td> -</tr> -<tr> -<td><p><a name="NMU-SEC-NONE:CAPS"></a><span class="term"><code class="literal">NMU_SEC_NONE</code></span></p></td> -<td>unencrypted and open -</td> -</tr> -<tr> -<td><p><a name="NMU-SEC-STATIC-WEP:CAPS"></a><span class="term"><code class="literal">NMU_SEC_STATIC_WEP</code></span></p></td> -<td>static WEP keys are used for encryption -</td> -</tr> -<tr> -<td><p><a name="NMU-SEC-LEAP:CAPS"></a><span class="term"><code class="literal">NMU_SEC_LEAP</code></span></p></td> -<td>Cisco LEAP is used for authentication and for generating the -dynamic WEP keys automatically -</td> -</tr> -<tr> -<td><p><a name="NMU-SEC-DYNAMIC-WEP:CAPS"></a><span class="term"><code class="literal">NMU_SEC_DYNAMIC_WEP</code></span></p></td> -<td>standard 802.1x is used for authentication and -generating the dynamic WEP keys automatically -</td> -</tr> -<tr> -<td><p><a name="NMU-SEC-WPA-PSK:CAPS"></a><span class="term"><code class="literal">NMU_SEC_WPA_PSK</code></span></p></td> -<td>WPA1 is used with Pre-Shared Keys (PSK) -</td> -</tr> -<tr> -<td><p><a name="NMU-SEC-WPA-ENTERPRISE:CAPS"></a><span class="term"><code class="literal">NMU_SEC_WPA_ENTERPRISE</code></span></p></td> -<td>WPA1 is used with 802.1x authentication -</td> -</tr> -<tr> -<td><p><a name="NMU-SEC-WPA2-PSK:CAPS"></a><span class="term"><code class="literal">NMU_SEC_WPA2_PSK</code></span></p></td> -<td>WPA2/RSN is used with Pre-Shared Keys (PSK) +<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td> +<td>location to store error, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> </td> </tr> <tr> -<td><p><a name="NMU-SEC-WPA2-ENTERPRISE:CAPS"></a><span class="term"><code class="literal">NMU_SEC_WPA2_ENTERPRISE</code></span></p></td> -<td>WPA2 is used with 802.1x authentication -</td> +<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> +<td>TRUE if the initialization was successful, FALSE on failure.</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2"> -<a name="NM-UTILS-HWADDR-LEN-MAX:CAPS"></a><h3>NM_UTILS_HWADDR_LEN_MAX</h3> -<pre class="programlisting">#define NM_UTILS_HWADDR_LEN_MAX 20 /* INFINIBAND_ALEN */ -</pre> +<a name="nm-utils-deinit"></a><h3>nm_utils_deinit ()</h3> +<pre class="programlisting"><span class="returnvalue">void</span> nm_utils_deinit (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> <p> -The maximum length of a hardware address of a type known by -<a class="link" href="libnm-util-nm-utils.html#nm-utils-hwaddr-len" title="nm_utils_hwaddr_len ()"><code class="function">nm_utils_hwaddr_len()</code></a> or <a class="link" href="libnm-util-nm-utils.html#nm-utils-hwaddr-aton" title="nm_utils_hwaddr_aton ()"><code class="function">nm_utils_hwaddr_aton()</code></a>. This can be used -as the size of the buffer passed to <a class="link" href="libnm-util-nm-utils.html#nm-utils-hwaddr-aton" title="nm_utils_hwaddr_aton ()"><code class="function">nm_utils_hwaddr_aton()</code></a>. +Frees all resources used internally by libnm-util. This function is called +from an <code class="function">atexit()</code> handler, set up by <a class="link" href="libnm-util-nm-utils.html#nm-utils-init" title="nm_utils_init ()"><code class="function">nm_utils_init()</code></a>, but is safe to be called +more than once. Subsequent calls have no effect until <a class="link" href="libnm-util-nm-utils.html#nm-utils-init" title="nm_utils_init ()"><code class="function">nm_utils_init()</code></a> is +called again. </p> </div> <hr> <div class="refsect2"> -<a name="nm-utils-ap-mode-security-valid"></a><h3>nm_utils_ap_mode_security_valid ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_ap_mode_security_valid (<em class="parameter"><code><a class="link" href="libnm-util-nm-utils.html#NMUtilsSecurityType"><span class="type">NMUtilsSecurityType</span></a> type</code></em>, - <em class="parameter"><code><span class="type">NMDeviceWifiCapabilities</span> wifi_caps</code></em>);</pre> +<a name="nm-utils-is-empty-ssid"></a><h3>nm_utils_is_empty_ssid ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_is_empty_ssid (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *ssid</code></em>, + <em class="parameter"><code><span class="type">int</span> len</code></em>);</pre> <p> -Given a set of device capabilities, and a desired security type to check -against, determines whether the combination of device capabilities and -desired security type are valid for AP/Hotspot connections. +Different manufacturers use different mechanisms for not broadcasting the +AP's SSID. This function attempts to detect blank/empty SSIDs using a +number of known SSID-cloaking methods. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> -<td>the security type to check device capabilties against, -e.g. <a class="link" href="libnm-util-nm-utils.html#NMU-SEC-STATIC-WEP:CAPS"><span class="type">NMU_SEC_STATIC_WEP</span></a> -</td> +<td><p><span class="term"><em class="parameter"><code>ssid</code></em> :</span></p></td> +<td>pointer to a buffer containing the SSID data</td> </tr> <tr> -<td><p><span class="term"><em class="parameter"><code>wifi_caps</code></em> :</span></p></td> -<td>bitfield of the capabilities of the specific WiFi device, e.g. -<span class="type">NM_WIFI_DEVICE_CAP_CIPHER_WEP40</span> +<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td> +<td>length of the SSID data in <em class="parameter"><code>ssid</code></em> </td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>TRUE if the device capabilities are compatible with the desired -<em class="parameter"><code>type</code></em>, FALSE if they are not.</td> +<td>TRUE if the SSID is "empty", FALSE if it is not</td> </tr> </tbody> </table></div> -<p class="since">Since 0.9.8</p> -</div> -<hr> -<div class="refsect2"> -<a name="nm-utils-deinit"></a><h3>nm_utils_deinit ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> nm_utils_deinit (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Frees all resources used internally by libnm-util. This function is called -from an <code class="function">atexit()</code> handler, set up by <a class="link" href="libnm-util-nm-utils.html#nm-utils-init" title="nm_utils_init ()"><code class="function">nm_utils_init()</code></a>, but is safe to be called -more than once. Subsequent calls have no effect until <a class="link" href="libnm-util-nm-utils.html#nm-utils-init" title="nm_utils_init ()"><code class="function">nm_utils_init()</code></a> is -called again. -</p> </div> <hr> <div class="refsect2"> @@ -270,8 +212,11 @@ replacing embedded NULLs and non-printable characters with the hexadecimal representation of that character. Intended for debugging only, should not be used for display of SSIDs. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>ssid</code></em> :</span></p></td> @@ -292,21 +237,90 @@ and will be overwritten by subsequent calls to this function</td> </div> <hr> <div class="refsect2"> -<a name="nm-utils-file-is-pkcs12"></a><h3>nm_utils_file_is_pkcs12 ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_file_is_pkcs12 (<em class="parameter"><code>const <span class="type">char</span> *filename</code></em>);</pre> +<a name="nm-utils-same-ssid"></a><h3>nm_utils_same_ssid ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_same_ssid (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a> *ssid1</code></em>, + <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a> *ssid2</code></em>, + <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> ignore_trailing_null</code></em>);</pre> <p> -Utility function to find out if the <em class="parameter"><code>filename</code></em> is in PKCS<span class="type">12</span> format. +Earlier versions of the Linux kernel added a NULL byte to the end of the +SSID to enable easy printing of the SSID on the console or in a terminal, +but this behavior was problematic (SSIDs are simply byte arrays, not strings) +and thus was changed. This function compensates for that behavior at the +cost of some compatibility with odd SSIDs that may legitimately have trailing +NULLs, even though that is functionally pointless. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td> -<td>name of the file to test</td> +<td><p><span class="term"><em class="parameter"><code>ssid1</code></em> :</span></p></td> +<td>first SSID data to compare</td> +</tr> +<tr> +<td><p><span class="term"><em class="parameter"><code>ssid2</code></em> :</span></p></td> +<td>second SSID data to compare</td> +</tr> +<tr> +<td><p><span class="term"><em class="parameter"><code>ignore_trailing_null</code></em> :</span></p></td> +<td>TRUE to ignore one trailing NULL byte</td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>TRUE if the file is PKCS<span class="type">12</span>, FALSE if it is not</td> +<td>TRUE if the SSIDs are the same, FALSE if they are not</td> +</tr> +</tbody> +</table></div> +</div> +<hr> +<div class="refsect2"> +<a name="nm-utils-ssid-to-utf8"></a><h3>nm_utils_ssid_to_utf8 ()</h3> +<pre class="programlisting"><span class="returnvalue">char</span> * nm_utils_ssid_to_utf8 (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a> *ssid</code></em>);</pre> +<p> +WiFi SSIDs are byte arrays, they are _not_ strings. Thus, an SSID may +contain embedded NULLs and other unprintable characters. Often it is +useful to print the SSID out for debugging purposes, but that should be the +_only_ use of this function. Do not use this function for any persistent +storage of the SSID, since the printable SSID returned from this function +cannot be converted back into the real SSID of the access point. +</p> +<p> +This function does almost everything humanly possible to convert the input +into a printable UTF-8 string, using roughly the following procedure: +</p> +<p> +1) if the input data is already UTF-8 safe, no conversion is performed +2) attempts to get the current system language from the LANG environment + variable, and depending on the language, uses a table of alternative + encodings to try. For example, if LANG=hu_HU, the table may first try + the ISO-8859-2 encoding, and if that fails, try the Windows-1250 encoding. + If all fallback encodings fail, replaces non-UTF-8 characters with '?'. +3) If the system language was unable to be determined, falls back to the + ISO-8859-1 encoding, then to the Windows-1251 encoding. +4) If step 3 fails, replaces non-UTF-8 characters with '?'. +</p> +<p> +Again, this function should be used for debugging and display purposes +_only_. +</p> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> +<col align="left" valign="top"> +<col> +</colgroup> +<tbody> +<tr> +<td><p><span class="term"><em class="parameter"><code>ssid</code></em> :</span></p></td> +<td>a byte array containing the SSID data</td> +</tr> +<tr> +<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> +<td>an allocated string containing a UTF-8 +representation of the SSID, which must be freed by the caller using <a href="http://library.gnome.org/devel/glib/unstable/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>. +Returns <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on errors. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span> +</td> </tr> </tbody> </table></div> @@ -318,8 +332,11 @@ Utility function to find out if the <em class="parameter"><code>filename</code>< <p> Utility function to duplicate a hash table of GValues. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>hash</code></em> :</span></p></td> @@ -336,29 +353,26 @@ returned hash with <a href="http://library.gnome.org/devel/glib/unstable/glib-Ha </div> <hr> <div class="refsect2"> -<a name="nm-utils-hwaddr-atoba"></a><h3>nm_utils_hwaddr_atoba ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="returnvalue">GByteArray</span></a> * nm_utils_hwaddr_atoba (<em class="parameter"><code>const <span class="type">char</span> *asc</code></em>, - <em class="parameter"><code><span class="type">int</span> type</code></em>);</pre> +<a name="nm-utils-slist-free"></a><h3>nm_utils_slist_free ()</h3> +<pre class="programlisting"><span class="returnvalue">void</span> nm_utils_slist_free (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *list</code></em>, + <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> elem_destroy_fn</code></em>);</pre> <p> -Parses <em class="parameter"><code>asc</code></em> and converts it to binary form in a <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a>. See -<a class="link" href="libnm-util-nm-utils.html#nm-utils-hwaddr-aton" title="nm_utils_hwaddr_aton ()"><code class="function">nm_utils_hwaddr_aton()</code></a> if you don't want a <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a>. +Utility function to free a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a>. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>asc</code></em> :</span></p></td> -<td>the ASCII representation of a hardware address</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> -<td>the type of address; either <code class="literal">ARPHRD_ETHER</code> or <code class="literal">ARPHRD_INFINIBAND</code> +<td><p><span class="term"><em class="parameter"><code>list</code></em> :</span></p></td> +<td>a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> </td> </tr> <tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a new <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a>, or <a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>asc</code></em> couldn't -be parsed. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span> +<td><p><span class="term"><em class="parameter"><code>elem_destroy_fn</code></em> :</span></p></td> +<td>user function called for each element in <em class="parameter"><code>list</code></em> </td> </tr> </tbody> @@ -366,131 +380,211 @@ be parsed. <span class="annotation">[<acronym title="Free data after the code is </div> <hr> <div class="refsect2"> -<a name="nm-utils-hwaddr-aton"></a><h3>nm_utils_hwaddr_aton ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="returnvalue">guint8</span></a> * nm_utils_hwaddr_aton (<em class="parameter"><code>const <span class="type">char</span> *asc</code></em>, - <em class="parameter"><code><span class="type">int</span> type</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> buffer</code></em>);</pre> +<a name="NMUtilsSecurityType-enum"></a><h3>enum NMUtilsSecurityType</h3> +<pre class="programlisting">typedef enum { + NMU_SEC_INVALID = 0, + NMU_SEC_NONE, + NMU_SEC_STATIC_WEP, + NMU_SEC_LEAP, + NMU_SEC_DYNAMIC_WEP, + NMU_SEC_WPA_PSK, + NMU_SEC_WPA_ENTERPRISE, + NMU_SEC_WPA2_PSK, + NMU_SEC_WPA2_ENTERPRISE +} NMUtilsSecurityType; +</pre> <p> -Parses <em class="parameter"><code>asc</code></em> and converts it to binary form in <em class="parameter"><code>buffer</code></em>. See -<a class="link" href="libnm-util-nm-utils.html#nm-utils-hwaddr-atoba" title="nm_utils_hwaddr_atoba ()"><code class="function">nm_utils_hwaddr_atoba()</code></a> if you'd rather have the result in a -<a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a>. +Describes generic security mechanisms that 802.11 access points may offer. +Used with <a class="link" href="libnm-util-nm-utils.html#nm-utils-security-valid" title="nm_utils_security_valid ()"><code class="function">nm_utils_security_valid()</code></a> for checking whether a given access +point is compatible with a network device. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>asc</code></em> :</span></p></td> -<td>the ASCII representation of a hardware address</td> +<td><p><a name="NMU-SEC-INVALID:CAPS"></a><span class="term"><code class="literal">NMU_SEC_INVALID</code></span></p></td> +<td>unknown or invalid security, placeholder and not used +</td> </tr> <tr> -<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> -<td>the type of address; either <code class="literal">ARPHRD_ETHER</code> or <code class="literal">ARPHRD_INFINIBAND</code> +<td><p><a name="NMU-SEC-NONE:CAPS"></a><span class="term"><code class="literal">NMU_SEC_NONE</code></span></p></td> +<td>unencrypted and open </td> </tr> <tr> -<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td> -<td>buffer to store the result into</td> +<td><p><a name="NMU-SEC-STATIC-WEP:CAPS"></a><span class="term"><code class="literal">NMU_SEC_STATIC_WEP</code></span></p></td> +<td>static WEP keys are used for encryption +</td> </tr> <tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td> -<em class="parameter"><code>buffer</code></em>, or <a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>asc</code></em> couldn't be parsed</td> +<td><p><a name="NMU-SEC-LEAP:CAPS"></a><span class="term"><code class="literal">NMU_SEC_LEAP</code></span></p></td> +<td>Cisco LEAP is used for authentication and for generating the +dynamic WEP keys automatically +</td> +</tr> +<tr> +<td><p><a name="NMU-SEC-DYNAMIC-WEP:CAPS"></a><span class="term"><code class="literal">NMU_SEC_DYNAMIC_WEP</code></span></p></td> +<td>standard 802.1x is used for authentication and +generating the dynamic WEP keys automatically +</td> +</tr> +<tr> +<td><p><a name="NMU-SEC-WPA-PSK:CAPS"></a><span class="term"><code class="literal">NMU_SEC_WPA_PSK</code></span></p></td> +<td>WPA1 is used with Pre-Shared Keys (PSK) +</td> +</tr> +<tr> +<td><p><a name="NMU-SEC-WPA-ENTERPRISE:CAPS"></a><span class="term"><code class="literal">NMU_SEC_WPA_ENTERPRISE</code></span></p></td> +<td>WPA1 is used with 802.1x authentication +</td> +</tr> +<tr> +<td><p><a name="NMU-SEC-WPA2-PSK:CAPS"></a><span class="term"><code class="literal">NMU_SEC_WPA2_PSK</code></span></p></td> +<td>WPA2/RSN is used with Pre-Shared Keys (PSK) +</td> +</tr> +<tr> +<td><p><a name="NMU-SEC-WPA2-ENTERPRISE:CAPS"></a><span class="term"><code class="literal">NMU_SEC_WPA2_ENTERPRISE</code></span></p></td> +<td>WPA2 is used with 802.1x authentication +</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2"> -<a name="nm-utils-hwaddr-len"></a><h3>nm_utils_hwaddr_len ()</h3> -<pre class="programlisting"><span class="returnvalue">int</span> nm_utils_hwaddr_len (<em class="parameter"><code><span class="type">int</span> type</code></em>);</pre> +<a name="nm-utils-security-valid"></a><h3>nm_utils_security_valid ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_security_valid (<em class="parameter"><code><a class="link" href="libnm-util-nm-utils.html#NMUtilsSecurityType"><span class="type">NMUtilsSecurityType</span></a> type</code></em>, + <em class="parameter"><code><span class="type">NMDeviceWifiCapabilities</span> wifi_caps</code></em>, + <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> have_ap</code></em>, + <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> adhoc</code></em>, + <em class="parameter"><code><span class="type">NM80211ApFlags</span> ap_flags</code></em>, + <em class="parameter"><code><span class="type">NM80211ApSecurityFlags</span> ap_wpa</code></em>, + <em class="parameter"><code><span class="type">NM80211ApSecurityFlags</span> ap_rsn</code></em>);</pre> <p> -Returns the length in octets of a hardware address of type <em class="parameter"><code>type</code></em>. +Given a set of device capabilities, and a desired security type to check +against, determines whether the combination of device, desired security +type, and AP capabilities intersect. +</p> +<p> +NOTE: this function cannot handle checking security for AP/Hotspot mode; +use <a class="link" href="libnm-util-nm-utils.html#nm-utils-ap-mode-security-valid" title="nm_utils_ap_mode_security_valid ()"><code class="function">nm_utils_ap_mode_security_valid()</code></a> instead. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> -<td>the type of address; either <code class="literal">ARPHRD_ETHER</code> or <code class="literal">ARPHRD_INFINIBAND</code> +<td>the security type to check AP flags and device capabilties against, +e.g. <a class="link" href="libnm-util-nm-utils.html#NMU-SEC-STATIC-WEP:CAPS"><span class="type">NMU_SEC_STATIC_WEP</span></a> </td> </tr> <tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the length</td> +<td><p><span class="term"><em class="parameter"><code>wifi_caps</code></em> :</span></p></td> +<td>bitfield of the capabilities of the specific WiFi device, e.g. +<span class="type">NM_WIFI_DEVICE_CAP_CIPHER_WEP40</span> +</td> </tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="nm-utils-hwaddr-ntoa"></a><h3>nm_utils_hwaddr_ntoa ()</h3> -<pre class="programlisting"><span class="returnvalue">char</span> * nm_utils_hwaddr_ntoa (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gconstpointer"><span class="type">gconstpointer</span></a> addr</code></em>, - <em class="parameter"><code><span class="type">int</span> type</code></em>);</pre> -<p> -Converts <em class="parameter"><code>addr</code></em> to textual form. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>addr</code></em> :</span></p></td> -<td>a binary hardware address</td> +<td><p><span class="term"><em class="parameter"><code>have_ap</code></em> :</span></p></td> +<td>whether the <em class="parameter"><code>ap_flags</code></em>, <em class="parameter"><code>ap_wpa</code></em>, and <em class="parameter"><code>ap_rsn</code></em> arguments are valid</td> </tr> <tr> -<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> -<td>the type of address; either <code class="literal">ARPHRD_ETHER</code> or <code class="literal">ARPHRD_INFINIBAND</code> +<td><p><span class="term"><em class="parameter"><code>adhoc</code></em> :</span></p></td> +<td>whether the capabilities being tested are from an Ad-Hoc AP (IBSS)</td> +</tr> +<tr> +<td><p><span class="term"><em class="parameter"><code>ap_flags</code></em> :</span></p></td> +<td>bitfield of AP capabilities, e.g. <span class="type">NM_802_11_AP_FLAGS_PRIVACY</span> </td> </tr> <tr> +<td><p><span class="term"><em class="parameter"><code>ap_wpa</code></em> :</span></p></td> +<td>bitfield of AP capabilties derived from the AP's WPA beacon, +e.g. (<span class="type">NM_802_11_AP_SEC_PAIR_TKIP</span> | <span class="type">NM_802_11_AP_SEC_KEY_MGMT_PSK</span>)</td> +</tr> +<tr> +<td><p><span class="term"><em class="parameter"><code>ap_rsn</code></em> :</span></p></td> +<td>bitfield of AP capabilties derived from the AP's RSN/WPA2 beacon, +e.g. (<span class="type">NM_802_11_AP_SEC_PAIR_CCMP</span> | <span class="type">NM_802_11_AP_SEC_PAIR_TKIP</span>)</td> +</tr> +<tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the textual form of <em class="parameter"><code>addr</code></em>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span> -</td> +<td>TRUE if the device capabilities and AP capabilties intersect and are +compatible with the desired <em class="parameter"><code>type</code></em>, FALSE if they are not</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2"> -<a name="nm-utils-hwaddr-type"></a><h3>nm_utils_hwaddr_type ()</h3> -<pre class="programlisting"><span class="returnvalue">int</span> nm_utils_hwaddr_type (<em class="parameter"><code><span class="type">int</span> len</code></em>);</pre> +<a name="nm-utils-ap-mode-security-valid"></a><h3>nm_utils_ap_mode_security_valid ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_ap_mode_security_valid (<em class="parameter"><code><a class="link" href="libnm-util-nm-utils.html#NMUtilsSecurityType"><span class="type">NMUtilsSecurityType</span></a> type</code></em>, + <em class="parameter"><code><span class="type">NMDeviceWifiCapabilities</span> wifi_caps</code></em>);</pre> <p> -Returns the type (either <code class="literal">ARPHRD_ETHER</code> or <code class="literal">ARPHRD_INFINIBAND</code>) of the raw -address given its length. +Given a set of device capabilities, and a desired security type to check +against, determines whether the combination of device capabilities and +desired security type are valid for AP/Hotspot connections. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td> -<td>the length of hardware address in bytes</td> +<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> +<td>the security type to check device capabilties against, +e.g. <a class="link" href="libnm-util-nm-utils.html#NMU-SEC-STATIC-WEP:CAPS"><span class="type">NMU_SEC_STATIC_WEP</span></a> +</td> +</tr> +<tr> +<td><p><span class="term"><em class="parameter"><code>wifi_caps</code></em> :</span></p></td> +<td>bitfield of the capabilities of the specific WiFi device, e.g. +<span class="type">NM_WIFI_DEVICE_CAP_CIPHER_WEP40</span> +</td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the type, either <code class="literal">ARPHRD_ETHER</code> or <code class="literal">ARPHRD_INFINIBAND</code>, or -1 if -the address length was not recognized</td> +<td>TRUE if the device capabilities are compatible with the desired +<em class="parameter"><code>type</code></em>, FALSE if they are not.</td> </tr> </tbody> </table></div> +<p class="since">Since 0.9.8</p> </div> <hr> <div class="refsect2"> -<a name="nm-utils-iface-valid-name"></a><h3>nm_utils_iface_valid_name ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_iface_valid_name (<em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre> +<a name="nm-utils-wep-key-valid"></a><h3>nm_utils_wep_key_valid ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_wep_key_valid (<em class="parameter"><code>const <span class="type">char</span> *key</code></em>, + <em class="parameter"><code><a class="link" href="NMSettingWirelessSecurity.html#NMWepKeyType"><span class="type">NMWepKeyType</span></a> wep_type</code></em>);</pre> <p> -This function is a 1:1 copy of the kernel's interface validation -function in net/core/dev.c. +Checks if <em class="parameter"><code>key</code></em> is a valid WEP key </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td> -<td>Name of interface</td> +<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td> +<td>a string that might be a WEP key</td> +</tr> +<tr> +<td><p><span class="term"><em class="parameter"><code>wep_type</code></em> :</span></p></td> +<td>the <a class="link" href="NMSettingWirelessSecurity.html#NMWepKeyType"><span class="type">NMWepKeyType</span></a> type of the WEP key</td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> <td> -<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if interface name is valid, otherwise <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> is returned.</td> +<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>key</code></em> is a WEP key, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if not</td> </tr> </tbody> </table></div> @@ -498,28 +592,29 @@ function in net/core/dev.c. </div> <hr> <div class="refsect2"> -<a name="nm-utils-init"></a><h3>nm_utils_init ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_init (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> +<a name="nm-utils-wpa-psk-valid"></a><h3>nm_utils_wpa_psk_valid ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_wpa_psk_valid (<em class="parameter"><code>const <span class="type">char</span> *psk</code></em>);</pre> <p> -Initializes libnm-util; should be called when starting and program that -uses libnm-util. Sets up an <code class="function">atexit()</code> handler to ensure de-initialization -is performed, but calling <a class="link" href="libnm-util-nm-utils.html#nm-utils-deinit" title="nm_utils_deinit ()"><code class="function">nm_utils_deinit()</code></a> to explicitly deinitialize -libnm-util can also be done. This function can be called more than once. +Checks if <em class="parameter"><code>psk</code></em> is a valid WPA PSK </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td> -<td>location to store error, or <a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> -</td> +<td><p><span class="term"><em class="parameter"><code>psk</code></em> :</span></p></td> +<td>a string that might be a WPA PSK</td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>TRUE if the initialization was successful, FALSE on failure.</td> +<td> +<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>psk</code></em> is a WPA PSK, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if not</td> </tr> </tbody> </table></div> +<p class="since">Since 0.9.8</p> </div> <hr> <div class="refsect2"> @@ -532,8 +627,11 @@ and prefix) into a GSList of <a class="link" href="NMSettingIP4Config.html#NMIP4 this serialization is not guaranteed to be stable and the <a href="http://library.gnome.org/devel/glib/unstable/glib-Arrays.html#GArray"><span class="type">GArray</span></a> may be extended in the future. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td> @@ -559,8 +657,11 @@ addresses (which is a tuple of address, gateway, and prefix). The specific format of this serialization is not guaranteed to be stable and may be extended in the future. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>list</code></em> :</span></p></td> @@ -578,115 +679,130 @@ which should be unset by the caller (when no longer needed) with </div> <hr> <div class="refsect2"> -<a name="nm-utils-ip4-get-default-prefix"></a><h3>nm_utils_ip4_get_default_prefix ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> nm_utils_ip4_get_default_prefix (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> ip</code></em>);</pre> +<a name="nm-utils-ip4-routes-from-gvalue"></a><h3>nm_utils_ip4_routes_from_gvalue ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> * nm_utils_ip4_routes_from_gvalue (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>);</pre> <p> -When the Internet was originally set up, various ranges of IP addresses were -segmented into three network classes: A, B, and C. This function will return -a prefix that is associated with the IP address specified defining where it -falls in the predefined classes. +Utility function to convert a GPtrArray of GArrays of guint32s representing +a list of NetworkManager IPv4 routes (which is a tuple of route, next hop, +prefix, and metric) into a GSList of <a class="link" href="NMSettingIP4Config.html#NMIP4Route"><span class="type">NMIP4Route</span></a> objects. The specific +format of this serialization is not guaranteed to be stable and may be +extended in the future. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>ip</code></em> :</span></p></td> -<td>an IPv4 address (in network byte order)</td> +<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td> +<td>gvalue containing a GPtrArray of GArrays of guint32s</td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the default class prefix for the given IP</td> +<td>a newly allocated <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of <a class="link" href="NMSettingIP4Config.html#NMIP4Route"><span class="type">NMIP4Route</span></a> objects. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> NetworkManager.IP4Route]</span> +</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2"> -<a name="nm-utils-ip4-netmask-to-prefix"></a><h3>nm_utils_ip4_netmask_to_prefix ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> nm_utils_ip4_netmask_to_prefix (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> netmask</code></em>);</pre> -<div class="variablelist"><table border="0"> +<a name="nm-utils-ip4-routes-to-gvalue"></a><h3>nm_utils_ip4_routes_to_gvalue ()</h3> +<pre class="programlisting"><span class="returnvalue">void</span> nm_utils_ip4_routes_to_gvalue (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *list</code></em>, + <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>);</pre> +<p> +Utility function to convert a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of <a class="link" href="NMSettingIP4Config.html#NMIP4Route"><span class="type">NMIP4Route</span></a> objects into a +GPtrArray of GArrays of guint32s representing a list of NetworkManager IPv4 +routes (which is a tuple of route, next hop, prefix, and metric). The +specific format of this serialization is not guaranteed to be stable and may +be extended in the future. +</p> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>netmask</code></em> :</span></p></td> -<td>an IPv4 netmask in network byte order</td> +<td><p><span class="term"><em class="parameter"><code>list</code></em> :</span></p></td> +<td>a list of <a class="link" href="NMSettingIP4Config.html#NMIP4Route"><span class="type">NMIP4Route</span></a> objects. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> NMIP4Route]</span> +</td> </tr> <tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the CIDR prefix represented by the netmask</td> +<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td> +<td>a pointer to a <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> into which to place the converted routes, +which should be unset by the caller (when no longer needed) with +<a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#g-value-unset"><code class="function">g_value_unset()</code></a>.</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2"> -<a name="nm-utils-ip4-prefix-to-netmask"></a><h3>nm_utils_ip4_prefix_to_netmask ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> nm_utils_ip4_prefix_to_netmask (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> prefix</code></em>);</pre> -<div class="variablelist"><table border="0"> +<a name="nm-utils-ip4-netmask-to-prefix"></a><h3>nm_utils_ip4_netmask_to_prefix ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> nm_utils_ip4_netmask_to_prefix (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> netmask</code></em>);</pre> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>prefix</code></em> :</span></p></td> -<td>a CIDR prefix</td> +<td><p><span class="term"><em class="parameter"><code>netmask</code></em> :</span></p></td> +<td>an IPv4 netmask in network byte order</td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the netmask represented by the prefix, in network byte order</td> +<td>the CIDR prefix represented by the netmask</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2"> -<a name="nm-utils-ip4-routes-from-gvalue"></a><h3>nm_utils_ip4_routes_from_gvalue ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> * nm_utils_ip4_routes_from_gvalue (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>);</pre> -<p> -Utility function to convert a GPtrArray of GArrays of guint32s representing -a list of NetworkManager IPv4 routes (which is a tuple of route, next hop, -prefix, and metric) into a GSList of <a class="link" href="NMSettingIP4Config.html#NMIP4Route"><span class="type">NMIP4Route</span></a> objects. The specific -format of this serialization is not guaranteed to be stable and may be -extended in the future. -</p> -<div class="variablelist"><table border="0"> +<a name="nm-utils-ip4-prefix-to-netmask"></a><h3>nm_utils_ip4_prefix_to_netmask ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> nm_utils_ip4_prefix_to_netmask (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> prefix</code></em>);</pre> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td> -<td>gvalue containing a GPtrArray of GArrays of guint32s</td> +<td><p><span class="term"><em class="parameter"><code>prefix</code></em> :</span></p></td> +<td>a CIDR prefix</td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a newly allocated <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of <a class="link" href="NMSettingIP4Config.html#NMIP4Route"><span class="type">NMIP4Route</span></a> objects. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> NetworkManager.IP4Route]</span> -</td> +<td>the netmask represented by the prefix, in network byte order</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2"> -<a name="nm-utils-ip4-routes-to-gvalue"></a><h3>nm_utils_ip4_routes_to_gvalue ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> nm_utils_ip4_routes_to_gvalue (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *list</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>);</pre> +<a name="nm-utils-ip4-get-default-prefix"></a><h3>nm_utils_ip4_get_default_prefix ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> nm_utils_ip4_get_default_prefix (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> ip</code></em>);</pre> <p> -Utility function to convert a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of <a class="link" href="NMSettingIP4Config.html#NMIP4Route"><span class="type">NMIP4Route</span></a> objects into a -GPtrArray of GArrays of guint32s representing a list of NetworkManager IPv4 -routes (which is a tuple of route, next hop, prefix, and metric). The -specific format of this serialization is not guaranteed to be stable and may -be extended in the future. +When the Internet was originally set up, various ranges of IP addresses were +segmented into three network classes: A, B, and C. This function will return +a prefix that is associated with the IP address specified defining where it +falls in the predefined classes. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>list</code></em> :</span></p></td> -<td>a list of <a class="link" href="NMSettingIP4Config.html#NMIP4Route"><span class="type">NMIP4Route</span></a> objects. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> NMIP4Route]</span> -</td> +<td><p><span class="term"><em class="parameter"><code>ip</code></em> :</span></p></td> +<td>an IPv4 address (in network byte order)</td> </tr> <tr> -<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td> -<td>a pointer to a <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> into which to place the converted routes, -which should be unset by the caller (when no longer needed) with -<a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#g-value-unset"><code class="function">g_value_unset()</code></a>.</td> +<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> +<td>the default class prefix for the given IP</td> </tr> </tbody> </table></div> @@ -702,8 +818,11 @@ prefix, and gateway), into a GSList of <a class="link" href="NMSettingIP6Config. this serialization is not guaranteed to be stable and the <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Value-arrays.html#GValueArray"><span class="type">GValueArray</span></a> may be extended in the future. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td> @@ -729,8 +848,11 @@ GPtrArray of GValueArrays representing a list of NetworkManager IPv6 addresses this serialization is not guaranteed to be stable and may be extended in the future. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>list</code></em> :</span></p></td> @@ -748,24 +870,29 @@ which should be unset by the caller (when no longer needed) with </div> <hr> <div class="refsect2"> -<a name="nm-utils-ip6-dns-from-gvalue"></a><h3>nm_utils_ip6_dns_from_gvalue ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> * nm_utils_ip6_dns_from_gvalue (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>);</pre> +<a name="nm-utils-ip6-routes-from-gvalue"></a><h3>nm_utils_ip6_routes_from_gvalue ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> * nm_utils_ip6_routes_from_gvalue (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>);</pre> <p> -Converts a <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> containing a <a href="http://library.gnome.org/devel/glib/unstable/glib-Pointer-Arrays.html#GPtrArray"><span class="type">GPtrArray</span></a> of IP6 DNS, represented as -<a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a>s into a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of <span class="type">in6_addr</span>s. +Utility function GPtrArray of GValueArrays of (GArray or guchars), guint32, +(GArray of guchars), and guint32 representing a list of NetworkManager IPv6 +routes (which is a tuple of destination, prefix, next hop, and metric) +into a GSList of <a class="link" href="NMSettingIP6Config.html#NMIP6Route"><span class="type">NMIP6Route</span></a> objects. The specific format of this serialization +is not guaranteed to be stable and may be extended in the future. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td> -<td>a <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> -</td> +<td>gvalue containing a GPtrArray of GValueArrays of (GArray or guchars), guint32, +(GArray of guchars), and guint32</td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of IP6 -addresses. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> Posix.in6_addr]</span> +<td>a newly allocated <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of <a class="link" href="NMSettingIP6Config.html#NMIP6Route"><span class="type">NMIP6Route</span></a> objects. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> NetworkManager.IP6Route]</span> </td> </tr> </tbody> @@ -773,26 +900,31 @@ addresses. <span class="annotation">[<acronym title="Free data after the code is </div> <hr> <div class="refsect2"> -<a name="nm-utils-ip6-dns-to-gvalue"></a><h3>nm_utils_ip6_dns_to_gvalue ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> nm_utils_ip6_dns_to_gvalue (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *list</code></em>, +<a name="nm-utils-ip6-routes-to-gvalue"></a><h3>nm_utils_ip6_routes_to_gvalue ()</h3> +<pre class="programlisting"><span class="returnvalue">void</span> nm_utils_ip6_routes_to_gvalue (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *list</code></em>, <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>);</pre> <p> -Utility function to convert a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of 'struct in6_addr' structs into a -GPtrArray of GByteArrays representing each server's IPv6 addresses in -network byte order. The specific format of this serialization is not +Utility function to convert a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of <a class="link" href="NMSettingIP6Config.html#NMIP6Route"><span class="type">NMIP6Route</span></a> objects into a GPtrArray of +GValueArrays of (GArray or guchars), guint32, (GArray of guchars), and guint32 +representing a list of NetworkManager IPv6 routes (which is a tuple of destination, +prefix, next hop, and metric). The specific format of this serialization is not guaranteed to be stable and may be extended in the future. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>list</code></em> :</span></p></td> -<td>a list of <a class="link" href="NMSettingIP6Config.html#NMIP6Route"><span class="type">NMIP6Route</span></a> objects</td> +<td>a list of <a class="link" href="NMSettingIP6Config.html#NMIP6Route"><span class="type">NMIP6Route</span></a> objects. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> NMIP6Route]</span> +</td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td> -<td>a pointer to a <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> into which to place the converted DNS server -addresses, which should be unset by the caller (when no longer needed) with +<td>a pointer to a <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> into which to place the converted routes, +which should be unset by the caller (when no longer needed) with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#g-value-unset"><code class="function">g_value_unset()</code></a>.</td> </tr> </tbody> @@ -800,26 +932,27 @@ addresses, which should be unset by the caller (when no longer needed) with </div> <hr> <div class="refsect2"> -<a name="nm-utils-ip6-routes-from-gvalue"></a><h3>nm_utils_ip6_routes_from_gvalue ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> * nm_utils_ip6_routes_from_gvalue (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>);</pre> +<a name="nm-utils-ip6-dns-from-gvalue"></a><h3>nm_utils_ip6_dns_from_gvalue ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> * nm_utils_ip6_dns_from_gvalue (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>);</pre> <p> -Utility function GPtrArray of GValueArrays of (GArray or guchars), guint32, -(GArray of guchars), and guint32 representing a list of NetworkManager IPv6 -routes (which is a tuple of destination, prefix, next hop, and metric) -into a GSList of <a class="link" href="NMSettingIP6Config.html#NMIP6Route"><span class="type">NMIP6Route</span></a> objects. The specific format of this serialization -is not guaranteed to be stable and may be extended in the future. +Converts a <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> containing a <a href="http://library.gnome.org/devel/glib/unstable/glib-Pointer-Arrays.html#GPtrArray"><span class="type">GPtrArray</span></a> of IP6 DNS, represented as +<a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a>s into a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of <span class="type">in6_addr</span>s. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td> -<td>gvalue containing a GPtrArray of GValueArrays of (GArray or guchars), guint32, -(GArray of guchars), and guint32</td> +<td>a <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> +</td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a newly allocated <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of <a class="link" href="NMSettingIP6Config.html#NMIP6Route"><span class="type">NMIP6Route</span></a> objects. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> NetworkManager.IP6Route]</span> +<td>a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of IP6 +addresses. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> Posix.in6_addr]</span> </td> </tr> </tbody> @@ -827,28 +960,29 @@ is not guaranteed to be stable and may be extended in the future. </div> <hr> <div class="refsect2"> -<a name="nm-utils-ip6-routes-to-gvalue"></a><h3>nm_utils_ip6_routes_to_gvalue ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> nm_utils_ip6_routes_to_gvalue (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *list</code></em>, +<a name="nm-utils-ip6-dns-to-gvalue"></a><h3>nm_utils_ip6_dns_to_gvalue ()</h3> +<pre class="programlisting"><span class="returnvalue">void</span> nm_utils_ip6_dns_to_gvalue (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *list</code></em>, <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>);</pre> <p> -Utility function to convert a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of <a class="link" href="NMSettingIP6Config.html#NMIP6Route"><span class="type">NMIP6Route</span></a> objects into a GPtrArray of -GValueArrays of (GArray or guchars), guint32, (GArray of guchars), and guint32 -representing a list of NetworkManager IPv6 routes (which is a tuple of destination, -prefix, next hop, and metric). The specific format of this serialization is not +Utility function to convert a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of 'struct in6_addr' structs into a +GPtrArray of GByteArrays representing each server's IPv6 addresses in +network byte order. The specific format of this serialization is not guaranteed to be stable and may be extended in the future. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>list</code></em> :</span></p></td> -<td>a list of <a class="link" href="NMSettingIP6Config.html#NMIP6Route"><span class="type">NMIP6Route</span></a> objects. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> NMIP6Route]</span> -</td> +<td>a list of <a class="link" href="NMSettingIP6Config.html#NMIP6Route"><span class="type">NMIP6Route</span></a> objects</td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td> -<td>a pointer to a <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> into which to place the converted routes, -which should be unset by the caller (when no longer needed) with +<td>a pointer to a <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> into which to place the converted DNS server +addresses, which should be unset by the caller (when no longer needed) with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#g-value-unset"><code class="function">g_value_unset()</code></a>.</td> </tr> </tbody> @@ -856,55 +990,45 @@ which should be unset by the caller (when no longer needed) with </div> <hr> <div class="refsect2"> -<a name="nm-utils-is-empty-ssid"></a><h3>nm_utils_is_empty_ssid ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_is_empty_ssid (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *ssid</code></em>, - <em class="parameter"><code><span class="type">int</span> len</code></em>);</pre> -<p> -Different manufacturers use different mechanisms for not broadcasting the -AP's SSID. This function attempts to detect blank/empty SSIDs using a -number of known SSID-cloaking methods. -</p> -<div class="variablelist"><table border="0"> +<a name="nm-utils-uuid-generate"></a><h3>nm_utils_uuid_generate ()</h3> +<pre class="programlisting"><span class="returnvalue">char</span> * nm_utils_uuid_generate (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>ssid</code></em> :</span></p></td> -<td>pointer to a buffer containing the SSID data</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td> -<td>length of the SSID data in <em class="parameter"><code>ssid</code></em> -</td> -</tr> -<tr> +<col> +</colgroup> +<tbody><tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>TRUE if the SSID is "empty", FALSE if it is not</td> -</tr> -</tbody> +<td>a newly allocated UUID suitable for use as the <a class="link" href="NMSettingConnection.html" title="NMSettingConnection"><span class="type">NMSettingConnection</span></a> +object's <a class="link" href="NMSettingConnection.html#NMSettingConnection--id" title='The "id" property'><span class="type">"id"</span></a>: property. Should be freed with <a href="http://library.gnome.org/devel/glib/unstable/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a> +</td> +</tr></tbody> </table></div> </div> <hr> <div class="refsect2"> -<a name="nm-utils-is-uuid"></a><h3>nm_utils_is_uuid ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_is_uuid (<em class="parameter"><code>const <span class="type">char</span> *str</code></em>);</pre> +<a name="nm-utils-uuid-generate-from-string"></a><h3>nm_utils_uuid_generate_from_string ()</h3> +<pre class="programlisting"><span class="returnvalue">char</span> * nm_utils_uuid_generate_from_string (<em class="parameter"><code>const <span class="type">char</span> *s</code></em>);</pre> <p> -Checks if <em class="parameter"><code>str</code></em> is a UUID +For a given <em class="parameter"><code>s</code></em>, this function will always return the same UUID. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td> -<td>a string that might be a UUID</td> +<td><p><span class="term"><em class="parameter"><code>s</code></em> :</span></p></td> +<td>a string to use as the seed for the UUID</td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td> -<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>str</code></em> is a UUID, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if not</td> +<td>a newly allocated UUID suitable for use as the <a class="link" href="NMSettingConnection.html" title="NMSettingConnection"><span class="type">NMSettingConnection</span></a> +object's <a class="link" href="NMSettingConnection.html#NMSettingConnection--id" title='The "id" property'><span class="type">"id"</span></a>: property</td> </tr> </tbody> </table></div> -<p class="since">Since 0.9.8</p> </div> <hr> <div class="refsect2"> @@ -918,8 +1042,11 @@ Encrypts the given RSA private key data with the given password (or generates a password if no password was given) and converts the data to PEM format suitable for writing to a file. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td> @@ -932,7 +1059,7 @@ suitable for writing to a file. </tr> <tr> <td><p><span class="term"><em class="parameter"><code>out_password</code></em> :</span></p></td> -<td>if <em class="parameter"><code>in_password</code></em> was NULL, a random password will be generated +<td>if <em class="parameter"><code>in_password</code></em> was <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, a random password will be generated and returned in this argument. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span> </td> </tr> @@ -951,365 +1078,358 @@ certificate/private key file. <span class="annotation">[<acronym title="Free dat </div> <hr> <div class="refsect2"> -<a name="nm-utils-same-ssid"></a><h3>nm_utils_same_ssid ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_same_ssid (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a> *ssid1</code></em>, - <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a> *ssid2</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> ignore_trailing_null</code></em>);</pre> +<a name="nm-utils-file-is-pkcs12"></a><h3>nm_utils_file_is_pkcs12 ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_file_is_pkcs12 (<em class="parameter"><code>const <span class="type">char</span> *filename</code></em>);</pre> <p> -Earlier versions of the Linux kernel added a NULL byte to the end of the -SSID to enable easy printing of the SSID on the console or in a terminal, -but this behavior was problematic (SSIDs are simply byte arrays, not strings) -and thus was changed. This function compensates for that behavior at the -cost of some compatibility with odd SSIDs that may legitimately have trailing -NULLs, even though that is functionally pointless. +Utility function to find out if the <em class="parameter"><code>filename</code></em> is in PKCS<span class="type">12</span> format. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>ssid1</code></em> :</span></p></td> -<td>first SSID data to compare</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>ssid2</code></em> :</span></p></td> -<td>second SSID data to compare</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>ignore_trailing_null</code></em> :</span></p></td> -<td>TRUE to ignore one trailing NULL byte</td> +<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td> +<td>name of the file to test</td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>TRUE if the SSIDs are the same, FALSE if they are not</td> +<td>TRUE if the file is PKCS<span class="type">12</span>, FALSE if it is not</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2"> -<a name="nm-utils-security-valid"></a><h3>nm_utils_security_valid ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_security_valid (<em class="parameter"><code><a class="link" href="libnm-util-nm-utils.html#NMUtilsSecurityType"><span class="type">NMUtilsSecurityType</span></a> type</code></em>, - <em class="parameter"><code><span class="type">NMDeviceWifiCapabilities</span> wifi_caps</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> have_ap</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> adhoc</code></em>, - <em class="parameter"><code><span class="type">NM80211ApFlags</span> ap_flags</code></em>, - <em class="parameter"><code><span class="type">NM80211ApSecurityFlags</span> ap_wpa</code></em>, - <em class="parameter"><code><span class="type">NM80211ApSecurityFlags</span> ap_rsn</code></em>);</pre> -<p> -Given a set of device capabilities, and a desired security type to check -against, determines whether the combination of device, desired security -type, and AP capabilities intersect. -</p> +<a name="nm-utils-wifi-freq-to-channel"></a><h3>nm_utils_wifi_freq_to_channel ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> nm_utils_wifi_freq_to_channel (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> freq</code></em>);</pre> <p> -NOTE: this function cannot handle checking security for AP/Hotspot mode; -use <a class="link" href="libnm-util-nm-utils.html#nm-utils-ap-mode-security-valid" title="nm_utils_ap_mode_security_valid ()"><code class="function">nm_utils_ap_mode_security_valid()</code></a> instead. +Utility function to translate a WiFi frequency to its corresponding channel. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> -<td>the security type to check AP flags and device capabilties against, -e.g. <a class="link" href="libnm-util-nm-utils.html#NMU-SEC-STATIC-WEP:CAPS"><span class="type">NMU_SEC_STATIC_WEP</span></a> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>wifi_caps</code></em> :</span></p></td> -<td>bitfield of the capabilities of the specific WiFi device, e.g. -<span class="type">NM_WIFI_DEVICE_CAP_CIPHER_WEP40</span> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>have_ap</code></em> :</span></p></td> -<td>whether the <em class="parameter"><code>ap_flags</code></em>, <em class="parameter"><code>ap_wpa</code></em>, and <em class="parameter"><code>ap_rsn</code></em> arguments are valid</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>adhoc</code></em> :</span></p></td> -<td>whether the capabilities being tested are from an Ad-Hoc AP (IBSS)</td> +<td><p><span class="term"><em class="parameter"><code>freq</code></em> :</span></p></td> +<td>frequency</td> </tr> <tr> -<td><p><span class="term"><em class="parameter"><code>ap_flags</code></em> :</span></p></td> -<td>bitfield of AP capabilities, e.g. <span class="type">NM_802_11_AP_FLAGS_PRIVACY</span> -</td> +<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> +<td>the channel represented by the frequency or 0</td> </tr> +</tbody> +</table></div> +</div> +<hr> +<div class="refsect2"> +<a name="nm-utils-wifi-channel-to-freq"></a><h3>nm_utils_wifi_channel_to_freq ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> nm_utils_wifi_channel_to_freq (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> channel</code></em>, + <em class="parameter"><code>const <span class="type">char</span> *band</code></em>);</pre> +<p> +Utility function to translate a WiFi channel to its corresponding frequency. +</p> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> +<col align="left" valign="top"> +<col> +</colgroup> +<tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>ap_wpa</code></em> :</span></p></td> -<td>bitfield of AP capabilties derived from the AP's WPA beacon, -e.g. (<span class="type">NM_802_11_AP_SEC_PAIR_TKIP</span> | <span class="type">NM_802_11_AP_SEC_KEY_MGMT_PSK</span>)</td> +<td><p><span class="term"><em class="parameter"><code>channel</code></em> :</span></p></td> +<td>channel</td> </tr> <tr> -<td><p><span class="term"><em class="parameter"><code>ap_rsn</code></em> :</span></p></td> -<td>bitfield of AP capabilties derived from the AP's RSN/WPA2 beacon, -e.g. (<span class="type">NM_802_11_AP_SEC_PAIR_CCMP</span> | <span class="type">NM_802_11_AP_SEC_PAIR_TKIP</span>)</td> +<td><p><span class="term"><em class="parameter"><code>band</code></em> :</span></p></td> +<td>frequency band for wireless ("a" or "bg")</td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>TRUE if the device capabilities and AP capabilties intersect and are -compatible with the desired <em class="parameter"><code>type</code></em>, FALSE if they are not</td> +<td>the frequency represented by the channel of the band, +or -1 when the freq is invalid, or 0 when the band +is invalid</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2"> -<a name="nm-utils-slist-free"></a><h3>nm_utils_slist_free ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> nm_utils_slist_free (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *list</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> elem_destroy_fn</code></em>);</pre> +<a name="nm-utils-wifi-find-next-channel"></a><h3>nm_utils_wifi_find_next_channel ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> nm_utils_wifi_find_next_channel (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> channel</code></em>, + <em class="parameter"><code><span class="type">int</span> direction</code></em>, + <em class="parameter"><code><span class="type">char</span> *band</code></em>);</pre> <p> -Utility function to free a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a>. +Utility function to find out next/previous WiFi channel for a channel. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>list</code></em> :</span></p></td> -<td>a <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> -</td> +<td><p><span class="term"><em class="parameter"><code>channel</code></em> :</span></p></td> +<td>current channel</td> </tr> <tr> -<td><p><span class="term"><em class="parameter"><code>elem_destroy_fn</code></em> :</span></p></td> -<td>user function called for each element in <em class="parameter"><code>list</code></em> -</td> +<td><p><span class="term"><em class="parameter"><code>direction</code></em> :</span></p></td> +<td>whether going downward (0 or less) or upward (1 or more)</td> +</tr> +<tr> +<td><p><span class="term"><em class="parameter"><code>band</code></em> :</span></p></td> +<td>frequency band for wireless ("a" or "bg")</td> +</tr> +<tr> +<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> +<td>the next channel in the specified direction or 0</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2"> -<a name="nm-utils-ssid-to-utf8"></a><h3>nm_utils_ssid_to_utf8 ()</h3> -<pre class="programlisting"><span class="returnvalue">char</span> * nm_utils_ssid_to_utf8 (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a> *ssid</code></em>);</pre> -<p> -WiFi SSIDs are byte arrays, they are _not_ strings. Thus, an SSID may -contain embedded NULLs and other unprintable characters. Often it is -useful to print the SSID out for debugging purposes, but that should be the -_only_ use of this function. Do not use this function for any persistent -storage of the SSID, since the printable SSID returned from this function -cannot be converted back into the real SSID of the access point. -</p> -<p> -This function does almost everything humanly possible to convert the input -into a printable UTF-8 string, using roughly the following procedure: -</p> -<p> -1) if the input data is already UTF-8 safe, no conversion is performed -2) attempts to get the current system language from the LANG environment - variable, and depending on the language, uses a table of alternative - encodings to try. For example, if LANG=hu_HU, the table may first try - the ISO-8859-2 encoding, and if that fails, try the Windows-1250 encoding. - If all fallback encodings fail, replaces non-UTF-8 characters with '?'. -3) If the system language was unable to be determined, falls back to the - ISO-8859-1 encoding, then to the Windows-1251 encoding. -4) If step 3 fails, replaces non-UTF-8 characters with '?'. -</p> +<a name="nm-utils-wifi-is-channel-valid"></a><h3>nm_utils_wifi_is_channel_valid ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_wifi_is_channel_valid (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> channel</code></em>, + <em class="parameter"><code>const <span class="type">char</span> *band</code></em>);</pre> <p> -Again, this function should be used for debugging and display purposes -_only_. +Utility function to verify WiFi channel validity. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>ssid</code></em> :</span></p></td> -<td>a byte array containing the SSID data</td> +<td><p><span class="term"><em class="parameter"><code>channel</code></em> :</span></p></td> +<td>channel</td> +</tr> +<tr> +<td><p><span class="term"><em class="parameter"><code>band</code></em> :</span></p></td> +<td>frequency band for wireless ("a" or "bg")</td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>an allocated string containing a UTF-8 -representation of the SSID, which must be freed by the caller using <a href="http://library.gnome.org/devel/glib/unstable/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>. -Returns NULL on errors. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span> -</td> +<td>TRUE or FALSE</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2"> -<a name="nm-utils-uuid-generate"></a><h3>nm_utils_uuid_generate ()</h3> -<pre class="programlisting"><span class="returnvalue">char</span> * nm_utils_uuid_generate (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a newly allocated UUID suitable for use as the <a class="link" href="NMSettingConnection.html" title="NMSettingConnection"><span class="type">NMSettingConnection</span></a> -object's <a class="link" href="NMSettingConnection.html#NMSettingConnection--id" title='The "id" property'><span class="type">"id"</span></a>: property. Should be freed with <a href="http://library.gnome.org/devel/glib/unstable/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a> -</td> -</tr></tbody> -</table></div> +<a name="NM-UTILS-HWADDR-LEN-MAX:CAPS"></a><h3>NM_UTILS_HWADDR_LEN_MAX</h3> +<pre class="programlisting">#define NM_UTILS_HWADDR_LEN_MAX 20 /* INFINIBAND_ALEN */ +</pre> +<p> +The maximum length of a hardware address of a type known by +<a class="link" href="libnm-util-nm-utils.html#nm-utils-hwaddr-len" title="nm_utils_hwaddr_len ()"><code class="function">nm_utils_hwaddr_len()</code></a> or <a class="link" href="libnm-util-nm-utils.html#nm-utils-hwaddr-aton" title="nm_utils_hwaddr_aton ()"><code class="function">nm_utils_hwaddr_aton()</code></a>. This can be used +as the size of the buffer passed to <a class="link" href="libnm-util-nm-utils.html#nm-utils-hwaddr-aton" title="nm_utils_hwaddr_aton ()"><code class="function">nm_utils_hwaddr_aton()</code></a>. +</p> </div> <hr> <div class="refsect2"> -<a name="nm-utils-uuid-generate-from-string"></a><h3>nm_utils_uuid_generate_from_string ()</h3> -<pre class="programlisting"><span class="returnvalue">char</span> * nm_utils_uuid_generate_from_string (<em class="parameter"><code>const <span class="type">char</span> *s</code></em>);</pre> +<a name="nm-utils-hwaddr-len"></a><h3>nm_utils_hwaddr_len ()</h3> +<pre class="programlisting"><span class="returnvalue">int</span> nm_utils_hwaddr_len (<em class="parameter"><code><span class="type">int</span> type</code></em>);</pre> <p> -For a given <em class="parameter"><code>s</code></em>, this function will always return the same UUID. +Returns the length in octets of a hardware address of type <em class="parameter"><code>type</code></em>. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>s</code></em> :</span></p></td> -<td>a string to use as the seed for the UUID</td> +<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> +<td>the type of address; either <code class="literal">ARPHRD_ETHER</code> or <code class="literal">ARPHRD_INFINIBAND</code> +</td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a newly allocated UUID suitable for use as the <a class="link" href="NMSettingConnection.html" title="NMSettingConnection"><span class="type">NMSettingConnection</span></a> -object's <a class="link" href="NMSettingConnection.html#NMSettingConnection--id" title='The "id" property'><span class="type">"id"</span></a>: property</td> +<td>the length</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2"> -<a name="nm-utils-wep-key-valid"></a><h3>nm_utils_wep_key_valid ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_wep_key_valid (<em class="parameter"><code>const <span class="type">char</span> *key</code></em>, - <em class="parameter"><code><a class="link" href="NMSettingWirelessSecurity.html#NMWepKeyType"><span class="type">NMWepKeyType</span></a> wep_type</code></em>);</pre> +<a name="nm-utils-hwaddr-type"></a><h3>nm_utils_hwaddr_type ()</h3> +<pre class="programlisting"><span class="returnvalue">int</span> nm_utils_hwaddr_type (<em class="parameter"><code><span class="type">int</span> len</code></em>);</pre> <p> -Checks if <em class="parameter"><code>key</code></em> is a valid WEP key +Returns the type (either <code class="literal">ARPHRD_ETHER</code> or <code class="literal">ARPHRD_INFINIBAND</code>) of the raw +address given its length. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td> -<td>a string that might be a WEP key</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>wep_type</code></em> :</span></p></td> -<td>the <a class="link" href="NMSettingWirelessSecurity.html#NMWepKeyType"><span class="type">NMWepKeyType</span></a> type of the WEP key</td> +<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td> +<td>the length of hardware address in bytes</td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td> -<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>key</code></em> is a WEP key, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if not</td> +<td>the type, either <code class="literal">ARPHRD_ETHER</code> or <code class="literal">ARPHRD_INFINIBAND</code>, or -1 if +the address length was not recognized</td> </tr> </tbody> </table></div> -<p class="since">Since 0.9.8</p> </div> <hr> <div class="refsect2"> -<a name="nm-utils-wifi-channel-to-freq"></a><h3>nm_utils_wifi_channel_to_freq ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> nm_utils_wifi_channel_to_freq (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> channel</code></em>, - <em class="parameter"><code>const <span class="type">char</span> *band</code></em>);</pre> +<a name="nm-utils-hwaddr-ntoa"></a><h3>nm_utils_hwaddr_ntoa ()</h3> +<pre class="programlisting"><span class="returnvalue">char</span> * nm_utils_hwaddr_ntoa (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gconstpointer"><span class="type">gconstpointer</span></a> addr</code></em>, + <em class="parameter"><code><span class="type">int</span> type</code></em>);</pre> <p> -Utility function to translate a WiFi channel to its corresponding frequency. +Converts <em class="parameter"><code>addr</code></em> to textual form. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>channel</code></em> :</span></p></td> -<td>channel</td> +<td><p><span class="term"><em class="parameter"><code>addr</code></em> :</span></p></td> +<td>a binary hardware address</td> </tr> <tr> -<td><p><span class="term"><em class="parameter"><code>band</code></em> :</span></p></td> -<td>frequency band for wireless ("a" or "bg")</td> +<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> +<td>the type of address; either <code class="literal">ARPHRD_ETHER</code> or <code class="literal">ARPHRD_INFINIBAND</code> +</td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the frequency represented by the channel of the band, -or -1 when the freq is invalid, or 0 when the band -is invalid</td> +<td>the textual form of <em class="parameter"><code>addr</code></em>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span> +</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2"> -<a name="nm-utils-wifi-find-next-channel"></a><h3>nm_utils_wifi_find_next_channel ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> nm_utils_wifi_find_next_channel (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> channel</code></em>, - <em class="parameter"><code><span class="type">int</span> direction</code></em>, - <em class="parameter"><code><span class="type">char</span> *band</code></em>);</pre> +<a name="nm-utils-hwaddr-atoba"></a><h3>nm_utils_hwaddr_atoba ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="returnvalue">GByteArray</span></a> * nm_utils_hwaddr_atoba (<em class="parameter"><code>const <span class="type">char</span> *asc</code></em>, + <em class="parameter"><code><span class="type">int</span> type</code></em>);</pre> <p> -Utility function to find out next/previous WiFi channel for a channel. +Parses <em class="parameter"><code>asc</code></em> and converts it to binary form in a <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a>. See +<a class="link" href="libnm-util-nm-utils.html#nm-utils-hwaddr-aton" title="nm_utils_hwaddr_aton ()"><code class="function">nm_utils_hwaddr_aton()</code></a> if you don't want a <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a>. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>channel</code></em> :</span></p></td> -<td>current channel</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>direction</code></em> :</span></p></td> -<td>whether going downward (0 or less) or upward (1 or more)</td> +<td><p><span class="term"><em class="parameter"><code>asc</code></em> :</span></p></td> +<td>the ASCII representation of a hardware address</td> </tr> <tr> -<td><p><span class="term"><em class="parameter"><code>band</code></em> :</span></p></td> -<td>frequency band for wireless ("a" or "bg")</td> +<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> +<td>the type of address; either <code class="literal">ARPHRD_ETHER</code> or <code class="literal">ARPHRD_INFINIBAND</code> +</td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the next channel in the specified direction or 0</td> +<td>a new <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>asc</code></em> couldn't +be parsed. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span> +</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2"> -<a name="nm-utils-wifi-freq-to-channel"></a><h3>nm_utils_wifi_freq_to_channel ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> nm_utils_wifi_freq_to_channel (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> freq</code></em>);</pre> +<a name="nm-utils-hwaddr-aton"></a><h3>nm_utils_hwaddr_aton ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="returnvalue">guint8</span></a> * nm_utils_hwaddr_aton (<em class="parameter"><code>const <span class="type">char</span> *asc</code></em>, + <em class="parameter"><code><span class="type">int</span> type</code></em>, + <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> buffer</code></em>);</pre> <p> -Utility function to translate a WiFi frequency to its corresponding channel. +Parses <em class="parameter"><code>asc</code></em> and converts it to binary form in <em class="parameter"><code>buffer</code></em>. See +<a class="link" href="libnm-util-nm-utils.html#nm-utils-hwaddr-atoba" title="nm_utils_hwaddr_atoba ()"><code class="function">nm_utils_hwaddr_atoba()</code></a> if you'd rather have the result in a +<a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a>. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>freq</code></em> :</span></p></td> -<td>frequency</td> +<td><p><span class="term"><em class="parameter"><code>asc</code></em> :</span></p></td> +<td>the ASCII representation of a hardware address</td> +</tr> +<tr> +<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td> +<td>the type of address; either <code class="literal">ARPHRD_ETHER</code> or <code class="literal">ARPHRD_INFINIBAND</code> +</td> +</tr> +<tr> +<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td> +<td>buffer to store the result into</td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the channel represented by the frequency or 0</td> +<td> +<em class="parameter"><code>buffer</code></em>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>asc</code></em> couldn't be parsed</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2"> -<a name="nm-utils-wifi-is-channel-valid"></a><h3>nm_utils_wifi_is_channel_valid ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_wifi_is_channel_valid (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> channel</code></em>, - <em class="parameter"><code>const <span class="type">char</span> *band</code></em>);</pre> +<a name="nm-utils-iface-valid-name"></a><h3>nm_utils_iface_valid_name ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_iface_valid_name (<em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre> <p> -Utility function to verify WiFi channel validity. +This function is a 1:1 copy of the kernel's interface validation +function in net/core/dev.c. </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>channel</code></em> :</span></p></td> -<td>channel</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>band</code></em> :</span></p></td> -<td>frequency band for wireless ("a" or "bg")</td> +<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td> +<td>Name of interface</td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>TRUE or FALSE</td> +<td> +<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if interface name is valid, otherwise <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> is returned.</td> </tr> </tbody> </table></div> +<p class="since">Since 0.9.8</p> </div> <hr> <div class="refsect2"> -<a name="nm-utils-wpa-psk-valid"></a><h3>nm_utils_wpa_psk_valid ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_wpa_psk_valid (<em class="parameter"><code>const <span class="type">char</span> *psk</code></em>);</pre> +<a name="nm-utils-is-uuid"></a><h3>nm_utils_is_uuid ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> nm_utils_is_uuid (<em class="parameter"><code>const <span class="type">char</span> *str</code></em>);</pre> <p> -Checks if <em class="parameter"><code>psk</code></em> is a valid WPA PSK +Checks if <em class="parameter"><code>str</code></em> is a UUID </p> -<div class="variablelist"><table border="0"> +<div class="variablelist"><table border="0" class="variablelist"> +<colgroup> <col align="left" valign="top"> +<col> +</colgroup> <tbody> <tr> -<td><p><span class="term"><em class="parameter"><code>psk</code></em> :</span></p></td> -<td>a string that might be a WPA PSK</td> +<td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td> +<td>a string that might be a UUID</td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> <td> -<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>psk</code></em> is a WPA PSK, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if not</td> +<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>str</code></em> is a UUID, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if not</td> </tr> </tbody> </table></div> @@ -1319,6 +1439,6 @@ Checks if <em class="parameter"><code>psk</code></em> is a valid WPA PSK </div> <div class="footer"> <hr> - Generated by GTK-Doc V1.18</div> + Generated by GTK-Doc V1.19</div> </body> </html> \ No newline at end of file |