- public bool ap_mode_security_valid (SecurityType type, DeviceWifiCapabilities wifi_caps)
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.
- public bool base64secret_decode (string base64_key, size_t required_key_len, uint8? out_key)
- public string bin2hexstr (uint8[] src, int final_len)
Converts the byte array src
into a hexadecimal string.
- public unowned string bond_mode_int_to_string (int mode)
Convert bonding mode from integer value to descriptive name.
- public int bond_mode_string_to_int (string mode)
Convert bonding mode from string representation to numeric value.
- public bool check_virtual_device_compatibility (Type virtual_type, Type other_type)
Determines if a connection of type virtual_type
can (in
the general case) work with connections of type other_type
.
- public bool enum_from_str (Type type, string str, out int out_value, out string err_token)
Converts a string to the matching enum value.
- public (unowned string)[] enum_get_values (Type type, int from, int to)
Returns the list of possible values for a given enum.
- public string enum_to_str (Type type, int value)
Converts an enum value to its string representation.
- public unowned string escape_ssid (uint8[] 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.
- public bool file_is_certificate (string filename)
Tests if filename
has a valid extension for an X.509
certificate file (".
- public bool file_is_pkcs12 (string filename)
Tests if filename
is a PKCS#<!-- -->12 file.
- public bool file_is_private_key (string filename, out bool out_encrypted)
Tests if filename
has a valid extension for an X.509
private key file (".
- public unowned string file_search_in_paths (string progname, string? try_first, string? paths, FileTest file_test_flags, UtilsFileSearchInPathsPredicate predicate) throws Error
Searches for a progname
file in a list of search
paths
.
- public string format_variant_attributes (HashTable<void*,void*> attributes, char attr_separator, char key_value_separator)
- public int64 get_timestamp_msec ()
- public Bytes hexstr2bin (string hex)
Converts a hexadecimal string hex
into an array of
bytes.
- public ByteArray hwaddr_atoba (string asc, size_t length)
Parses asc
and converts it to binary form in a
ByteArray.
- public uint8 hwaddr_aton (string asc, uint8[] buffer)
Parses asc
and converts it to binary form in
buffer
.
- public string hwaddr_canonical (string asc, ssize_t length)
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
).
- public size_t hwaddr_len (int type)
Returns the length in octets of a hardware address of type
type
.
- public bool hwaddr_matches (void* hwaddr1, ssize_t hwaddr1_len, void* hwaddr2, ssize_t hwaddr2_len)
Generalized hardware address comparison function.
- public string hwaddr_ntoa (uint8[] addr)
Converts addr
to textual form.
- public bool hwaddr_valid (string asc, ssize_t length)
Parses asc
to see if it is a valid hardware address of
the given length.
- public bool iface_valid_name (string? name)
Validate the network interface name.
- public GenericArray<IPAddress> ip4_addresses_from_variant (Variant value, out string out_gateway)
Utility function to convert a Variant of
type 'aau' representing a list of NetworkManager IPv4 addresses (which are tuples of address, prefix, and gateway) into a
GenericArray of IPAddress objects.
- public unowned Variant ip4_addresses_to_variant (GenericArray<IPAddress> addresses, string? gateway)
Utility function to convert a GenericArray
of IPAddress objects representing IPv4 addresses into a
Variant of type 'aau' representing an array of NetworkManager IPv4 addresses (which are tuples of address, prefix, and
gateway).
- public string ip4_dns_from_variant (Variant value)
Utility function to convert a Variant of
type 'au' representing a list of IPv4 addresses into an array of IP address strings.
- public unowned Variant ip4_dns_to_variant (string dns)
Utility function to convert an array of IP address strings int a
Variant of type 'au' representing an array of IPv4 addresses.
- public uint32 ip4_get_default_prefix (uint32 ip)
When the Internet was originally set up, various ranges of IP
addresses were segmented into three network classes: A, B, and C.
- public uint32 ip4_netmask_to_prefix (uint32 netmask)
- public uint32 ip4_prefix_to_netmask (uint32 prefix)
- public GenericArray<IPRoute> ip4_routes_from_variant (Variant value)
Utility function to convert a Variant of
type 'aau' representing an array of NetworkManager IPv4 routes (which are tuples of route, prefix, next hop, and metric) into a
GenericArray of IPRoute objects.
- public unowned Variant ip4_routes_to_variant (GenericArray<IPRoute> routes)
Utility function to convert a GenericArray
of IPRoute objects representing IPv4 routes into a Variant
of type 'aau' representing an array of NetworkManager IPv4 routes (which are tuples of route, prefix, next hop, and metric).
- public GenericArray<IPAddress> ip6_addresses_from_variant (Variant value, out string out_gateway)
Utility function to convert a Variant of
type 'a(ayuay)' representing a list of NetworkManager IPv6 addresses (which are tuples of address, prefix, and gateway) into a
GenericArray of IPAddress objects.
- public unowned Variant ip6_addresses_to_variant (GenericArray<IPAddress> addresses, string? gateway)
Utility function to convert a GenericArray
of IPAddress objects representing IPv6 addresses into a
Variant of type 'a(ayuay)' representing an array of NetworkManager IPv6 addresses (which are tuples of address, prefix, and
gateway).
- public string ip6_dns_from_variant (Variant value)
Utility function to convert a Variant of
type 'aay' representing a list of IPv6 addresses into an array of IP address strings.
- public unowned Variant ip6_dns_to_variant (string dns)
Utility function to convert an array of IP address strings int a
Variant of type 'aay' representing an array of IPv6 addresses.
- public GenericArray<IPRoute> ip6_routes_from_variant (Variant value)
Utility function to convert a Variant of
type 'a(ayuayu)' representing an array of NetworkManager IPv6 routes (which are tuples of route, prefix, next hop, and metric) into
a GenericArray of IPRoute objects.
- public unowned Variant ip6_routes_to_variant (GenericArray<IPRoute> routes)
Utility function to convert a GenericArray
of IPRoute objects representing IPv6 routes into a Variant
of type 'a(ayuayu)' representing an array of NetworkManager IPv6 routes (which are tuples of route, prefix, next hop, and
metric).
- public GenericArray<IPAddress> ip_addresses_from_variant (Variant value, int family)
Utility function to convert a Variant
representing a list of new-style NetworkManager IPv4 or IPv6 addresses (as described in the documentation for
ip_addresses_to_variant) into a GenericArray
of IPAddress objects.
- public unowned Variant ip_addresses_to_variant (GenericArray<IPAddress> addresses)
Utility function to convert a GenericArray
of IPAddress objects representing IPv4 or IPv6 addresses into a
Variant of type 'aa{sv}' representing an array of new-style NetworkManager IP addresses.
- public GenericArray<IPRoute> ip_routes_from_variant (Variant value, int family)
Utility function to convert a Variant
representing a list of new-style NetworkManager IPv4 or IPv6 addresses (which are tuples of destination, prefix, next hop, metric,
and additional attributes) into a GenericArray of IPRoute
objects.
- public unowned Variant ip_routes_to_variant (GenericArray<IPRoute> routes)
Utility function to convert a GenericArray
of IPRoute objects representing IPv4 or IPv6 routes into a
Variant of type 'aa{sv}' representing an array of new-style NetworkManager IP routes (which are tuples of destination,
prefix, next hop, metric, and additional attributes).
- public bool ipaddr_valid (int family, string ip)
Checks if ip
contains a valid IP address of the given
family.
- public bool is_empty_ssid (uint8[] ssid)
Different manufacturers use different mechanisms for not
broadcasting the AP's SSID.
- public bool is_json_object (string str) throws Error
- public bool is_uuid (string? str)
Checks if str
is a UUID
- public bool is_valid_iface_name (string? name) throws Error
Validate the network interface name.
- public HashTable<string,Variant> parse_variant_attributes (string string, char attr_separator, char key_value_separator, bool ignore_unknown, VariantAttributeSpec spec) throws Error
Parse attributes from a string.
- public void print (int output_mode, string msg)
The only purpose of this function is to give access to
print or printerr from pygobject.
- public bool same_ssid (uint8[] ssid1, uint8[] ssid2, bool 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, but this behavior was problematic (SSIDs are simply
byte arrays, not strings) and thus was changed.
- public bool security_valid (SecurityType type, DeviceWifiCapabilities wifi_caps, bool have_ap, bool adhoc, @80211ApFlags ap_flags, @80211ApSecurityFlags ap_wpa, @80211ApSecurityFlags ap_rsn)
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.
- public SriovVF sriov_vf_from_str (string str) throws Error
Converts a string to a SR-IOV virtual function object.
- public string sriov_vf_to_str (SriovVF vf, bool omit_index) throws Error
Converts a SR-IOV virtual function object to its string
representation.
- public string ssid_to_utf8 (uint8[] ssid)
Wi-Fi SSIDs are byte arrays, they are _not_ strings.
- public TCAction tc_action_from_str (string str) throws Error
Parses the tc style string action representation of the queueing
discipline to a nmtcaction instance.
- public string tc_action_to_str (TCAction action) throws Error
Turns the nmtcaction into a tc
style string representation of the queueing discipline.
- public TCQdisc tc_qdisc_from_str (string str) throws Error
Parses the tc style string qdisc representation of the queueing
discipline to a nmtcqdisc instance.
- public string tc_qdisc_to_str (TCQdisc qdisc) throws Error
Turns the nmtcqdisc into a tc
style string representation of the queueing discipline.
- public TCTfilter tc_tfilter_from_str (string str) throws Error
Parses the tc style string tfilter representation of the queueing
discipline to a nmtctfilter instance.
- public string tc_tfilter_to_str (TCTfilter tfilter) throws Error
Turns the nmtctfilter into a tc
style string representation of the queueing discipline.
- public string uuid_generate ()
- public uint version ()
- public bool wep_key_valid (string key, WepKeyType wep_type)
Checks if key
is a valid WEP key
- public uint wifi_2ghz_freqs ()
Utility function to return 2.4 GHz Wi-Fi frequencies (802.11bg band)
.
- public uint wifi_5ghz_freqs ()
Utility function to return 5 GHz Wi-Fi frequencies (802.11a band).
- public uint32 wifi_channel_to_freq (uint32 channel, string band)
Utility function to translate a Wi-Fi channel to its corresponding
frequency.
- public uint32 wifi_find_next_channel (uint32 channel, int direction, string band)
Utility function to find out next/previous Wi-Fi channel for a
channel.
- public uint32 wifi_freq_to_channel (uint32 freq)
Utility function to translate a Wi-Fi frequency to its corresponding
channel.
- public bool wifi_is_channel_valid (uint32 channel, string band)
Utility function to verify Wi-Fi channel validity.
- public unowned string wifi_strength_bars (uint8 strength)
Converts strength
into a 4-character-wide graphical
representation of strength suitable for printing to stdout.
- public bool wpa_psk_valid (string psk)
Checks if psk
is a valid WPA PSK