summaryrefslogtreecommitdiff
path: root/lib/if.h
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-03-02 15:00:46 -0300
committerRenato Westphal <renatowestphal@gmail.com>2019-03-29 11:32:21 -0300
commit8f88441d717c0ded412543cceabf0ddd93ee9f09 (patch)
tree0a460d2da46a5b910535529c92e8db2fa5ff2a74 /lib/if.h
parent6a534dcafcb623f1b85b5ee2a13c74faab227ced (diff)
parent700e9faa28bbdc3460e1d7aa109b6e4acaf347b3 (diff)
Merge remote-tracking branch 'frr/master' into rip-vrf
Merge commit to solve a bunch of conflicts with other PRs that were merged in the previous weeks. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/if.h')
-rw-r--r--lib/if.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/if.h b/lib/if.h
index 166bfa92b5..6689769beb 100644
--- a/lib/if.h
+++ b/lib/if.h
@@ -27,6 +27,10 @@
#include "qobj.h"
#include "hook.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
DECLARE_MTYPE(IF)
DECLARE_MTYPE(CONNECTED_LABEL)
@@ -290,9 +294,9 @@ struct interface {
};
RB_HEAD(if_name_head, interface);
-RB_PROTOTYPE(if_name_head, interface, name_entry, if_cmp_func);
+RB_PROTOTYPE(if_name_head, interface, name_entry, if_cmp_func)
RB_HEAD(if_index_head, interface);
-RB_PROTOTYPE(if_index_head, interface, index_entry, if_cmp_func);
+RB_PROTOTYPE(if_index_head, interface, index_entry, if_cmp_func)
DECLARE_QOBJ_TYPE(interface)
#define IFNAME_RB_INSERT(vrf, ifp) \
@@ -341,6 +345,8 @@ DECLARE_QOBJ_TYPE(interface)
DECLARE_HOOK(if_add, (struct interface * ifp), (ifp))
DECLARE_KOOH(if_del, (struct interface * ifp), (ifp))
+#define METRIC_MAX (~0)
+
/* Connected address structure. */
struct connected {
/* Attached interface. */
@@ -388,6 +394,13 @@ struct connected {
/* Label for Linux 2.2.X and upper. */
char *label;
+
+ /*
+ * Used for setting the connected route's cost. If the metric
+ * here is set to METRIC_MAX the connected route falls back to
+ * "struct interface"
+ */
+ uint32_t metric;
};
/* Nbr Connected address structure. */
@@ -536,4 +549,8 @@ void if_link_params_free(struct interface *);
extern void if_cmd_init(void);
extern const struct frr_yang_module_info frr_interface_info;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _ZEBRA_IF_H */