From a6b89d35fabd9f5934b84d7cde22e9268f92c3d3 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Mon, 29 Nov 2010 19:00:22 +0100 Subject: Imported Upstream version 0.8.2 --- docs/libnm-util/html/libnm-util-nm-utils.html | 340 ++++++++++++++++++-------- 1 file changed, 233 insertions(+), 107 deletions(-) (limited to 'docs/libnm-util/html/libnm-util-nm-utils.html') diff --git a/docs/libnm-util/html/libnm-util-nm-utils.html b/docs/libnm-util/html/libnm-util-nm-utils.html index 9e0a9182..ca302756 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 @@ nm-utils - + - + @@ -58,52 +58,60 @@ args...) #define nm_error_str (fmt_str, args...) -gboolean nm_utils_init (GError **error); +gboolean nm_utils_init (GError **error); void nm_utils_deinit (void); -gboolean nm_utils_is_empty_ssid (const guint8 *ssid, +gboolean nm_utils_is_empty_ssid (const guint8 *ssid, int len); -const char * nm_utils_escape_ssid (const guint8 *ssid, - guint32 len); -gboolean nm_utils_same_ssid (const GByteArray *ssid1, - const GByteArray *ssid2, - gboolean ignore_trailing_null); +const char * nm_utils_escape_ssid (const guint8 *ssid, + guint32 len); +gboolean nm_utils_same_ssid (const GByteArray *ssid1, + const GByteArray *ssid2, + gboolean ignore_trailing_null); char * nm_utils_ssid_to_utf8 (const char *ssid, - guint32 len); -GHashTable * nm_utils_gvalue_hash_dup (GHashTable *hash); -void nm_utils_slist_free (GSList *list, - GDestroyNotify elem_destroy_fn); + guint32 len); +GHashTable * nm_utils_gvalue_hash_dup (GHashTable *hash); +void nm_utils_slist_free (GSList *list, + GDestroyNotify elem_destroy_fn); enum NMUtilsSecurityType; -gboolean nm_utils_security_valid (NMUtilsSecurityType type, - guint32 wifi_caps, - gboolean have_ap, - gboolean adhoc, - guint32 ap_flags, - guint32 ap_wpa, - guint32 ap_rsn); -GSList * nm_utils_ip4_addresses_from_gvalue (const GValue *value); -void nm_utils_ip4_addresses_to_gvalue (GSList *list, - GValue *value); -GSList * nm_utils_ip4_routes_from_gvalue (const GValue *value); -void nm_utils_ip4_routes_to_gvalue (GSList *list, - GValue *value); -guint32 nm_utils_ip4_netmask_to_prefix (guint32 netmask); -guint32 nm_utils_ip4_prefix_to_netmask (guint32 prefix); -guint32 nm_utils_ip4_get_default_prefix (guint32 ip); -GSList * nm_utils_ip6_addresses_from_gvalue (const GValue *value); -void nm_utils_ip6_addresses_to_gvalue (GSList *list, - GValue *value); -GSList * nm_utils_ip6_routes_from_gvalue (const GValue *value); -void nm_utils_ip6_routes_to_gvalue (GSList *list, - GValue *value); -GSList * nm_utils_ip6_dns_from_gvalue (const GValue *value); -void nm_utils_ip6_dns_to_gvalue (GSList *list, - GValue *value); +gboolean nm_utils_security_valid (NMUtilsSecurityType type, + guint32 wifi_caps, + gboolean have_ap, + gboolean adhoc, + guint32 ap_flags, + guint32 ap_wpa, + guint32 ap_rsn); +GSList * nm_utils_ip4_addresses_from_gvalue (const GValue *value); +void nm_utils_ip4_addresses_to_gvalue (GSList *list, + GValue *value); +GSList * nm_utils_ip4_routes_from_gvalue (const GValue *value); +void nm_utils_ip4_routes_to_gvalue (GSList *list, + GValue *value); +guint32 nm_utils_ip4_netmask_to_prefix (guint32 netmask); +guint32 nm_utils_ip4_prefix_to_netmask (guint32 prefix); +guint32 nm_utils_ip4_get_default_prefix (guint32 ip); +GSList * nm_utils_ip6_addresses_from_gvalue (const GValue *value); +void nm_utils_ip6_addresses_to_gvalue (GSList *list, + GValue *value); +GSList * nm_utils_ip6_routes_from_gvalue (const GValue *value); +void nm_utils_ip6_routes_to_gvalue (GSList *list, + GValue *value); +GSList * nm_utils_ip6_dns_from_gvalue (const GValue *value); +void nm_utils_ip6_dns_to_gvalue (GSList *list, + GValue *value); char * nm_utils_uuid_generate (void); char * nm_utils_uuid_generate_from_string (const char *s); -GByteArray * nm_utils_rsa_key_encrypt (const GByteArray *data, +GByteArray * nm_utils_rsa_key_encrypt (const GByteArray *data, const char *in_password, char **out_password, - GError **error); + GError **error); +guint32 nm_utils_wifi_freq_to_channel (guint32 freq); +guint32 nm_utils_wifi_channel_to_freq (guint32 channel, + const char *band); +guint32 nm_utils_wifi_find_next_channel (guint32 channel, + int direction, + char *band); +gboolean nm_utils_wifi_is_channel_valid (guint32 channel, + const char *band);
@@ -317,7 +325,7 @@ For debugging only.

nm_utils_init ()

-
gboolean            nm_utils_init                       (GError **error);
+
gboolean            nm_utils_init                       (GError **error);

Initializes libnm-util; should be called when starting and program that uses libnm-util. Sets up an atexit() handler to ensure de-initialization @@ -329,7 +337,7 @@ libnm-util can also be done. This function can be called more than once.

error :

-location to store error, or NULL +location to store error, or NULL @@ -354,7 +362,7 @@ called again.

nm_utils_is_empty_ssid ()

-
gboolean            nm_utils_is_empty_ssid              (const guint8 *ssid,
+
gboolean            nm_utils_is_empty_ssid              (const guint8 *ssid,
                                                          int len);

Different manufacturers use different mechanisms for not broadcasting the @@ -385,8 +393,8 @@ number of known SSID-cloaking methods.


nm_utils_escape_ssid ()

-
const char *        nm_utils_escape_ssid                (const guint8 *ssid,
-                                                         guint32 len);
+
const char *        nm_utils_escape_ssid                (const guint8 *ssid,
+                                                         guint32 len);

This function does a quick printable character conversion of the SSID, simply replacing embedded NULLs and non-printable characters with the hexadecimal @@ -418,9 +426,9 @@ and will be overwritten by subsequent calls to this function


nm_utils_same_ssid ()

-
gboolean            nm_utils_same_ssid                  (const GByteArray *ssid1,
-                                                         const GByteArray *ssid2,
-                                                         gboolean ignore_trailing_null);
+
gboolean            nm_utils_same_ssid                  (const GByteArray *ssid1,
+                                                         const GByteArray *ssid2,
+                                                         gboolean ignore_trailing_null);

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, @@ -459,7 +467,7 @@ NULLs, even though that is functionally pointless.

nm_utils_ssid_to_utf8 ()

char *              nm_utils_ssid_to_utf8               (const char *ssid,
-                                                         guint32 len);
+ guint32 len);

WiFi SSIDs are byte arrays, they are _not_ strings. Thus, an SSID may contain embedded NULLs and other unprintable characters. Often it is @@ -503,7 +511,7 @@ _only_.

Returns :

an allocated string containing a UTF-8 representation of the -SSID, which must be freed by the caller using g_free(). Returns NULL +SSID, which must be freed by the caller using g_free(). Returns NULL on errors. @@ -513,7 +521,7 @@ on errors.

nm_utils_gvalue_hash_dup ()

-
GHashTable *        nm_utils_gvalue_hash_dup            (GHashTable *hash);
+
GHashTable *        nm_utils_gvalue_hash_dup            (GHashTable *hash);

Utility function to duplicate a hash table of GValues.

@@ -522,13 +530,13 @@ Utility function to duplicate a hash table of GValues.

hash :

-a GHashTable mapping string:GValue +a GHashTable mapping string:GValue

Returns :

- a newly allocated duplicated GHashTable, caller must free the -returned hash with g_hash_table_unref() or g_hash_table_destroy() + a newly allocated duplicated GHashTable, caller must free the +returned hash with g_hash_table_unref() or g_hash_table_destroy() @@ -537,17 +545,17 @@ returned hash with

nm_utils_slist_free ()

-
void                nm_utils_slist_free                 (GSList *list,
-                                                         GDestroyNotify elem_destroy_fn);
+
void                nm_utils_slist_free                 (GSList *list,
+                                                         GDestroyNotify elem_destroy_fn);

-Utility function to free a GSList. +Utility function to free a GSList.

- @@ -579,13 +587,13 @@ Utility function to free a

nm_utils_security_valid ()

-
gboolean            nm_utils_security_valid             (NMUtilsSecurityType type,
-                                                         guint32 wifi_caps,
-                                                         gboolean have_ap,
-                                                         gboolean adhoc,
-                                                         guint32 ap_flags,
-                                                         guint32 ap_wpa,
-                                                         guint32 ap_rsn);
+
gboolean            nm_utils_security_valid             (NMUtilsSecurityType type,
+                                                         guint32 wifi_caps,
+                                                         gboolean have_ap,
+                                                         gboolean adhoc,
+                                                         guint32 ap_flags,
+                                                         guint32 ap_wpa,
+                                                         guint32 ap_rsn);

Given a set of device capabilities, and a desired security type to check against, determines whether the combination of device, desired security @@ -645,12 +653,12 @@ compatible with the desired type, FALSE


nm_utils_ip4_addresses_from_gvalue ()

-
GSList *            nm_utils_ip4_addresses_from_gvalue  (const GValue *value);
+
GSList *            nm_utils_ip4_addresses_from_gvalue  (const GValue *value);

-Utility function to convert a GPtrArray of GArrays of guint32s representing +Utility function to convert a GPtrArray of GArrays of guint32s representing a list of NetworkManager IPv4 addresses (which is a tuple of address, gateway, and prefix) into a GSList of NMIP4Address objects. The specific format of -this serialization is not guaranteed to be stable and the GArray may be +this serialization is not guaranteed to be stable and the GArray may be extended in the future.

list :

a GSList +a GSList
@@ -663,7 +671,7 @@ extended in the future. - @@ -672,10 +680,10 @@ extended in the future.

nm_utils_ip4_addresses_to_gvalue ()

-
void                nm_utils_ip4_addresses_to_gvalue    (GSList *list,
-                                                         GValue *value);
+
void                nm_utils_ip4_addresses_to_gvalue    (GSList *list,
+                                                         GValue *value);

-Utility function to convert a GSList of NMIP4Address objects into a +Utility function to convert a GSList of NMIP4Address objects into a GPtrArray of GArrays of guint32s representing a list of NetworkManager IPv4 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 @@ -691,9 +699,9 @@ extended in the future.

- @@ -702,7 +710,7 @@ which should be unset by the caller (when no longer needed) with

nm_utils_ip4_routes_from_gvalue ()

-
GSList *            nm_utils_ip4_routes_from_gvalue     (const GValue *value);
+
GSList *            nm_utils_ip4_routes_from_gvalue     (const GValue *value);

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, @@ -720,7 +728,7 @@ extended in the future.

- @@ -729,10 +737,10 @@ extended in the future.

nm_utils_ip4_routes_to_gvalue ()

-
void                nm_utils_ip4_routes_to_gvalue       (GSList *list,
-                                                         GValue *value);
+
void                nm_utils_ip4_routes_to_gvalue       (GSList *list,
+                                                         GValue *value);

-Utility function to convert a GSList of NMIP4Route objects into a +Utility function to convert a GSList of NMIP4Route 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 @@ -748,9 +756,9 @@ be extended in the future.

- @@ -759,7 +767,7 @@ which should be unset by the caller (when no longer needed) with

nm_utils_ip4_netmask_to_prefix ()

-
guint32             nm_utils_ip4_netmask_to_prefix      (guint32 netmask);
+
guint32             nm_utils_ip4_netmask_to_prefix      (guint32 netmask);

Returns :

a newly allocated GSList of NMIP4Address objects + a newly allocated GSList of NMIP4Address objects

value :

a pointer to a GValue into which to place the converted addresses, +a pointer to a GValue into which to place the converted addresses, which should be unset by the caller (when no longer needed) with -g_value_unset(). +g_value_unset().

Returns :

a newly allocated GSList of NMIP4Route objects + a newly allocated GSList of NMIP4Route objects

value :

a pointer to a GValue into which to place the converted routes, +a pointer to a GValue into which to place the converted routes, which should be unset by the caller (when no longer needed) with -g_value_unset(). +g_value_unset().
@@ -779,7 +787,7 @@ which should be unset by the caller (when no longer needed) with

nm_utils_ip4_prefix_to_netmask ()

-
guint32             nm_utils_ip4_prefix_to_netmask      (guint32 prefix);
+
guint32             nm_utils_ip4_prefix_to_netmask      (guint32 prefix);
@@ -799,7 +807,7 @@ which should be unset by the caller (when no longer needed) with

nm_utils_ip4_get_default_prefix ()

-
guint32             nm_utils_ip4_get_default_prefix     (guint32 ip);
+
guint32             nm_utils_ip4_get_default_prefix     (guint32 ip);

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 @@ -825,12 +833,12 @@ falls in the predefined classes.


nm_utils_ip6_addresses_from_gvalue ()

-
GSList *            nm_utils_ip6_addresses_from_gvalue  (const GValue *value);
+
GSList *            nm_utils_ip6_addresses_from_gvalue  (const GValue *value);

-Utility function to convert a GPtrArray of GValueArrays of (GArray of guchars) and guint32 +Utility function to convert a GPtrArray of GValueArrays of (GArray of guchars) and guint32 representing a list of NetworkManager IPv6 addresses (which is a tuple of address, prefix, and gateway), into a GSList of NMIP6Address objects. The specific format of -this serialization is not guaranteed to be stable and the GValueArray may be +this serialization is not guaranteed to be stable and the GValueArray may be extended in the future.

@@ -843,7 +851,7 @@ extended in the future. - @@ -852,10 +860,10 @@ extended in the future.

nm_utils_ip6_addresses_to_gvalue ()

-
void                nm_utils_ip6_addresses_to_gvalue    (GSList *list,
-                                                         GValue *value);
+
void                nm_utils_ip6_addresses_to_gvalue    (GSList *list,
+                                                         GValue *value);

-Utility function to convert a GSList of NMIP6Address objects into a +Utility function to convert a GSList of NMIP6Address objects into a GPtrArray of GValueArrays representing a list of NetworkManager IPv6 addresses (which is a tuple of address, prefix, and gateway). The specific format of this serialization is not guaranteed to be stable and may be extended in the @@ -871,9 +879,9 @@ future.

- @@ -882,7 +890,7 @@ which should be unset by the caller (when no longer needed) with

nm_utils_ip6_routes_from_gvalue ()

-
GSList *            nm_utils_ip6_routes_from_gvalue     (const GValue *value);
+
GSList *            nm_utils_ip6_routes_from_gvalue     (const GValue *value);

Utility function GPtrArray of GValueArrays of (GArray or guchars), guint32, (GArray of guchars), and guint32 representing a list of NetworkManager IPv6 @@ -901,7 +909,7 @@ is not guaranteed to be stable and may be extended in the future.

- @@ -910,10 +918,10 @@ is not guaranteed to be stable and may be extended in the future.

nm_utils_ip6_routes_to_gvalue ()

-
void                nm_utils_ip6_routes_to_gvalue       (GSList *list,
-                                                         GValue *value);
+
void                nm_utils_ip6_routes_to_gvalue       (GSList *list,
+                                                         GValue *value);

-Utility function to convert a GSList of NMIP6Route objects into a GPtrArray of +Utility function to convert a GSList of NMIP6Route 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 @@ -929,9 +937,9 @@ guaranteed to be stable and may be extended in the future.

- @@ -940,7 +948,7 @@ which should be unset by the caller (when no longer needed) with

nm_utils_ip6_dns_from_gvalue ()

-
GSList *            nm_utils_ip6_dns_from_gvalue        (const GValue *value);
+
GSList *            nm_utils_ip6_dns_from_gvalue        (const GValue *value);

Returns :

a newly allocated GSList of NMIP6Address objects + a newly allocated GSList of NMIP6Address objects

value :

a pointer to a GValue into which to place the converted addresses, +a pointer to a GValue into which to place the converted addresses, which should be unset by the caller (when no longer needed) with -g_value_unset(). +g_value_unset().

Returns :

a newly allocated GSList of NMIP6Route objects + a newly allocated GSList of NMIP6Route objects

value :

a pointer to a GValue into which to place the converted routes, +a pointer to a GValue into which to place the converted routes, which should be unset by the caller (when no longer needed) with -g_value_unset(). +g_value_unset().
@@ -962,8 +970,8 @@ which should be unset by the caller (when no longer needed) with

nm_utils_ip6_dns_to_gvalue ()

-
void                nm_utils_ip6_dns_to_gvalue          (GSList *list,
-                                                         GValue *value);
+
void                nm_utils_ip6_dns_to_gvalue          (GSList *list,
+                                                         GValue *value);

@@ -991,7 +999,7 @@ which should be unset by the caller (when no longer needed) with

Returns :

a newly allocated UUID suitable for use as the NMSettingConnection -object's "id": property. Should be freed with g_free() +object's "id": property. Should be freed with g_free()
@@ -1023,10 +1031,10 @@ object's

nm_utils_rsa_key_encrypt ()

-
GByteArray *        nm_utils_rsa_key_encrypt            (const GByteArray *data,
+
GByteArray *        nm_utils_rsa_key_encrypt            (const GByteArray *data,
                                                          const char *in_password,
                                                          char **out_password,
-                                                         GError **error);
+ GError **error);

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 @@ -1065,10 +1073,128 @@ certificate/private key file.

+
+
+

nm_utils_wifi_freq_to_channel ()

+
guint32             nm_utils_wifi_freq_to_channel       (guint32 freq);
+

+Utility function to translate a WiFi frequency to its corresponding channel. +

+
++ + + + + + + + + + +

freq :

frequency +

Returns :

the channel represented by the frequency or 0 +
+
+
+
+

nm_utils_wifi_channel_to_freq ()

+
guint32             nm_utils_wifi_channel_to_freq       (guint32 channel,
+                                                         const char *band);
+

+Utility function to translate a WiFi channel to its corresponding frequency. +

+
++ + + + + + + + + + + + + + +

channel :

channel +

band :

frequency band for wireless ("a" or "bg") +

Returns :

the frequency represented by the channel of the band, + or -1 when the freq is invalid, or 0 when the band + is invalid +
+
+
+
+

nm_utils_wifi_find_next_channel ()

+
guint32             nm_utils_wifi_find_next_channel     (guint32 channel,
+                                                         int direction,
+                                                         char *band);
+

+Utility function to find out next/previous WiFi channel for a channel. +

+
++ + + + + + + + + + + + + + + + + + +

channel :

current channel +

direction :

whether going downward (0 or less) or upward (1 or more) +

band :

frequency band for wireless ("a" or "bg") +

Returns :

the next channel in the specified direction or 0 +
+
+
+
+

nm_utils_wifi_is_channel_valid ()

+
gboolean            nm_utils_wifi_is_channel_valid      (guint32 channel,
+                                                         const char *band);
+

+Utility function to verify WiFi channel validity. +

+
++ + + + + + + + + + + + + + +

channel :

channel +

band :

frequency band for wireless ("a" or "bg") +

Returns :

TRUE or FALSE +
+
+ Generated by GTK-Doc V1.15
\ No newline at end of file -- cgit 1.3.0-6-gf8a5