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.
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’),
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).
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.