Module functions

Module functions 

Source

Functions§

conn_wireguard_importv1_40
filename
ethtool_optname_is_featurev1_20
Checks whether @optname is a valid option name for an offload feature.
utils_ap_mode_security_valid
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.
utils_base64secret_decodev1_16
base64_key
utils_bin2hexstr
Converts the byte array @src into a hexadecimal string. If @final_len is greater than -1, the returned string is terminated at that index (returned_string[final_len] == ‘\0’),
utils_bond_mode_int_to_stringv1_2
Convert bonding mode from integer value to descriptive name. See https://www.kernel.org/doc/Documentation/networking/bonding.txt for available modes.
utils_bond_mode_string_to_intv1_2
Convert bonding mode from string representation to numeric value. See https://www.kernel.org/doc/Documentation/networking/bonding.txt for available modes. The @mode string can be either a descriptive name or a number (as string).
utils_check_virtual_device_compatibility
Determines if a connection of type @virtual_type can (in the general case) work with connections of type @other_type.
utils_ensure_gtypesv1_42
This ensures that all NMSetting GTypes are created. For example, after this call, g_type_from_name(“NMSettingConnection”) will work.
utils_enum_from_strv1_2
Converts a string to the matching enum value.
utils_enum_get_valuesv1_2
Returns the list of possible values for a given enum.
utils_enum_to_strv1_2
Converts an enum value to its string representation. If the enum is a G_TYPE_FLAGS the function returns a comma-separated list of matching values. If the value has no corresponding string representation, it is converted to a number. For enums it is converted to a decimal number, for flags to an (unsigned) hex number.
utils_escape_ssid
This function does a quick printable character conversion of the SSID, simply 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.
utils_file_is_certificate
Tests if @filename has a valid extension for an X.509 certificate file (“.cer”, “.crt”, “.der”, or “.pem”), and contains a certificate in a format recognized by NetworkManager.
utils_file_is_pkcs12
Tests if @filename is a PKCS#12 file.
utils_file_is_private_key
Tests if @filename has a valid extension for an X.509 private key file (“.der”, “.key”, “.pem”, or “.p12”), and contains a private key in a format recognized by NetworkManager.
utils_get_timestamp_msecv1_12
Gets current time in milliseconds of CLOCK_BOOTTIME.
utils_hwaddr_aton
Parses @asc and converts it to binary form in @buffer. Bytes in @asc can be separated by colons (:), or hyphens (-), but not mixed.
utils_hwaddr_canonical
Parses @asc to see if it is a valid hardware address of the given length, and if so, returns it in canonical form (uppercase, with leading 0s as needed, and with colons rather than hyphens).
utils_hwaddr_len
Returns the length in octets of a hardware address of type @type_.
utils_hwaddr_ntoa
Converts @addr to textual form.
utils_hwaddr_valid
Parses @asc to see if it is a valid hardware address of the given length.
utils_iface_valid_nameDeprecated
Validate the network interface name.
utils_inet4_ntop
Wrapper for inet_ntop.
utils_ip4_get_default_prefix
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.
utils_ip4_netmask_to_prefix
netmask
utils_ip4_prefix_to_netmask
prefix
utils_ipaddr_valid
Checks if @ip contains a valid IP address of the given family.
utils_is_empty_ssid
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.
utils_is_json_objectv1_6
str
utils_is_uuid
Checks if @str is a UUID
utils_is_valid_iface_namev1_6
Validate the network interface name.
utils_same_ssid
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.
utils_security_valid
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.
utils_sriov_vf_from_strv1_14
Converts a string to a SR-IOV virtual function object.
utils_sriov_vf_to_strv1_14
Converts a SR-IOV virtual function object to its string representation.
utils_ssid_to_utf8
Wi-Fi 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.
utils_tc_action_from_strv1_12
Parses the tc style string action representation of the queueing discipline to a NMTCAction instance. Supports a subset of the tc language.
utils_tc_action_to_strv1_12
Turns the NMTCAction into a tc style string representation of the queueing discipline.
utils_tc_qdisc_from_strv1_12
Parses the tc style string qdisc representation of the queueing discipline to a NMTCQdisc instance. Supports a subset of the tc language.
utils_tc_qdisc_to_strv1_12
Turns the NMTCQdisc into a tc style string representation of the queueing discipline.
utils_tc_tfilter_from_strv1_12
Parses the tc style string tfilter representation of the queueing discipline to a NMTCTfilter instance. Supports a subset of the tc language.
utils_tc_tfilter_to_strv1_12
Turns the NMTCTfilter into a tc style string representation of the queueing discipline.
utils_uuid_generate
Returns
utils_versionv1_6
Returns
utils_wep_key_valid
Checks if @key is a valid WEP key
utils_wifi_2ghz_freqsv1_2
Utility function to return 2.4 GHz Wi-Fi frequencies (802.11bg band).
utils_wifi_5ghz_freqsv1_2
Utility function to return 5 GHz Wi-Fi frequencies (802.11a band).
utils_wifi_channel_to_freq
Utility function to translate a Wi-Fi channel to its corresponding frequency.
utils_wifi_find_next_channel
Utility function to find out next/previous Wi-Fi channel for a channel.
utils_wifi_freq_to_channel
Utility function to translate a Wi-Fi frequency to its corresponding channel.
utils_wifi_is_channel_valid
Utility function to verify Wi-Fi channel validity.
utils_wifi_strength_bars
Converts @strength into a 4-character-wide graphical representation of strength suitable for printing to stdout.
utils_wpa_psk_valid
Checks if @psk is a valid WPA PSK