mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-03 16:00:34 +01:00
libnm: add nm_lldp_neighbor_get_attr_value()
The function provides access to the GVariant representing a LLDP attribute.
This commit is contained in:
parent
8cdc011cd1
commit
937796f6ea
3 changed files with 24 additions and 0 deletions
|
|
@ -1536,6 +1536,7 @@ global:
|
|||
nm_bridge_vlan_set_untagged;
|
||||
nm_bridge_vlan_to_str;
|
||||
nm_bridge_vlan_unref;
|
||||
nm_lldp_neighbor_get_attr_value;
|
||||
nm_setting_bridge_add_vlan;
|
||||
nm_setting_bridge_clear_vlans;
|
||||
nm_setting_bridge_get_num_vlans;
|
||||
|
|
|
|||
|
|
@ -2812,6 +2812,27 @@ nm_lldp_neighbor_get_attr_uint_value (NMLldpNeighbor *neighbor, const char *name
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* nm_lldp_neighbor_get_attr_value:
|
||||
* @neighbor: the #NMLldpNeighbor
|
||||
* @name: the attribute name
|
||||
*
|
||||
* Gets the value (as a GVariant) of attribute with name @name on @neighbor
|
||||
*
|
||||
* Returns: (transfer none): the value or %NULL if the attribute with @name was
|
||||
* not found.
|
||||
*
|
||||
* Since: 1.18
|
||||
**/
|
||||
GVariant *
|
||||
nm_lldp_neighbor_get_attr_value (NMLldpNeighbor *neighbor, const char *name)
|
||||
{
|
||||
g_return_val_if_fail (neighbor, FALSE);
|
||||
g_return_val_if_fail (name && name[0], FALSE);
|
||||
|
||||
return g_hash_table_lookup (neighbor->attrs, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* nm_lldp_neighbor_get_attr_type:
|
||||
* @neighbor: the #NMLldpNeighbor
|
||||
|
|
|
|||
|
|
@ -234,6 +234,8 @@ gboolean nm_lldp_neighbor_get_attr_uint_value (NMLldpNeighbor *neighbor, const c
|
|||
guint *out_value);
|
||||
NM_AVAILABLE_IN_1_2
|
||||
const GVariantType *nm_lldp_neighbor_get_attr_type (NMLldpNeighbor *neighbor, const char *name);
|
||||
NM_AVAILABLE_IN_1_18
|
||||
GVariant *nm_lldp_neighbor_get_attr_value (NMLldpNeighbor *neighbor, const char *name);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue