l3cfg: add nm_netns_get_l3cfg() accessor
This is more for debugging and testing. Usually you want to call nm_netns_access_l3cfg() which creates a NML3Cfg instance, if necessary.
This commit is contained in:
@@ -125,6 +125,19 @@ _l3cfg_weak_notify(gpointer data, GObject *where_the_object_was)
|
||||
g_object_unref(self);
|
||||
}
|
||||
|
||||
NML3Cfg *
|
||||
nm_netns_get_l3cfg(NMNetns *self, int ifindex)
|
||||
{
|
||||
NMNetnsPrivate *priv;
|
||||
|
||||
g_return_val_if_fail(NM_IS_NETNS(self), NULL);
|
||||
g_return_val_if_fail(ifindex > 0, NULL);
|
||||
|
||||
priv = NM_NETNS_GET_PRIVATE(self);
|
||||
|
||||
return g_hash_table_lookup(priv->l3cfgs, &ifindex);
|
||||
}
|
||||
|
||||
NML3Cfg *
|
||||
nm_netns_access_l3cfg(NMNetns *self, int ifindex)
|
||||
{
|
||||
|
@@ -31,6 +31,8 @@ struct _NMDedupMultiIndex *nm_netns_get_multi_idx(NMNetns *self);
|
||||
|
||||
#define NM_NETNS_GET (nm_netns_get())
|
||||
|
||||
NML3Cfg *nm_netns_get_l3cfg(NMNetns *self, int ifindex);
|
||||
|
||||
NML3Cfg *nm_netns_access_l3cfg(NMNetns *netns, int ifindex);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
Reference in New Issue
Block a user