summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/route.c20
-rw-r--r--sys/net/route.h21
2 files changed, 21 insertions, 20 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index 456caab..105c932 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -63,26 +63,6 @@
#include <vm/uma.h>
-#ifndef ROUTETABLES
- #define RT_NUMFIBS 1
- #define RT_MAXFIBS 1
-#else
- /* while we use 4 bits in the mbuf flags,
- * we are limited to 16
- */
- #define RT_MAXFIBS 16
- #if ROUTETABLES > RT_MAXFIBS
- #define RT_NUMFIBS RT_MAXFIBS
- #error "ROUTETABLES defined too big"
- #else
- #if ROUTETABLES == 0
- #define RT_NUMFIBS 1
- #else
- #define RT_NUMFIBS ROUTETABLES
- #endif
- #endif
-#endif
-
u_int rt_numfibs = RT_NUMFIBS;
SYSCTL_INT(_net, OID_AUTO, fibs, CTLFLAG_RD, &rt_numfibs, 0, "");
/*
diff --git a/sys/net/route.h b/sys/net/route.h
index 249a41e..9a01aa6 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -82,6 +82,27 @@ struct rt_metrics {
#define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */
#define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ))
+/* MRT compile-time constants */
+#ifdef _KERNEL
+ #ifndef ROUTETABLES
+ #define RT_NUMFIBS 1
+ #define RT_MAXFIBS 1
+ #else
+ /* while we use 4 bits in the mbuf flags, we are limited to 16 */
+ #define RT_MAXFIBS 16
+ #if ROUTETABLES > RT_MAXFIBS
+ #define RT_NUMFIBS RT_MAXFIBS
+ #error "ROUTETABLES defined too big"
+ #else
+ #if ROUTETABLES == 0
+ #define RT_NUMFIBS 1
+ #else
+ #define RT_NUMFIBS ROUTETABLES
+ #endif
+ #endif
+ #endif
+#endif
+
extern u_int rt_numfibs; /* number fo usable routing tables */
extern u_int tunnel_fib; /* tunnels use these */
extern u_int fwd_fib; /* packets being forwarded use these routes */
OpenPOWER on IntegriCloud