summaryrefslogtreecommitdiff
path: root/lib/zebra.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/zebra.h')
-rw-r--r--lib/zebra.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/zebra.h b/lib/zebra.h
index 98428eaab2..c2d135bbeb 100644
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -365,6 +365,22 @@ struct in_pktinfo {
_a < _b ? _a : _b; \
})
+#ifndef offsetof
+#ifdef __compiler_offsetof
+#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
+#else
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+#endif
+
+#ifndef container_of
+#define container_of(ptr, type, member) \
+ ({ \
+ const typeof(((type *)0)->member) *__mptr = (ptr); \
+ (type *)((char *)__mptr - offsetof(type, member)); \
+ })
+#endif
+
#define ZEBRA_NUM_OF(x) (sizeof (x) / sizeof (x[0]))
/* For old definition. */
@@ -414,6 +430,7 @@ extern const char *zserv_command_string(unsigned int command);
#define ZEBRA_FLAG_SCOPE_LINK 0x100
#define ZEBRA_FLAG_FIB_OVERRIDE 0x200
#define ZEBRA_FLAG_EVPN_ROUTE 0x400
+#define ZEBRA_FLAG_RR_USE_DISTANCE 0x800
/* ZEBRA_FLAG_BLACKHOLE was 0x04 */
/* ZEBRA_FLAG_REJECT was 0x80 */