diff options
Diffstat (limited to 'src/nm-ip4-config.h')
-rw-r--r-- | src/nm-ip4-config.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/nm-ip4-config.h b/src/nm-ip4-config.h index 1113c9928..7db858b7b 100644 --- a/src/nm-ip4-config.h +++ b/src/nm-ip4-config.h @@ -75,6 +75,25 @@ nm_ip_config_iter_ip4_route_next (NMDedupMultiIter *ipconf_iter, const NMPlatfor /*****************************************************************************/ +static inline gboolean +nm_ip_config_best_default_route_is (const NMPObject *obj) +{ + const NMPlatformIPRoute *r = NMP_OBJECT_CAST_IP_ROUTE (obj); + + /* return whether @obj is considered a default-route, that is, a route + * as added by NetworkManager. E.g. if the route is not in the main-table, + * it's considered just like a regular route. */ + return r + && !r->table_coerced + && NM_PLATFORM_IP_ROUTE_IS_DEFAULT (r); +} + +const NMPObject *_nm_ip_config_best_default_route_find_better (const NMPObject *obj_cur, const NMPObject *obj_cmp); +gboolean _nm_ip_config_best_default_route_set (const NMPObject **best_default_route, const NMPObject *new_candidate); +gboolean _nm_ip_config_best_default_route_merge (const NMPObject **best_default_route, const NMPObject *new_candidate); + +/*****************************************************************************/ + gboolean nm_ip_config_obj_id_equal_ip4_address (const NMPlatformIP4Address *a, const NMPlatformIP4Address *b); gboolean nm_ip_config_obj_id_equal_ip6_address (const NMPlatformIP6Address *a, @@ -163,6 +182,9 @@ gboolean nm_ip4_config_has_gateway (const NMIP4Config *self); guint32 nm_ip4_config_get_gateway (const NMIP4Config *self); gint64 nm_ip4_config_get_route_metric (const NMIP4Config *self); +const NMPObject *nm_ip4_config_best_default_route_get (const NMIP4Config *self); +const NMPObject *_nm_ip4_config_best_default_route_find (const NMIP4Config *self); + const NMDedupMultiHeadEntry *nm_ip4_config_lookup_addresses (const NMIP4Config *self); void nm_ip4_config_reset_addresses (NMIP4Config *self); void nm_ip4_config_add_address (NMIP4Config *self, const NMPlatformIP4Address *address); @@ -234,6 +256,11 @@ NMIPConfigSource nm_ip4_config_get_mtu_source (const NMIP4Config *self); void nm_ip4_config_set_metered (NMIP4Config *self, gboolean metered); gboolean nm_ip4_config_get_metered (const NMIP4Config *self); +const NMPObject *nm_ip4_config_nmpobj_lookup (const NMIP4Config *self, + const NMPObject *needle); +gboolean nm_ip4_config_nmpobj_remove (NMIP4Config *self, + const NMPObject *needle); + void nm_ip4_config_hash (const NMIP4Config *self, GChecksum *sum, gboolean dns_only); gboolean nm_ip4_config_equal (const NMIP4Config *a, const NMIP4Config *b); |