summaryrefslogtreecommitdiff
path: root/src/platform/nmp-object.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/platform/nmp-object.h')
-rw-r--r--src/platform/nmp-object.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/platform/nmp-object.h b/src/platform/nmp-object.h
index f0665ae7a5..30d9697a15 100644
--- a/src/platform/nmp-object.h
+++ b/src/platform/nmp-object.h
@@ -161,6 +161,11 @@ typedef enum { /*< skip >*/
* cache-resync. */
NMP_CACHE_ID_TYPE_ROUTES_BY_WEAK_ID,
+ /* a filter for objects that track an explicit address family.
+ *
+ * Note that currently on NMPObjectRoutingRule is indexed by this filter. */
+ NMP_CACHE_ID_TYPE_OBJECT_BY_ADDR_FAMILY,
+
__NMP_CACHE_ID_TYPE_MAX,
NMP_CACHE_ID_TYPE_MAX = __NMP_CACHE_ID_TYPE_MAX - 1,
} NMPCacheIdType;
@@ -312,6 +317,10 @@ typedef struct {
} NMPObjectIP6Route;
typedef struct {
+ NMPlatformRoutingRule _public;
+} NMPObjectRoutingRule;
+
+typedef struct {
NMPlatformQdisc _public;
} NMPObjectQdisc;
@@ -379,6 +388,9 @@ struct _NMPObject {
NMPObjectIP4Route _ip4_route;
NMPObjectIP6Route _ip6_route;
+ NMPlatformRoutingRule routing_rule;
+ NMPObjectRoutingRule _routing_rule;
+
NMPlatformQdisc qdisc;
NMPObjectQdisc _qdisc;
NMPlatformTfilter tfilter;
@@ -582,6 +594,14 @@ _NMP_OBJECT_TYPE_IS_OBJ_WITH_IFINDEX (NMPObjectType obj_type)
_obj ? &NM_CONSTCAST (NMPObject, _obj)->ip6_route : NULL; \
})
+#define NMP_OBJECT_CAST_ROUTING_RULE(obj) \
+ ({ \
+ typeof (obj) _obj = (obj); \
+ \
+ nm_assert (!_obj || NMP_OBJECT_GET_TYPE ((const NMPObject *) _obj) == NMP_OBJECT_TYPE_ROUTING_RULE); \
+ _obj ? &NM_CONSTCAST (NMPObject, _obj)->routing_rule : NULL; \
+ })
+
#define NMP_OBJECT_CAST_QDISC(obj) \
({ \
typeof (obj) _obj = (obj); \
@@ -751,6 +771,9 @@ const NMPLookup *nmp_lookup_init_ip6_route_by_weak_id (NMPLookup *lookup,
guint32 metric,
const struct in6_addr *src,
guint8 src_plen);
+const NMPLookup *nmp_lookup_init_object_by_addr_family (NMPLookup *lookup,
+ NMPObjectType obj_type,
+ int addr_family);
GArray *nmp_cache_lookup_to_array (const NMDedupMultiHeadEntry *head_entry,
NMPObjectType obj_type,