mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-09 01:30:36 +01:00
l3cfg: add nm_l3_config_data_lookup_address_6() helper
This commit is contained in:
parent
62f2c5a879
commit
dbfb7fe2d7
2 changed files with 25 additions and 0 deletions
|
|
@ -623,6 +623,28 @@ nm_l3_config_data_lookup_obj (const NML3ConfigData *self,
|
|||
obj);
|
||||
}
|
||||
|
||||
const NMPlatformIP6Address *
|
||||
nm_l3_config_data_lookup_address_6 (const NML3ConfigData *self,
|
||||
const struct in6_addr *addr)
|
||||
{
|
||||
const NMDedupMultiEntry *head;
|
||||
NMPObject obj_stack;
|
||||
|
||||
nm_assert (_NM_IS_L3_CONFIG_DATA (self, TRUE));
|
||||
|
||||
/* this works only, because the primary key for a Ipv6 address is the
|
||||
* ifindex and the "struct in6_addr". */
|
||||
nmp_object_stackinit_id_ip6_address (&obj_stack,
|
||||
self->ifindex,
|
||||
addr);
|
||||
|
||||
head = nm_l3_config_data_lookup_obj (self, &obj_stack);
|
||||
if (!head)
|
||||
return NULL;
|
||||
|
||||
return NMP_OBJECT_CAST_IP6_ADDRESS (head->obj);
|
||||
}
|
||||
|
||||
const NMPObject *
|
||||
nmtst_l3_config_data_get_obj_at (const NML3ConfigData *self,
|
||||
NMPObjectType obj_type,
|
||||
|
|
|
|||
|
|
@ -188,6 +188,9 @@ const NMDedupMultiIdxType *nm_l3_config_data_lookup_index (const NML3ConfigData
|
|||
const NMDedupMultiEntry *nm_l3_config_data_lookup_obj (const NML3ConfigData *self,
|
||||
const NMPObject *obj);
|
||||
|
||||
const NMPlatformIP6Address *nm_l3_config_data_lookup_address_6 (const NML3ConfigData *self,
|
||||
const struct in6_addr *addr);
|
||||
|
||||
const NMDedupMultiEntry *nm_l3_config_data_lookup_route_obj (const NML3ConfigData *self,
|
||||
const NMPObject *needle);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue